Subdomain Posts
None | 230 days ago
None | 328 days ago
None | 407 days ago
None | 409 days ago
None | 683 days ago
Bash | 692 days ago
None | 706 days ago
None | 786 days ago
Bash | 841 days ago
None | 845 days ago
Recent Posts
Java | 25 sec ago
PHP | 27 sec ago
Bash | 1 min ago
HTML | 1 min ago
Python | 1 min ago
PHP | 1 min ago
None | 1 min ago
HTML | 1 min ago
Bash | 2 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By transparent_proxysh on the 28th of Apr 2008 09:36:18 AM
Download |
Raw |
Embed |
Report
#!/bin/sh
iptables -t nat -F # clear table
iptables -t nat -X
iptables -t filter -F
iptables -t filter -X
# bypass laptop
iptables -t nat -A PREROUTING -p tcp -i eth1 -s 192.168.0.27 -j ACCEPT
# chains
iptables -t nat -N REDGUARDIAN
iptables -t nat -N REDSQUID
# normal transparent proxy
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 21 -j REDIRECT --to-port 2121
# handle connections on the same box (192.168.0.2 is a loopback instance)
gid=`id -g proxy`
dgid=`id -g dansguardian`
iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner $gid -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner $dgid -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner 1000 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner 0 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 21 -m owner --gid-owner $gid -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 192.168.0.5 --dport 80 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 192.168.0.27 --dport 80 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.0.1:3128
#iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.0.1:8080
iptables -t nat -A OUTPUT -p tcp --dport 21 -j DNAT --to-destination 192.168.0.1:2121
Submit a correction or amendment below.
Make A New Post