Skip to content

Latest commit

 

History

History
101 lines (69 loc) · 1.74 KB

mitmproxy.md

File metadata and controls

101 lines (69 loc) · 1.74 KB

Mitm Proxy Advanced Usage

Basic Commands

  • Start mitmproxy with default settings:

    mitmproxy
  • Start mitmproxy bound to a custom address and port:

    mitmproxy --listen-host <ip_address> --listen-port <port>
  • Start mitmproxy using a script to process traffic:

    mitmproxy --scripts <script.py>
  • Export the logs with SSL/TLS master keys to external programs (wireshark, etc.):

    SSLKEYLOGFILE="path/to/file" mitmproxy

Advanced Configuration

  • Start mitmproxy in transparent mode:

    mitmproxy --mode transparent
  • Start mitmproxy with a specific CA certificate:

    mitmproxy --set ssl_insecure=true --set cadir=/path/to/ca_directory
  • Enable sticky cookie mode:

    mitmproxy --set stickycookie=<filter>
  • Enable sticky auth mode:

    mitmproxy --set stickyauth=<filter>
  • Set upstream proxy server:

    mitmproxy --mode upstream:<scheme>://<proxy_host>:<proxy_port>
  • Dump traffic to a file:

    mitmdump -w outfile
  • Read traffic from a file:

    mitmdump -r infile
  • Replay traffic from a file in mitmproxy:

    mitmproxy -r infile

Web Interface

  • Start mitmweb, the web interface for mitmproxy:

    mitmweb
  • Start mitmweb with custom web interface options (e.g., port and web address):

    mitmweb --web-host <ip_address> --web-port <port>

Filtering Traffic

  • Start mitmproxy with a specific filter to view or intercept:

    mitmproxy --view-filter '<filter_expression>'
  • Use a specific filter for intercepting traffic:

    mitmproxy --intercept '<filter_expression>'