Created
March 27, 2020 08:30
-
-
Save 3r1co/b5deaadd1363f006a0fc40eb8f983104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IPTABLES="/usr/sbin/iptables -w 10" | |
${IPTABLES} -t nat -N TPROXYHTTP | |
${IPTABLES} -t nat -A TPROXYHTTP -o lo -j RETURN | |
${IPTABLES} -t nat -A TPROXYHTTP -d 127.0.0.0/8 -j RETURN | |
${IPTABLES} -t nat -A TPROXYHTTP -d 192.168.0.0/16 -j RETURN | |
${IPTABLES} -t nat -A TPROXYHTTP -d 10.0.0.0/8 -j RETURN | |
${IPTABLES} -t nat -A TPROXYHTTP -d 172.16.0.0/12 -j RETURN | |
${IPTABLES} -t nat -A TPROXYHTTP -p tcp --dport "80" -j REDIRECT --to-destination 192.168.1.33:3128 | |
${IPTABLES} -t nat -A TPROXYHTTP -p tcp --dport "443" -j REDIRECT --to-destination 192.168.1.33:3128 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment