Hacking Linux Exposed

About
Authors
Contents
Reviews
Foreword
Purchase

Articles
Books
Sourcecode
Tools
Errata

Home

 


(view this code in a separate window)

#
# An extreemly limited iptables ruleset - allow inbound
# accesses to port 80 or port 22, drop everything else.
# (All outbound access is permitted.)

/sbin/iptables -P INPUT DROP
/sbin/iptables -A INPUT -s 0/0 -d 192.168.1.102 --dport www -p tcp -j ACCEPT
/sbin/iptables -A INPUT -s 0/0 -d 192.168.1.102 --dport ssh -p tcp -j ACCEPT
/sbin/iptables -A INPUT -j LOG
/sbin/iptables -A INPUT -j DROP