O'Reilly logo

Learning Python Web Penetration Testing by Christian Martorella

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Why mitmproxy?

Mitmproxy is an interactive console program that allows traffic flows to be intercepted, inspected, modified, and replayed. After researching for this section, I decided that the easiest and most complete way to learn about HTTP proxies in Python is by using mitmproxy. Any other attempt is more complex and limited than mitmproxy.

Mitmproxy is developed in Python and allows users to extend it via their inline scripts. It supports SSL out of the box, unlike other alternatives out there that support only HTTP.

Let's see how mitmproxy works using a simple example. If we go to the Terminal and type mitmproxy, we get an mitmproxy console listening at port 8080:

If we change our browser settings to use proxy for HTTP connections, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required