Skip to content

透明代理 #63

Closed Answered by zu1k
a1ex4ord asked this question in Q&A
Discussion options

You must be logged in to vote

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 --dp…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by a1ex4ord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants