Skip to content

MITMProxy

mitmproxy is a free and open source interactive HTTPS proxy. It is a swiss-army knife for debugging, testing, privacy measurements, and penetration testing. It can be used to intercept, inspect, modify and replay web traffic such as HTTP/1, HTTP/2, WebSockets, or any other SSL/TLS-protected protocols.

Set-up

  1. Install mitmproxy. This will give you an executable of the same name.
  2. Execute the binary. This will create a default https proxy server.

Enable HTTPS (in Arch Linux)

  1. After installing mitmproxy run it in a terminal session and quit. This will create the necessaries certificates files at ~/.mitmproxy.
  2. Extract the certificate to .crt format: openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt
  3. Trust the certificate into CA: sudo trust anchor ca.crt
  4. Run the mitmproxy again
  5. Open another terminal session and set the proxy:
    export http_proxy='http://localhost:8080'
    export https_proxy='http://localhost:8080'
    
  6. Run a curl to an https site and it should work: curl https://www.google.com