-
Good-MITM 如何支持透明代理? |
Beta Was this translation helpful? Give feedback.
Answered by
zu1k
Mar 27, 2023
Replies: 1 comment
-
Good-MITM 的代理端口同时支持透明代理和http代理两种模式,并且透明代理的模式下,http和https流量支持单端口复用。 具体通过 iptables 进行流量重定向,例如 good-mitm 监听 0.0.0.0:34567,就需要将 80 和 443 端口的流量重定向到 good-mitm 监听的 34567 端口 具体见示例: sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -w net.ipv6.conf.all.forwarding=1
sudo sysctl -w net.ipv4.conf.all.send_redirects=0
sudo useradd --create-home mitm
sudo -u mitm -H bash -c 'good-mitm run -r rules/log.yaml -b 0.0.0.0:34567'
sudo iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitm --dport 80 -j REDIRECT --to-port 34567
sudo iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitm --dport 443 -j REDIRECT --to-port 34567
sudo ip6tables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitm --dport 80 -j REDIRECT --to-port 34567
sudo ip6tables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner mitm --dport 443 -j REDIRECT --to-port 34567 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
a1ex4ord
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good-MITM 的代理端口同时支持透明代理和http代理两种模式,并且透明代理的模式下,http和https流量支持单端口复用。
具体通过 iptables 进行流量重定向,例如 good-mitm 监听 0.0.0.0:34567,就需要将 80 和 443 端口的流量重定向到 good-mitm 监听的 34567 端口
具体见示例: