Intercept and replay
i
Set intercept filter, e.g. ~u api & ~q
I
Toggle intercept on / off
a
Resume the intercepted flow
A
Resume all intercepted flows
r
Replay request to the server
S
Start server replay of a flow set
Serves saved responses instead of contacting servers.
|
Run a script on this flow
x
Export flow (curl, httpie, raw...)
b
Save response body to file
Command line
mitmproxy -p <port>
Listen on another port
mitmdump -w <file>
Record flows to file
mitmproxy -r <file>
Open a saved flow file
mitmdump -nr <file>
Read file without proxying
mitmdump "<filter>"
Show only matching flows
--mode regular
Explicit proxy (default)
--mode local[:<app>]
Capture local apps by name or PID
--mode reverse:<url>
Front a single server
--mode transparent
Network-level capture (Linux, macOS)
--mode socks5
Run as SOCKS5 proxy
--mode wireguard
WireGuard server for devices
--mode upstream:<url>
Chain to another proxy
-s <script.py>
Load an addon script
--set <option>=<value>
Set any option
--ignore-hosts <regex>
Do not decrypt matching hosts
Use for apps that pin certificates.
--allow-hosts <regex>
Only decrypt matching hosts
--set block_global=false
Accept non-local clients
--set confdir=<dir>
Use another CA / config dir
--set client_replay=<file>
Replay flows at startup
--set server_replay=<file>
Serve responses from a flow file
Certificates
http://mitm.it
Download CA via the proxy
~/.mitmproxy/mitmproxy-ca-cert.pem
CA certificate (non-Windows)
~/.mitmproxy/mitmproxy-ca-cert.p12
CA certificate for Windows
~/.mitmproxy/mitmproxy-ca.pem
CA with private key: keep secret
curl --cacert <ca.pem> -x <proxy>
<url>
Trust CA for one curl call
certutil -addstore root <ca.cer>
Install CA on Windows