root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat pterodactyl.md
// writeups

Pterodactyl

7 Feb 2026 · 8 min read · root access
Pterodactyl — Hack The Box machine

Executive summary — Pterodactyl chains three 2025 CVEs. A file-inclusion flaw in Pterodactyl Panel (CVE-2025-49132) leaks the configuration and, combined with PEAR, gives code execution as the web user. A readable .env and a reused weak password lead to SSH. And two chained flaws in Linux's session and disk stack, CVE-2025-6018 (PAM/polkit) and CVE-2025-6019 (UDisks2), turn that unprivileged account into root.

PlatformHack The Box
Operating systemLinux
DifficultyMedium
StatusRetired
Target IP10.129.85.31

Attack map

[80] pterodactyl.htb (MonitorLand) — vhost panel.pterodactyl.htb
   │  Pterodactyl Panel 1.11.10 (Laravel 10 / PHP 8.4), changelog + phpinfo exposed
   ▼
[CVE-2025-49132]  /locales/locale.json — require() with path traversal
   │  config leak -> LFI -> pearcmd.php (LFI2RCE with PEAR)
   ▼
[RCE]  wwwrun
   │  readable .env -> MySQL -> phileasfogg3 bcrypt hash -> john
   ▼
[SSH]  phileasfogg3  (user.txt)
   │  CVE-2025-6018 — ~/.pam_environment: the SSH session becomes "active" for polkit
   │  CVE-2025-6019 — UDisks2 Filesystem.Resize mounts XFS without nosuid
   ▼
[ROOT]  SUID bash from the XFS image -> bash -p

1. Reconnaissance

nmap -p- --min-rate 3000 10.129.85.31      # 22, 80
nmap -sCV -p22,80 10.129.85.31
# 80 -> 302 Location: http://pterodactyl.htb/
echo "10.129.85.31 pterodactyl.htb panel.pterodactyl.htb play.pterodactyl.htb" | sudo tee -a /etc/hosts
PortServiceDetail
22/tcpSSHOpenSSH 9.6
80/tcpHTTPnginx 1.21.5 (PHP-FPM 8.4 / Laravel)

The landing page (MonitorLand, a Minecraft server) links to /changelog.txt, which reveals the whole stack:

[Installed] Pterodactyl Panel v1.11.10
 - MariaDB 11.8.3 backend
[Enhanced] PHP Capabilities
 - Enabled PHP-FPM ... Enabled PHP-PEAR ... Added temporary PHP debugging via phpinfo()
  • panel.pterodactyl.htb is Pterodactyl Panel v1.11.10 (Laravel 10 / PHP 8.4), found by vhost fuzzing.
  • http://pterodactyl.htb/phpinfo.php is exposed: short_open_tag=Off, empty disable_functions, register_argc_argv=On and an include_path containing /usr/share/php/PEAR.

Why it matters. PEAR installed, register_argc_argv=On and a PHP inclusion point make up the classic pearcmd.php LFI2RCE pattern.

🔒 Clearance required

Root Access unlocks the content you can't see — everything else on the site is already open.

See Root Access plans

No account? Create one free then upgrade from your console.