|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: GhostLock - CVE-2026-43499 本地提权漏洞利用 |
| 4 | +--- |
| 5 | + |
| 6 | +# GhostLock |
| 7 | + |
| 8 | +## 漏洞概述 |
| 9 | + |
| 10 | +**CVE 编号:** CVE-2026-43499 |
| 11 | +**漏洞类型:** futex PI(优先级继承)栈 UAF(Use-After-Free) |
| 12 | +**影响范围:** Linux 内核 6.1 ~ 6.12(Android GKI) |
| 13 | +**利用效果:** 本地提权 + SELinux 禁用,获取 root shell |
| 14 | + |
| 15 | +## 工作原理 |
| 16 | + |
| 17 | +### 漏洞触发路径 |
| 18 | + |
| 19 | +``` |
| 20 | +用户空间 → pselect() → 内核栈上分配 rt_mutex_waiter |
| 21 | + → futex PI 操作触发 waiter 释放 |
| 22 | + → 释放后的 waiter 内存被 fd_set 操作重用 |
| 23 | + → 通过精心构造的 fd_set 数据控制 waiter 字段 |
| 24 | + → rb_erase() 触发任意内核内存写入 |
| 25 | +``` |
| 26 | + |
| 27 | +### 利用链 |
| 28 | + |
| 29 | +1. **漏洞触发:** 通过 `pselect()` + futex PI 竞争释放内核栈上的 `rt_mutex_waiter` |
| 30 | +2. **内存布局控制:** 用 `pipe_buffer` 喷射内核堆,构造 fake `rt_mutex_waiter` |
| 31 | +3. **任意写入:** 利用 `rb_erase()` 的树操作,将控制的指针写入目标地址 |
| 32 | +4. **提权路径:** |
| 33 | + - 修改 `cred` 结构体:uid/gid → 0,capabilities → 全部开启 |
| 34 | + - 禁用 SELinux:`selinux_state.enforcing` → 0 |
| 35 | +5. **验证:** 重新扫描 `ashmem_fops` 确认 CFI 完整性 |
| 36 | + |
| 37 | +## 支持的设备 |
| 38 | + |
| 39 | +| 设备 | 内核版本 | 状态 | |
| 40 | +|------|----------|------| |
| 41 | +| OPPO Find X8 (MT6991) | 6.6.118-android15 | ✅ 已适配 | |
| 42 | +| OnePlus Ace 6T | 6.1.x | ✅ 已验证 | |
| 43 | +| OnePlus 15 | 6.1.x | ✅ 已验证 | |
| 44 | +| OnePlus Pad 2 | 6.1.x | ✅ 已验证 | |
| 45 | +| Realme RMX5070 | 6.1.x | ✅ 已验证 | |
| 46 | + |
| 47 | +## 快速开始 |
| 48 | + |
| 49 | +### 编译 |
| 50 | + |
| 51 | +```bash |
| 52 | +# 设置 NDK 路径 |
| 53 | +export ANDROID_NDK_HOME=/path/to/android-ndk-r27c |
| 54 | + |
| 55 | +# 编译 |
| 56 | +make |
| 57 | +``` |
| 58 | + |
| 59 | +### 使用 |
| 60 | + |
| 61 | +```bash |
| 62 | +# 推送到手机 |
| 63 | +adb push ghostlock /data/local/tmp/ |
| 64 | +adb shell chmod 755 /data/local/tmp/ghostlock |
| 65 | + |
| 66 | +# 运行 |
| 67 | +adb shell /data/local/tmp/ghostlock |
| 68 | +``` |
| 69 | + |
| 70 | +## 文档 |
| 71 | + |
| 72 | +- [完整文档](https://github.com/wzhdgithub/GhostLock/blob/main/README.md) |
| 73 | +- [贡献指南](https://github.com/wzhdgithub/GhostLock/blob/main/CONTRIBUTING.md) |
| 74 | +- [安全政策](https://github.com/wzhdgithub/GhostLock/blob/main/SECURITY.md) |
| 75 | +- [更新日志](https://github.com/wzhdgithub/GhostLock/blob/main/CHANGELOG.md) |
| 76 | + |
| 77 | +## 许可证 |
| 78 | + |
| 79 | +本项目采用 [MIT 许可证](https://github.com/wzhdgithub/GhostLock/blob/main/LICENSE)。 |
| 80 | + |
| 81 | +## 联系方式 |
| 82 | + |
| 83 | +- **作者:** wzh |
| 84 | +- **邮箱:** yjhsbwssg@163.com |
| 85 | +- **GitHub:** https://github.com/wzhdgithub |
0 commit comments