
WordPress 核心 get_page_template() — 未授权 LFI → PEAR 利用链 → RCE
一个暗色霓虹风格的 GUI,构建于 MRdark-ops/CVE-2026-87902 的逻辑之上。
一个现代化的 Tkinter GUI(仅使用标准库,无第三方依赖),用于
CVE-2026-87902 —— WordPress 核心中通过 get_page_template() 的
pagename 参数触发的未授权本地文件包含(LFI),并借助 PEAR 利用链
(pearcmd.php + config-create)升级为远程代码执行(RCE)。
4.7.0 – 7.1.16.8.10、7.0.6、7.1.27hp8-65ch-5whpcheck-only 模式可在不执行任何操作的情况下确认 LFIpearcmd.php(Linux + XAMPP/Windows),通过 config-create 写入 PHPfm_<hex>.php 投放至配置的投放目录pip install —— 纯标准库
(tkinter、urllib、ssl、socket、gzip、zlib、threading、queue 等)如果你的系统缺少 Tkinter(这是操作系统软件包,不是 pip 包):
| 平台 | 命令 |
|---|---|
| Debian / Ubuntu | sudo apt install python3-tk |
| Fedora / RHEL | sudo dnf install python3-tkinter |
| Arch Linux | sudo pacman -S tk |
| macOS (Homebrew) | brew install python-tk |
| Windows | 随官方 Python 安装程序一同捆绑 |
git clone https://github.com/tonydelouvre/CVE-2026-87902.git
cd CVE-2026-87902
python3 xwp_gui.py
键盘快捷键:
| 按键 | 操作 |
|---|---|
Ctrl+Enter | 开始扫描 |
Esc | 停止扫描 |
SINGLE(单个 URL)或 MASS,然后通过 BROWSE LIST 选择一个 .txt 文件,
其中每行包含一个 URL。exploit -> RCE 和 deploy file manager 以执行完整攻击链,或
勾选 check-only 进行安全的验证扫描。oracle、depths、segments、probe、threads、timeout、proxy。| 字段 | 默认值 | 描述 |
|---|---|---|
target url | – | 目标基础 URL(单目标模式) |
target list | – | URL 列表文件(批量模式) |
command | id | 达成 RCE 后执行的命令 |
drop dir | /tmp | 写入 File Manager 的目录 |
oracle | wp-links-opml | 被用作 LFI oracle 的核心文件 |
depths | 4,3,5,6,7 | 尝试的 ../ 遍历深度 |
segments | templates,templates/page-templates,page-templates | 主题的 page-* 目录 |
probe | 12 | 探测的 page_id 值数量 |
threads | 10 | 并行工作线程数(最大 50) |
timeout | 12.0 | 单次请求超时时间(秒) |
max time | 60.0 | 每个目标的时间预算(秒) |
proxy | – | http://host:port |
build_pagename() 生成 segment + %252f + N× %252e%252e%252f + 目标,
并应用双重 URL 编码:
/?page_id=<N>&pagename=templates%252f%252e%252e%252f...%252fwp-links-opml
| 阶段 | 模块 | 操作 |
|---|---|---|
| 1. 指纹识别 | Fingerprinter | 检测 WordPress 及版本(generator、?ver=、wp-links-opml.php)和主题 |
| 2. 前置条件 | PreconditionChecker | 定位用作遍历段的主题 page-* 目录 |
| 3. 发现 | PageDiscoverer | 通过 REST API、站点地图、短链接、page-id- 类收集 page_id 值 |
| 4. LFI | TraversalExploiter | 请求 ?page_id=N&pagename=<double-encoded path> 并查找 <opml version= 判定标志 |
| 5. RCE | RCEEscalator | 在深度 1–19 处定位 pearcmd.php gadget,通过 pear +config-create+ 写入 PHP,执行命令 |
| 6. 后利用 | shell.php | 将文件管理器(fm_<hex>.php)部署到投放目录 |
版本快捷判断:如果指纹识别报告 patched 或 out_of_range,则立即跳过目标以节省时间。
RESULTS 选项卡显示列 target、verdict、version、lfi、rce、shell。
分类为 VULNERABLE 的行以青色高亮显示;实现 RCE 的行变为品红色。
EXPORT 将所有内容写入 CSV:
target,verdict,version,lfi,rce,shell,detail
http://target.local,VULNERABLE,6.4,templates/../../ d=4 POST,uid=33(www-data),http://target.local/?page_id=2&pagename=...,
对于系统管理员:
7.1.2 或更高版本(向后移植版本:6.8.10、7.0.6、7.1.2)。pagename 中包含 ../ 或 %2e%2e 的请求。php.ini 中禁用 register_argc_argv —— 这会破坏 PEAR gadget 链。pearcmd.php。; php.ini
register_argc_argv = Off
仅限经授权的安全测试使用
本工具仅供渗透测试和安全研究使用,且须事先获得书面同意。未经明确授权对目标使用本工具属于:
使用本工具即表示您确认已获得针对目标的明确书面授权,您对自己的行为负责,且作者对滥用行为不承担任何责任。违规行为可能导致依据 CFAA、GDPR 第 32 条、《刑法典》第 323-1 条以及其他地方或国际网络犯罪法律被起诉。
MIT — 遵循原始仓库。