You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to set up a mitmproxy server as a Transparent Proxy following the official guide from https://docs.mitmproxy.org/stable/howto-transparent/, the requests reaching the proxy server keep looping indefinitely instead of being processed correctly.
Steps to reproduce the behavior:
Launch an Amazon EC2 instance (Amazon Linux 2023).
Download and extract the mitmproxy binary from https://mitmproxy.org/. yum install -y iptables wget https://downloads.mitmproxy.org/11.0.1/mitmproxy-11.0.1-linux-x86_64.tar.gz tar -zxvf mitmproxy-11.0.1-linux-x86_64.tar.gz
Enable IP forwarding and adjust system settings: sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv6.conf.all.forwarding=1 sysctl -w net.ipv4.conf.all.send_redirects=0
Set up iptables rules to redirect traffic: iptables -t nat -A PREROUTING -i enX0 -p tcp --dport 80 -j REDIRECT --to-port 8080 iptables -t nat -A PREROUTING -i enX0 -p tcp --dport 443 -j REDIRECT --to-port 8080 ip6tables -t nat -A PREROUTING -i enX0 -p tcp --dport 80 -j REDIRECT --to-port 8080 ip6tables -t nat -A PREROUTING -i enX0 -p tcp --dport 443 -j REDIRECT --to-port 8080
From another host, send a request: curl -x http://my-aws-server:8080 http://my-destination.ext
I also tried the steps outlined in section 5 of the guide (starting mitmproxy as another user, adjusting firewall rules and verifying packet ownership), but the issue persists. The requests always loop.
This discussion was converted from issue #7369 on December 12, 2024 12:09.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Description
When attempting to set up a mitmproxy server as a Transparent Proxy following the official guide from https://docs.mitmproxy.org/stable/howto-transparent/, the requests reaching the proxy server keep looping indefinitely instead of being processed correctly.
Steps to reproduce the behavior:
yum install -y iptableswget https://downloads.mitmproxy.org/11.0.1/mitmproxy-11.0.1-linux-x86_64.tar.gztar -zxvf mitmproxy-11.0.1-linux-x86_64.tar.gzsysctl -w net.ipv4.ip_forward=1sysctl -w net.ipv6.conf.all.forwarding=1sysctl -w net.ipv4.conf.all.send_redirects=0iptables -t nat -A PREROUTING -i enX0 -p tcp --dport 80 -j REDIRECT --to-port 8080iptables -t nat -A PREROUTING -i enX0 -p tcp --dport 443 -j REDIRECT --to-port 8080ip6tables -t nat -A PREROUTING -i enX0 -p tcp --dport 80 -j REDIRECT --to-port 8080ip6tables -t nat -A PREROUTING -i enX0 -p tcp --dport 443 -j REDIRECT --to-port 8080./mitmproxy --mode transparent --showhost --set block_global=falsecurl -x http://my-aws-server:8080 http://my-destination.extI also tried the steps outlined in section 5 of the guide (starting mitmproxy as another user, adjusting firewall rules and verifying packet ownership), but the issue persists. The requests always loop.
System Information
Mitmproxy: 11.0.1 binary
Python: 3.12.7
OpenSSL: OpenSSL 3.3.2 3 Sep 2024
Platform: Linux-6.1.115-126.197.amzn2023.x86_64-x86_64-with-glibc2.34
Beta Was this translation helpful? Give feedback.
All reactions