代理 mitmproxy config.yaml 模板 使用笔记(二)
代理 mitmproxy config.yaml 模板 使用笔记(二)
mitmproxy config.yaml 模板
使用 mitmproxy
可能需要用到 config.yaml
来批量配置参数
目录
文件位置
配置文件默认读取路径:~/.mitmproxy/config.yaml
,见配置项:confdir: '~/.mitmproxy'
- linux 系统,如
/root/.mitmproxy/config.yaml
,没有则需要新建config.yaml
- windows 系统,如:
C:\Users\Admin\.mitmproxy\config.yaml
,用户名:Admin
,没有则需要新建config.yaml
命令行加载
请注意,配置文件中 confdir: '~/.mitmproxy'
,与命令行中参数值保持一致,或注释掉配置文件中的confdir
# 启动WEB GUI页面
mitmweb --set confdir='~/.mitmproxy'
# 启动非GUI
mitmproxy --set confdir='~/.mitmproxy'
常用的选项
# File : config_template.yaml
# Author : yqbao
%YAML 1.2
---
# Opposite of --ignore-hosts.
# Default: []
allow_hosts:
- '192.168.1.4:18000'
# Block connections from public IP addresses.
# Default: True
block_global: false
# 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.
# Default: []
# ignore_hosts: [ ]
# Address to bind proxy server(s) to (may be overridden for individual modes, see `mode`).
# Default: 0.0.0.0
listen_host: 0.0.0.0
# Port to bind proxy server(s) to (may be overridden for individual modes, see `mode`).
# By default, the port is mode-specific. The default regular HTTP proxy spawns on port 8080.
# Default: 8080
listen_port: 8080
...
全部配置项
全部配置项,如需了解选项说明,可见官网文档这里
# File : config_template.yaml
# Author : yqbao
%YAML 1.2
---
add_upstream_certs_to_client_chain: false
allow_hosts: [ ]
anticache: false
anticomp: false
# Block connections from public IP addresses.
# Default: True
block_global: true
block_list: [ ]
block_private: false
body_size_limit: null
cert_passphrase: null
certs: [ ]
ciphers_client: null
ciphers_server: null
client_certs: null
client_replay: [ ]
client_replay_concurrency: 1
command_history: true
confdir: '~/.mitmproxy'
connect_addr: null
connection_strategy: 'eager'
console_default_contentview: 'auto'
console_eventlog_verbosity: 'info'
console_flowlist_layout: 'default'
console_focus_follow: false
console_layout: 'single'
console_layout_headers: true
console_mouse: true
console_palette: 'solarized_dark'
console_palette_transparent: true
console_strip_trailing_newlines: false
content_view_lines_cutoff: 512
dumper_default_contentview: 'auto'
dumper_filter: null
export_preserve_original_ip: false
flow_detail: 1
# Save a HAR file with all flows on exit. You may select particular flows by setting save_stream_filter. For mitmdump, enabling this option will mean that flows are kept in memory.
# Default:
hardump: ''
http2: true
http2_ping_keepalive: 58
http3: true
ignore_hosts: [ ]
intercept: null
intercept_active: false
keep_host_header: false
keepserving: false
key_size: 2048
# Address to bind proxy server(s) to (may be overridden for individual modes, see `mode`).
# Default: 0.0.0.0
listen_host: 0.0.0.0
# Port to bind proxy server(s) to (may be overridden for individual modes, see `mode`).
# By default, the port is mode-specific. The default regular HTTP proxy spawns on port 8080.
# Default: 8080
listen_port: 8080
map_local: [ ]
map_remote: [ ]
mode:
- 'regular'
modify_body: [ ]
modify_headers: [ ]
normalize_outbound_headers: true
onboarding: true
onboarding_host: 'mitm.it'
proxy_debug: false
proxyauth: null
rawtcp: true
readfile_filter: null
rfile: null
save_stream_file: null
save_stream_filter: null
scripts: [ ]
server: true
server_replay: [ ]
server_replay_extra: 'forward'
server_replay_ignore_content: false
server_replay_ignore_host: false
server_replay_ignore_params: [ ]
server_replay_ignore_payload_params: [ ]
server_replay_ignore_port: false
server_replay_kill_extra: false
server_replay_nopop: false
server_replay_refresh: true
server_replay_reuse: false
server_replay_use_headers: [ ]
showhost: false
ssl_insecure: false
ssl_verify_upstream_trusted_ca: null
ssl_verify_upstream_trusted_confdir: null
stickyauth: null
stickycookie: null
stream_large_bodies: null
tcp_hosts: [ ]
termlog_verbosity: 'info'
tls_ecdh_curve_client: null
tls_ecdh_curve_server: null
tls_version_client_max: 'UNBOUNDED'
tls_version_client_min: 'TLS1_2'
tls_version_server_max: 'UNBOUNDED'
tls_version_server_min: 'TLS1_2'
udp_hosts: [ ]
upstream_auth: null
upstream_cert: true
validate_inbound_headers: true
view_filter: null
view_order: 'time'
view_order_reversed: false
web_columns:
- 'tls'
- 'icon'
- 'path'
- 'method'
- 'status'
- 'size'
- 'time'
web_debug: false
web_host: 127.0.0.1
web_open_browser: true
web_port: 8081
web_static_viewer: null
websocket: true
...
本文来自博客园作者:星尘的博客,转载请注明出处:https://www.cnblogs.com/yqbaowo/p/18175529