Skip to content

Instantly share code, notes, and snippets.

@3r1co
Created March 27, 2020 08:30
Show Gist options
  • Save 3r1co/b5deaadd1363f006a0fc40eb8f983104 to your computer and use it in GitHub Desktop.
Save 3r1co/b5deaadd1363f006a0fc40eb8f983104 to your computer and use it in GitHub Desktop.
#!/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