Issues to keep in mind are:
#!/bin/sh # Insert connection-tracking modules (not needed if built into the kernel). modprobe ip_tables modprobe iptable_filter modprobe ip_conntrack modprobe ip_conntrack_ftp modprobe ipt_state #modprobe ipt_LOG #flush the tables (so this script is reusable) iptables -F # set a sane policy: everything not accepted > /dev/null iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT DROP # allow local-only connections iptables -A INPUT -i lo -j ACCEPT # free output on any interface to any ip for any service (equal to -P ACCEPT) iptables -A OUTPUT -j ACCEPT # permit answers on already established connections # and permit new connections related to established ones (eg active-ftp) iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #allow ssh from instructor's station in 265 lab iptables -A INPUT -s 192.168.1.150 -p tcp --dport 22 -j ACCEPT # Log everything else: What's Windows' latest exploitable vulnerability? #iptables -A INPUT -j LOG --log-prefix "FIREWALL:INPUT " # be verbose on dynamic ip-addresses (not needed in case of static IP) #echo 2 > /proc/sys/net/ipv4/ip_dynaddr # disable ExplicitCongestionNotification - too many routers are still ignorant echo 0 > /proc/sys/net/ipv4/tcp_ecn echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts echo "1" > /proc/sys/net/ipv4/tcp_syncookies
You can update your firewall rules at any time by running /etc/rc.d/init.d/firewall because it flushes the rules before inserting the new ones.iptables -A INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
The bad news is you have to reinstall your entire system. I can't say that strongly enough. You may be able to find and fix a couple of things that have been touched, but there are probably a whole host of things which may not be found for a long time, if at all. Many times, the programs which come out of the rootkit make it impossible to clean up without reformatting. So the things to do are:
-p icmp --icmp-type echo-request
©2005, Kenneth R. Koehler. All Rights Reserved. This document may be freely reproduced provided that this copyright notice is included.
Please send comments or suggestions to the author.