原文来自于 Vpsee: 利用 Linux 内核的多个安全漏洞获得 root 权限
系统安全高手 Dan Rosenberg 发布了一段 C 程序,这段200多行的程序利用了 Linux Econet 协议的3个安全漏洞,可以导致本地帐号对系统进行拒绝服务或特权提升,也就是说一个普通用户可以通过运行这段程序后轻松获得 root shell,以下在 update 过的 Ubuntu 10.04 Server LTS 上测试通过:
$ sudo apt-get update
$ sudo apt-get upgrade
$ uname -r
2.6.32-21-server
$ gcc full-nelson.c -o full-nelson
$ ./full-nelson
[*] Resolving kernel addresses...
[+] Resolved econet_ioctl to 0xffffffffa0131510
[+] Resolved econet_ops to 0xffffffffa0131600
[+] Resolved commit_creds to 0xffffffff8108b820
[+] Resolved prepare_kernel_cred to 0xffffffff8108bc00
[*] Calculating target...
[*] Failed to set Econet address.
[*] Triggering payload...
[*] Got root!
#
由于 RHEL/CentOS 默认不支持 Econet 协议,所以测试没有通过:
# yum update
$ uname -r
2.6.18-194.26.1.el5
$ gcc full-nelson.c -o full-nelson
$ ./full-nelson
[*] Failed to open file descriptors.
如果在企业环境用 Ubuntu 的话可能会比较杯具了,几百个帐号里总可以找到一两个帐号被内部或外部人员通过上面这段程序拿到 root,这对服务器的危害是毁灭性的。前天还在说 Ubuntu 在内核方面无作为,现在想起来还有点后怕。VPSee 提醒正在使用多个普通帐号登录 Ubuntu VPS 的朋友及时升级或打内核补丁,出售 VPN/SSH 帐号、提供免费 SSH 的商家尤其要小心 “客户” 捣乱,使用其他 Linux 发行版的朋友也最好检查一下自己的 VPS 有没有这些高危漏洞。
PS:另外,我在 Ubuntu 10.10 , Ubuntu 11.04 及一台 ArchLinux VPS 上分别进行了测试, 10.10 和 ArchLinux 提权失败,而 11.04 则提权成功。

PS2: Ubuntu 已修复此漏洞,请尽快更新你的系统。
16 Responses to Linux 再爆提权漏洞
YOTERYE
十二月 10th, 2010 at 9:51 上午
毕竟经济实力没有RH强大。。。所以总归会有欠人意的地方
[Reply]
Leos
十二月 10th, 2010 at 9:57 上午
Linux leos-desktop 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 09:00:03 UTC 2010 i686 GNU/Linux
Ubuntu10.04
leos@leos-desktop:~ $ ./a.out
[*] Resolving kernel addresses...
[+] Resolved econet_ioctl to 0xfd023350
[+] Resolved econet_ops to 0xfd023440
[+] Resolved commit_creds to 0xc016e080
[+] Resolved prepare_kernel_cred to 0xc016e3c0
[*] Calculating target...
[*] Triggering payload...
[*] Exploit failed to get root.
leos@leos-desktop:~ $
Linux leos-laptop 2.6.35-23-generic #41-Ubuntu SMP Wed Nov 24 10:18:49 UTC 2010 i686 GNU/Linux
ubuntu10.10
leos@leos-laptop:~$ ./a.out
[*] Resolving kernel addresses...
[+] Resolved econet_ioctl to 0xf8701340
[+] Resolved econet_ops to 0xf8701440
[+] Resolved commit_creds to 0xc016c8d0
[+] Resolved prepare_kernel_cred to 0xc016cd20
[*] Calculating target...
[*] Triggering payload...
[*] Exploit failed to get root.
leos@leos-laptop:~$
[Reply]
shily
十二月 10th, 2010 at 10:33 上午
shily@5M1SQ2X:~$lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid
shily@5M1SQ2X:~$cc -o root root.c
shily@5M1SQ2X:~$./root
[*] Resolving kernel addresses...
[+] Resolved econet_ioctl to 0xf8188350
[+] Resolved econet_ops to 0xf8188440
[+] Resolved commit_creds to 0xc016e080
[+] Resolved prepare_kernel_cred to 0xc016e3c0
[*] Calculating target...
[*] Failed to set Econet address.
[*] Triggering payload...
[*] Exploit failed to get root.
没有成功,:)
[Reply]
shily Reply:
十二月 10th, 2010 at 10:34 上午
@shily,
shily@5M1SQ2X:~$ uname -r
2.6.32-26-generic
[Reply]
riku Reply:
十二月 10th, 2010 at 10:38 上午
@shily, 看来 10.04 已经修复此漏洞了。
[Reply]
coreyu
十二月 10th, 2010 at 10:44 上午
[*] Resolving kernel addresses...
[+] Resolved econet_ioctl to 0xfafea2d0
[+] Resolved econet_ops to 0xfafea3c0
[+] Resolved commit_creds to 0xc016dcc0
[+] Resolved prepare_kernel_cred to 0xc016e000
[*] Calculating target...
[*] Triggering payload...
[*] Got root!
sh-4.1# ls
ubuntu 10.04.1,看来是真的,做服务器的话还是把GCC灭了好
[Reply]
darkkgg
十二月 10th, 2010 at 11:00 上午
昨天或者今天的安全更新已经修复了...
[Reply]
lh
十二月 10th, 2010 at 12:42 下午
archlinux失败,自己编译内核的话是不是没有这个问题。
[Reply]
vmlinz
十二月 10th, 2010 at 1:42 下午
这个既然是内核协议的漏洞,那和ubuntu发行商有什么关系。。。
再说它的内核应该是上游debian的内核。ubuntu的内核把需要的模块都打开了,所以有漏洞的机会也大些。
[Reply]
happyaron
十二月 10th, 2010 at 5:45 下午
Ubuntu kernel 2.6.37-8-generic 不受影响,但是漏洞利用程序本身会出现 Uninterruptable 的问题。
[Reply]
Mucid
十二月 10th, 2010 at 7:06 下午
呐,我还是不试了……
[Reply]
fanhe
十二月 10th, 2010 at 8:23 下午
我自编译内核有这个问题……
看来得把这个协议干掉
[Reply]
fanhe
十二月 10th, 2010 at 8:38 下午
是econet模块的问题,我特意打开内核配置看了看,这个模块本来就标记着“试验”
安全的做法是肯定不会编译这个模块的,我blacklist econet后就没问题了
[Reply]
zach
十二月 10th, 2010 at 9:30 下午
看到arch不能被提权感到很欣慰 ~^-^~
[Reply]
夏客行 » Linux 再爆提权漏洞
十二月 13th, 2010 at 3:16 下午
[...] 本文采用CC协议进行授权,转载本文请注明本文链接。/ 9 分类: Ubuntu 标签: 评论 (0) [...]
simonsun007
十二月 14th, 2010 at 5:52 下午
opensuse 11.3 测试报告:
simonsun@linux-czxp:~/桌面> uname -ra
Linux linux-czxp.site 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 i686 i686 i386 GNU/Linux
simonsun@linux-czxp:~/桌面> vim full-nelson.c
simonsun@linux-czxp:~/桌面> vim full-nelson.c
simonsun@linux-czxp:~/桌面> gcc full-nelson.c -o full-nelson
simonsun@linux-czxp:~/桌面> ./full-nelson
[*] Failed to open file descriptors.
[Reply]