Advertisement
Advertisement
| 08.15.2008 at 10:31AM PDT, ID: 23651997 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: |
#!/bin/bash IPTABLES=/sbin/iptables MODPROBE=/sbin/modprobe INT_NET=192.168.0.0/255.255.255.0 ### load the modules echo "[+] Loading modules..." $MODPROBE nf_conntrack $MODPROBE nf_nat $MODPROBE nf_conntrack_ftp $MODPROBE nf_conntrack_ipv4 $MODPROBE nf_nat_ftp ### flush existing rules and set chain policy setting to DROP echo "[+] Flushing existing iptables rules..." $IPTABLES -F $IPTABLES -F -t nat $IPTABLES -X $IPTABLES -P INPUT DROP $IPTABLES -P OUTPUT DROP $IPTABLES -P FORWARD DROP ###### INPUT chain ###### echo "[+] Setting up INPUT chain..." ### state tracking rules $IPTABLES -A INPUT -m state --state INVALID -j DROP $IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT ### anti-spoofing rules $IPTABLES -A INPUT -i eth0 -s ! $INT_NET -j DROP ### ACCEPT rules $IPTABLES -A INPUT -i lo -j ACCEPT $IPTABLES -A INPUT -i eth0 -s $INT_NET -j ACCEPT $IPTABLES -A INPUT -p icmp --icmp-type echo-request -j ACCEPT $IPTABLES -A INPUT -j DROP ###### OUTPUT chain ###### echo "[+] Setting up OUTPUT chain..." ### state tracking rules $IPTABLES -A OUTPUT -m state --state INVALID -j DROP $IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT ### ACCEPT rules for allowing connections out $IPTABLES -A OUTPUT -o lo -j ACCEPT $IPTABLES -A OUTPUT -o eth0 -d $INT_NET -j ACCEPT #FTP $IPTABLES -A OUTPUT -p tcp --dport 20 --syn -m state --state NEW -j ACCEPT $IPTABLES -A OUTPUT -p tcp --dport 21 --syn -m state --state NEW -j ACCEPT #SSH $IPTABLES -A OUTPUT -p tcp --dport 22 --syn -m state --state NEW -j ACCEPT #SMTP $IPTABLES -A OUTPUT -p tcp --dport 25 --syn -m state --state NEW -j ACCEPT #Whois $IPTABLES -A OUTPUT -p tcp --dport 43 --syn -m state --state NEW -j ACCEPT #HTTP $IPTABLES -A OUTPUT -p tcp --dport 80 --syn -m state --state NEW -j ACCEPT #HTTPS $IPTABLES -A OUTPUT -p tcp --dport 443 --syn -m state --state NEW -j ACCEPT #MSN $IPTABLES -A OUTPUT -p tcp --dport 1863 --syn -m state --state NEW -j ACCEPT #RTMP $IPTABLES -A OUTPUT -p tcp --dport 1935 -m state --state NEW -j ACCEPT #Google talk $IPTABLES -A OUTPUT -p tcp --dport 5222 --syn -m state --state NEW -j ACCEPT #IRC $IPTABLES -A OUTPUT -p tcp --dport 6667 --syn -m state --state NEW -j ACCEPT #Skype $IPTABLES -A OUTPUT -p tcp --dport 23399 --syn -m state --state NEW -j ACCEPT #DNS $IPTABLES -A OUTPUT -p udp --dport 53 -m state --state NEW -j ACCEPT #NTP $IPTABLES -A OUTPUT -p udp --dport 123 -m state --state NEW -j ACCEPT #IPP $IPTABLES -A OUTPUT -p udp --dport 631 -m state --state NEW -j ACCEPT #RTMP $IPTABLES -A OUTPUT -p udp --dport 1935 -m state --state NEW -j ACCEPT #ICMP $IPTABLES -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT $IPTABLES -A OUTPUT -j DROP |