Rootkit分析(3)

作者: 来源: 添加时间:2006-5-23 8:36:27
检测


t0rn安装后,比较难以检测,因为ps、top、du、ls和netstat等程序都被替换掉了。可以采取以下办法来检测、清除t0rn rootkit。


使用数据完整性检测工具

这时最简单,也是最为有效的一种方法。在系统安装完毕,以及修改系统配置之后,使用trip_wire或者aide等数据完整性检测工具对系统配置文件、可执行文件以及其它重要文件进行校验,把校验结果数据库放在一个安全的地方。如果发生系统被入侵或者被病毒感染等情况,通过校验结果数据库很容易找出被修改的文件。这些工具使用的校验方法非常强大、丰富,非常难以伪造,因此有非常高的可靠性。这种方法适用性非常广泛,也非常简单,但是却非常容易被忽视。


lsof

t0rn rootkit的作者不知是有意还是无意,忽略了一个很重要的工具:lsof,这是他的一个失策。使用lsof很容易查出t0rn的蛛丝马迹。


#lsof|grep LISTEN<--列出有进程监听的端口

nscd 107 root 8u IPv4 110 TCP *:47017 (LISTEN)<--露馅了:)
inetd 370 root 5u IPv4 329 TCP *:ftp (LISTEN)
inetd 370 root 6u IPv4 330 TCP *:telnet (LISTEN)
inetd 370 root 7u IPv4 331 TCP *:shell (LISTEN)
inetd 370 root 9u IPv4 332 TCP *:finger (LISTEN)
inetd 370 root 10u IPv4 333 TCP *:linuxconf (LISTEN)

#lsof |grep t0rn<--列出所有被t0rn使用的文件描述符

t0rns 557 root cwd DIR 3,1 0 51920 /home/tmiller/tk (del
eted)
t0rns 557 root rtd DIR 3,1 4096 2 /
t0rns 557 root txt REG 3,1 6948 51927 /usr/src/.puta/t0rns
t0rns 557 root mem REG 3,1 25034 19113 /lib/ld-linux.so.1.9.
5
t0rns 557 root mem REG 3,1 699832 64363 /usr/i486-linux-libc5
/lib/libc.so.5.3.12
t0rns 557 root 0u sock 0,0 489 can't identify protoc
ol
t0rns 557 root 1w REG 3,1 0 51963 /home/tmiller/tk/syst
em (deleted)
t0rns 632 root cwd DIR 3,1 4096 36547 /usr/src/.puta
t0rns 632 root rtd DIR 3,1 4096 2 /
t0rns 632 root txt REG 3,1 6948 51927 /usr/src/.puta/t0rns
t0rns 632 root mem REG 3,1 25034 19113 /lib/ld-linux.so.1.9.
5
t0rns 632 root mem REG 3,1 699832 64363 /usr/i486-linux-libc5
/lib/libc.so.5.3.12
t0rns 632 root 0u sock 0,0 533 can't identify protoc
ol
t0rns 632 root 1w REG 3,1 0 34668 /usr/src/.puta/system


然后,就可以清理了。


nmap

SANS研究中心的Toby Miller提出了使用nmap来检测t0rn rootkit。使用nmap对可疑的主机进行端口扫描,很容易找出t0rn打开的监听端口47017。
站内搜索