Scroll to navigation

MITMDUMP(1) MITMDUMP(1)

NAME

mitmdump - a man-in-the-middle proxy with a command-line interface

SYNOPSIS

mitmdump [options] [filter]

DESCRIPTION

mitmdump is the command-line companion to mitmproxy. It provides tcpdump-like functionality to let you view, record, and programmatically transform HTTP traffic.

OPTIONS

Positional Arguments:

Filter.

Optional Arguments:

Show this help message and exit.
Config file path.
Show program's version number and exit.
Show system info and exit.
Show program's short version number and exit.
Strip out request headers that might cause the server to return 304-not-modified.
Location of the default mitmproxy CA files. (Default: ~/.mitmproxy)
Use the Host header to construct URLs for display.
Quiet.
Read flows from file.
Run a script. Surround with quotes to pass script arguments. Can be passed multiple times.
Set sticky cookie filter. Matched against requests.
Set sticky auth filter. Matched against requests.
Increase log verbosity.
Write flows to file.
Append flows to file.
Try to convince servers to send us un-compressed data.
Byte size limit of HTTP request and response bodies. Understands k/m/g suffixes, e.g. 3m for 3 megabytes.
Stream data to the client if response body exceeds the given threshold. If streamed, the body will not be stored in any way. Understands k/m/g suffixes, e.g. 3m for 3 megabytes.
Proxy Authentication: username:password
Continue serving after client playback or file read. We exit by default.
Increase flow detail display level. Can be passed multiple times.

Proxy Modes:

Forward all requests to upstream HTTP server: http[s]://host[:port]. Clients can always connect both via HTTPS and HTTP, the connection to the server is determined by the specified scheme.
Set SOCKS5 proxy mode.
Set transparent proxy mode.
Forward all requests to upstream proxy server: http://host[:port]

Proxy Options:

Address to bind proxy to (defaults to all interfaces).
Ignore host and forward all traffic without processing it. In transparent mode, it is recommended to use an IP address (range), not the hostname. In regular mode, only SSL traffic is ignored and the hostname should be used. The supplied value is interpreted as a regular expression and matched on the ip or the hostname. Can be passed multiple times.
Generic TCP SSL proxy mode for all hosts that match the pattern. Similar to --ignore, but SSL connections are intercepted. The communication contents are printed to the log in verbose mode.
Don't start a proxy server.
Proxy service port.
Explicitly disable HTTP/2 support. If your OpenSSL version supports ALPN, HTTP/2 is enabled by default.
Explicitly enable/disable experimental raw tcp support. Disabled by default. Default value will change in a future version.
Explicitly enable/disable experimental WebSocket support. Disabled by default as messages are only printed to the event log and not retained. Default value will change in a future version.
Use the client's IP for server-side connections.

SSL:

Add an SSL certificate. SPEC is of the form "[domain=]path". The domain may include a wildcard, and is equal to "*" if not specified. The file at path is a certificate in PEM format. If a private key is included in the PEM, it is used, otherwise the default key in the conf dir is used. The PEM file should contain the full certificate chain, with the leaf certificate as the first entry. Can be passed multiple times.
Set supported ciphers for client connections. (OpenSSL Syntax)
Set supported ciphers for server connections. (OpenSSL Syntax)
Client certificate file or directory.
Don't connect to upstream server to look up certificate details.
Add all certificates of the upstream server to the certificate chain that will be served to the proxy client, as extras.
Do not verify upstream server SSL/TLS certificates.
Path to a directory of trusted CA certificates for upstream server verification prepared using the c_rehash tool.
Path to a PEM formatted trusted CA certificate.
Set supported SSL/TLS versions for client connections. SSLv2, SSLv3 and all are INSECURE. Defaults to secure, which is TLS1.0+.
Set supported SSL/TLS versions for server connections. SSLv2, SSLv3 and all are INSECURE. Defaults to secure, which is TLS1.0+.

Onboarding App:

Disable the mitmproxy onboarding app.
Domain to serve the onboarding app from. For transparent mode, use an IP when a DNS entry for the app domain is not present. (Default: mitm.it)
Port to serve the onboarding app from. (Default: 80)

Client Replay:

Replay client requests from a saved file.

Server Replay:

Replay server responses from a saved file.
Kill extra requests during replay.
Request header to be considered during replay. Can be passed multiple times.
Disable response refresh, which updates times in cookies and headers for replayed responses.
Disable response pop from response flow. This makes it possible to replay same response multiple times.
Ignore request's content while searching for a saved flow to replay.
Request's payload parameter (application/x-www-form-urlencoded or multipart/form-data) to be ignored while searching for a saved flow to replay. Can be passed multiple times.
Request's parameter to be ignored while searching for a saved flow to replay. Can be passed multiple times.
Ignore request's destination host while searching for a saved flow to replay.

Replacements:

Replacements are of the form "/pattern/regex/replacement", where the separator can be any character. Please see the documentation for more information.

Replacement pattern.
Replacement pattern, where the replacement clause is a path to a file.

Set Headers:

Header specifications are of the form "/pattern/header/value", where the separator can be any character. Please see the documentation for more information.

Header set pattern.

Proxy Authentication:

Specify which users are allowed to access the proxy and the method used for authenticating them.

Allow access to any user long as a credentials are specified.
Allows access to a a single user, specified in the form username:password.
Allow access to users specified in an Apache htpasswd file.

FILES

~/.mitmproxy/mitmdump.conf
Settings for mitmdump. This file can contain any options supported by mitmdump.
~/.mitmproxy/common.conf
Settings shared between all command-line tools. Settings in this file are overridden by those in the tool-specific files. Only options shared by mitmproxy and mitmdump should be used in this file.

Options that start with -- (e.g. --version) can also be set in a config file (~/.mitmproxy/common.conf or ~/.mitmproxy/mitmdump.conf or specified via --conf). Config file syntax allows:

key=value, flag=true, stuff=[a,b,c]

(for details, see syntax at <https://goo.gl/R74nmi>). If an option is specified in more than one place, then command-line values override config file values which override defaults.

AUTHORS

mitmdump was written by Aldo Cortesi.

This manual page was written for the Debian GNU/Linux system, but its use elsewhere is encouraged.

SEE ALSO

mitmdump documentation and examples are available online at <http://docs.mitmproxy.org/en/latest/mitmdump.html>.

November 2016