Mitmweb所有可选参数
usage: mitmweb [options]
optional arguments:
-h, --help show this help message and exit
--version show version number and exit
--options Show all options and their default values
--commands Show all commands and their signatures
--set option[=value] Set an option. When the value is omitted, booleans are set to true, strings and integers are
set to None (if permitted), and sequences are emptied. Boolean values can be true, false or
toggle.
-q, --quiet Quiet.
-v, --verbose Increase log verbosity.
--mode MODE, -m MODE Mode can be "regular", "transparent", "socks5", "reverse:SPEC", or "upstream:SPEC". For
reverse and upstream proxy modes, SPEC is host specification in the form of
"http[s]://host[:port]".
--no-anticache
--anticache Strip out request headers that might cause the server to return 304-not-modified.
--no-showhost
--showhost Use the Host header to construct URLs for display.
--rfile PATH, -r PATH
Read flows from file.
--scripts SCRIPT, -s SCRIPT
Execute a script. May be passed multiple times.
--stickycookie FILTER
Set sticky cookie filter. Matched against requests.
--stickyauth FILTER Set sticky auth filter. Matched against requests.
--save-stream-file PATH, -w PATH
Stream flows to file as they arrive. Prefix path with + to append.
--no-anticomp
--anticomp Try to convince servers to send us un-compressed data.
Mitmweb:
--no-web-open-browser
--web-open-browser Start a browser.
--web-port PORT Web UI port.
--web-host HOST Web UI host.
Proxy Options:
--listen-host HOST Address to bind proxy to.
--listen-port PORT, -p PORT
Proxy service port.
--no-server, -n
--server Start a proxy server. Enabled by default.
--ignore-hosts HOST 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. May be passed multiple times.
--allow-hosts HOST Opposite of --ignore-hosts. May be passed multiple times.
--tcp-hosts HOST Generic TCP SSL proxy mode for all hosts that match the pattern. Similar to --ignore-hosts,
but SSL connections are intercepted. The communication contents are printed to the log in
verbose mode. May be passed multiple times.
--upstream-auth USER:PASS
Add HTTP Basic authentication to upstream proxy and reverse proxy requests. Format:
username:password.
--proxyauth SPEC Require proxy authentication. Format: "username:pass", "any" to accept any user/pass
combination, "@path" to use an Apache htpasswd file, or
"ldap[s]:url_server_ldap:dn_auth:password:dn_subtree" for LDAP authentication.
--no-rawtcp
--rawtcp Enable/disable experimental raw TCP support. TCP connections starting with non-ascii bytes are
treated as if they would match tcp_hosts. The heuristic is very rough, use with caution.
Disabled by default.
--no-http2
--http2 Enable/disable HTTP/2 support. HTTP/2 support is enabled by default.
SSL:
--certs SPEC SSL certificates 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, else 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. May
be passed multiple times.
--cert-passphrase PASS
Passphrase for decrypting the private key provided in the --cert option.
--no-ssl-insecure
--ssl-insecure, -k Do not verify upstream server SSL/TLS certificates.
--key-size KEY_SIZE TLS key size for certificates and CA.
Client Replay:
--client-replay PATH, -C PATH
Replay client requests from a saved file. May be passed multiple times.
Server Replay:
--server-replay PATH, -S PATH
Replay server responses from a saved file. May be passed multiple times.
--no-server-replay-kill-extra
--server-replay-kill-extra
Kill extra requests during replay.
--no-server-replay-nopop
--server-replay-nopop
Don't remove flows from server replay state after use. This makes it possible to replay same
response multiple times.
--no-server-replay-refresh
--server-replay-refresh
Refresh server replay responses by adjusting date, expires and last-modified headers, as well
as adjusting cookie expiration.
Map Remote:
--map-remote PATTERN, -M PATTERN
Map remote resources to another remote URL using a pattern of the form "[/flow-filter]/url-
regex/replacement", where the separator can be any character. May be passed multiple times.
Map Local:
--map-local PATTERN Map remote resources to a local file using a pattern of the form "[/flow-filter]/url-
regex/file-or-directory-path", where the separator can be any character. May be passed
multiple times.
Modify Body:
--modify-body PATTERN, -B PATTERN
Replacement pattern of the form "[/flow-filter]/regex/[@]replacement", where the separator can
be any character. The @ allows to provide a file path that is used to read the replacement
string. May be passed multiple times.
Modify Headers:
--modify-headers PATTERN, -H PATTERN
Header modify pattern of the form "[/flow-filter]/header-name/[@]header-value", where the
separator can be any character. The @ allows to provide a file path that is used to read the
header value string. An empty header-value removes existing header-name headers. May be passed
multiple times.
Filters:
See help in mitmproxy for filter expression syntax.
--intercept FILTER Intercept filter expression.
Commands
# Start an isolated instance of Chrome that points to the currently
# running proxy.
browser.start
commands.history.add command
commands.history.clear
commands.history.filter prefix
# Get the entire command history.
commands.history.get -> str[]
commands.history.next -> str
commands.history.prev -> str
# Cut data from a set of flows. Cut specifications are attribute paths
# from the base of the flow object, with a few conveniences - "port"
# and "host" retrieve parts of an address tuple, ".header[key]"
# retrieves a header value. Return values converted to strings or
# bytes: SSL certificates are converted to PEM format, bools are "true"
# or "false", "bytes" are preserved, and all other values are
# converted to strings.
cut flows cuts -> data[][]
# Send cuts to the clipboard. If there are multiple flows or cuts, the
# format is UTF-8 encoded CSV. If there is exactly one row and one
# column, the data is written to file as-is, with raw bytes preserved.
cut.clip flows cuts
# Save cuts to file. If there are multiple flows or cuts, the format
# is UTF-8 encoded CSV. If there is exactly one row and one column,
# the data is written to file as-is, with raw bytes preserved. If the
# path is prefixed with a "+", values are appended if there is an
# existing file.
cut.save flows cuts path
# Clear the event log.
eventstore.clear
# Export a flow to the system clipboard.
export.clip format flow
# Export a flow to path.
export.file format flow path
# Return a list of the supported export formats.
export.formats -> str[]
# Decode flows.
flow.decode flows part
# Encode flows with a specified encoding.
flow.encode flows part encoding
# The possible values for an encoding specification.
flow.encode.options -> str[]
# Toggle flow encoding on and off, using deflate for encoding.
flow.encode.toggle flows part
# Kill running flows.
flow.kill flows
# Mark flows.
flow.mark flows boolean
# Toggle mark for flows.
flow.mark.toggle flows
# Resume flows if they are intercepted.
flow.resume flows
# Revert flow changes.
flow.revert flows
# Quickly set a number of common values on flows.
flow.set flows attr value
flow.set.options -> str[]
# Load options from a file.
options.load path
# Reset all options to defaults.
options.reset
# Reset one option to its default value.
options.reset.one name
# Save options to a file.
options.save path
readfile.reading -> bool
# Add flows to the replay queue, skipping flows that can't be replayed.
replay.client flows
# Approximate number of flows queued for replay.
replay.client.count -> int
# Load flows from file, and add them to the replay queue.
replay.client.file path
# Clear the replay queue.
replay.client.stop
# Replay server responses from flows.
replay.server flows
replay.server.count -> int
replay.server.file path
# Stop server replay.
replay.server.stop
# Save flows to a file. If the path starts with a +, flows are
# appended to the file, otherwise it is over-written.
save.file flows path
# Run a script on the specified flows. The script is configured with
# the current options and all lifecycle events for each flow are
# simulated. Note that the load event is not invoked.
script.run flows path
# Set an option. When the value is omitted, booleans are set to true,
# strings and integers are set to None (if permitted), and sequences
# are emptied. Boolean values can be true, false or toggle.
# Multiple values are concatenated with a single space.
set option value
# Clears both the store and view.
view.clear
# Clears only the unmarked flows.
view.clear_unmarked
# Sets the current view filter.
view.filter.set filter_expr
view.flows.create method url
# Duplicates the specified flows, and sets the focus to the first
# duplicate.
view.flows.duplicate flows
# Load flows into the view, without processing them with addons.
view.flows.load path
# Removes the flow from the underlying store and the view.
view.flows.remove flows
# Resolve a flow list specification to an actual list of flows.
view.flows.resolve flow_spec -> flow[]
# Go to a specified offset. Positive offests are from the beginning of
# the view, negative from the end of the view, so that 0 is the first
# flow, -1 is the last flow.
view.focus.go offset
# Set focus to the next flow.
view.focus.next
# Set focus to the previous flow.
view.focus.prev
# Returns the current view order.
view.order -> str
# Choices supported by the view_order option.
view.order.options -> str[]
view.order.reverse boolean
# Sets the current view order.
view.order.set order_key
# Is this 0 <= index < len(self)?
view.properties.inbounds index -> bool
# Returns view length.
view.properties.length -> int
# Returns true if view is in marked mode.
view.properties.marked -> bool
# Toggle whether to show marked views only.
view.properties.marked.toggle
# Get a value from the settings store for the specified flow.
view.settings.getval flow key default -> str
# Set a value in the settings store for the specified flows.
view.settings.setval flows key value
# Toggle a boolean value in the settings store, setting the value to
# the string "true" or "false".
view.settings.setval.toggle flows key