Chkrootkit是一个在本地系统检查rootkit痕迹的工具,它是检查系统二进制文件是否被rootkit病毒修改的一个shell脚本。
系统环境 Centos 6.4
chkrootkit-0.50(目前最新版本)
# tar xf chkrootkit.tar.gz
# cd chkrootkit
chkrootkit-0.50/ chkrootkit.tar.gz
# cd chkrootkit-0.50/
# make sense
cc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
make: cc: Command not found
make: *** [chklastlog] Error 127
# yum install gcc
然后再次 make sense
cc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
cc -DHAVE_LASTLOG_H -o chkwtmp chkwtmp.c
cc -DHAVE_LASTLOG_H -D_FILE_OFFSET_BITS=64 -o ifpromisc ifpromisc.c
cc -o chkproc chkproc.c
cc -o chkdirs chkdirs.c
cc -o check_wtmpx check_wtmpx.c
cc -static -o strings-static strings.c
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make: *** [strings-static] Error 1
这个错误在网上查找了半天,终于在一个fedora相关的论坛上找到了答案。个人感觉这个错误别人安装的时候遇到的不多,或者是直接 yum安装的。
# yum install glibc-static
# make clean
# make sense
cc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
cc -DHAVE_LASTLOG_H -o chkwtmp chkwtmp.c
cc -DHAVE_LASTLOG_H -D_FILE_OFFSET_BITS=64 -o ifpromisc ifpromisc.c
cc -o chkproc chkproc.c
cc -o chkdirs chkdirs.c
cc -o check_wtmpx check_wtmpx.c
cc -static -o strings-static strings.c
cc -o chkutmp chkutmp.c
# ./chkrootkit -V
直接执行chkrootkit命令
# ./chkrootkit
ROOTDIR is `/’
Checking `amd’… not found
Checking `basename’… not infected
Checking `biff’… not found
Checking `chfn’… not infected
Checking `chsh’… not infected
……
Checking `sniffer’… eth0: PF_PACKET(/sbin/dhclient)
Checking `w55808’… not infected
Checking `wted’… chkwtmp: nothing deleted
Checking `scalper’… not infected
Checking `slapper’… not infected
Checking `z2’… chklastlog: nothing deleted
Checking `chkutmp’… chkutmp: nothing deleted
Checking `OSX_RSPLUG’… not infected
Chkrootkit会对系统中的重要文件进行扫描,以上结果显示系统还是比较干净的。
可以将其加入crontab定时任务,定期进行扫描,看情况而定。