← 返回命令列表

Linux command

mitmproxy 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start mitmproxy

mitmproxy

Start on a specific port

mitmproxy -p [8888]

Start in reverse proxy mode

mitmproxy -m reverse:https://[example.com]

Start in transparent proxy mode

mitmproxy -m transparent

Load a Python script

mitmproxy -s [path/to/script.py]

Read flows from a file

mitmproxy -r [flows.mitm]

Ignore specific hosts

mitmproxy --ignore-hosts '^example\.com$'

Start web interface

mitmweb

说明

mitmproxy is an interactive man-in-the-middle proxy for HTTP and HTTPS traffic. It allows inspection, modification, and replay of web traffic through a console interface. The suite includes three tools: mitmproxy (console UI), mitmweb (web UI), and mitmdump (command-line only). The proxy works by intercepting connections and presenting its own certificate to clients. Install the mitmproxy CA certificate on clients to avoid SSL warnings. Traffic flows can be filtered, modified with Python scripts, or saved for later analysis. Proxy modes include regular (explicit proxy), transparent (network-level interception), reverse (forwarding to upstream), and SOCKS5. Python addons can modify requests and responses, implement custom logic, or integrate with other tools.

参数

-p _PORT_, --listen-port _PORT_
Proxy service port (default: 8080)
-m _MODE_, --mode _MODE_
Proxy mode: regular, transparent, socks5, reverse:SPEC, upstream:SPEC
-T, --transparent
Enable transparent proxy mode
--socks
Enable SOCKS5 proxy mode
-R _URL_, --reverse _URL_
Reverse proxy to upstream server (https://host:port)
-s _SCRIPT_
Path to Python script for flow manipulation
-r _FILE_
Read flows from file
-w _FILE_
Write flows to file
--ignore-hosts _REGEX_
Regex matching hosts to ignore (not intercepted)
--allow-hosts _REGEX_
Regex matching hosts to intercept
--anticache
Strip cache headers to prevent 304 responses
--insecure
Do not verify upstream SSL/TLS certificates
--cert _SPEC_
Add SSL certificate (path or directory)
--cadir _DIR_
Location of CA files (default: ~/.mitmproxy)
--no-http2
Disable HTTP/2 support
-q, --quiet
Quiet mode
-n, --no-server
Don't start a proxy server
--options
Dump all options as YAML
-h, --help
Show help message

FAQ

What is the mitmproxy command used for?

mitmproxy is an interactive man-in-the-middle proxy for HTTP and HTTPS traffic. It allows inspection, modification, and replay of web traffic through a console interface. The suite includes three tools: mitmproxy (console UI), mitmweb (web UI), and mitmdump (command-line only). The proxy works by intercepting connections and presenting its own certificate to clients. Install the mitmproxy CA certificate on clients to avoid SSL warnings. Traffic flows can be filtered, modified with Python scripts, or saved for later analysis. Proxy modes include regular (explicit proxy), transparent (network-level interception), reverse (forwarding to upstream), and SOCKS5. Python addons can modify requests and responses, implement custom logic, or integrate with other tools.

How do I run a basic mitmproxy example?

Run `mitmproxy` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -p _PORT_, --listen-port _PORT_ do in mitmproxy?

Proxy service port (default: 8080)