今天早上起来打开网站突然感觉很慢,然后一测,各种丢包,一开始以为是不是IP被墙了,但是用国外的地址测试也是各种丢,发linode的TK他们要了mrt(类似tracert的东西,可以看源地址到目的地址的包丢失率).
linux下的命令为:mrt -r x.x.x.x
发完之后确定是服务器的问题,然后用Console登进去top了一下发现排第一的进程竟然CPU占用率100多,后面的进程竟然显示iptable,从字面上来理解是防火墙。这不科学啊,于是乎百度了一下果然发现问题。
参照http://www.xujiansheng.cn/2014/01/linux-viruses-iptablex-iptables/ 及http://zhumeng8337797.blog.163.com/blog/static/10076891420142142446597/
使用find命令查找IptabLe
#find /boot/ | grep ‘IptabLe’
/boot/IptabLex
/boot/IptabLes
/boot/
.IptabLex
/boot/
.IptabLes
#find /etc/ | grep ‘IptabLe’
etc/rc
.d
/rc3
.d
/S55IptabLex
/etc/rc
.d
/rc3
.d
/S55IptabLes
/etc/rc
.d
/rc4
.d
/S55IptabLex
/etc/rc
.d
/rc4
.d
/S55IptabLes
/etc/rc
.d
/init
.d
/IptabLes
/etc/rc
.d
/init
.d
/IptabLex
/etc/rc
.d
/rc5
.d
/S55IptabLex
/etc/rc
.d
/rc5
.d
/S55IptabLes
/etc/rc
.d
/rc2
.d
/S55IptabLex
/etc/rc
.d
/rc2
.d
/S55IptabLes
/etc/rc
.d
/IptabLes
/etc/rc
.d
/IptabLex
# rm -f /boot/.IptabLex
# rm -f /boot/..IptabLes 编译后的二进制文件
# rm -f /etc/rc.d/init.d/IptabLex
# rm -f /etc/rc.d/init.d/IptabLes
#!/bin/sh
########################################################
#author: Asheng Xu
# Mail: [email protected]
# QQ: 121854289
# blog:http://www.xujiansheng.cn
#
#create date: 2014-01-16
#
#
#note:
# kill IptabLes and IptabLex virus.
#
########################################################
#
lwc=$(ps -ef | grep IptabL | grep -v grep | wc -l)
echo “==================”
date
echo $lwc
if [ $lwc -ne 0 ] ; then
echo “======kill IptabLes IptabLex session======”
ps -ef | grep IptabL
ps -ef | grep IptabL | grep -v grep | awk ‘{print $2}’ | xargs kill -9
echo “======kill all IptabLes IptabLex file======”
find / -name “*IptabL*” -print
find / -name “*IptabL*” -exec rm -f {} \;
ls -al /.mylisthb*
rm -f /.mylisthb*
fi
定期检测删除。但愿用不到。
附两个查看日志小命令:
# cat /var/log/secure
# cat /var/log/messages
两种日志信息,仅供分析。
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all 防PING
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all 恢复