You don't need a library for MITM attacks. What is your purpose in wanting to learn this?