基本信息
端口扫描
22和80:
1 | nmap -sC -sV -Pn 10.129.249.215 |
80
需要加hosts:
1 | 10.129.249.215 pterodactyl.htb |
游戏相关的:
子域名扫描
子域名可以发现一个panel:
1 | ffuf -w ~/Tools/dict/SecLists/Discovery/DNS/subdomains-top1million-5000.txt -u "http://pterodactyl.htb/" -H "Host: FUZZ.pterodactyl.htb" -fs 145 |
panel
可以看到就是使用pterodactyl:
- Pterodactyl
https://pterodactyl.io/
CVE-2025-49132
搜索可以发现相关漏洞:
- Pterodactyl Panel Allows Unauthenticated Arbitrary Remote Code Execution · CVE-2025-49132 · GitHub Advisory Database
https://github.com/advisories/GHSA-24wv-6c99-f843 - malw0re/CVE-2025-49132—Pterodactyl-RCE-HTB-Season-10-
https://github.com/malw0re/CVE-2025-49132---Pterodactyl-RCE-HTB-Season-10-/
然后一步步操作,得到wwwrun shell:
1 | shell.sh |
user flag
wwwrun可以访问phileasfogg3用户目录:
env
环境变量里可以得到一些信息,包括数据库密码:
1 | wwwrun@pterodactyl:/home/phileasfogg3> env |
mysql
然后查看数据库,在其中得到hash,破解出密码:
1 | mysql -h 127.0.0.1 -u pterodactyl -p'PteraPanel' |
可以破解出phileasfogg3的密码:
1 | sudo hashcat -m 3200 hash.txt ~/Tools/dict/rockyou.txt |
phileasfogg3
得到的密码可以登录phileasfogg3,邮件里提示下一步:
1 | phileasfogg3@pterodactyl:~> cat /var/mail/phileasfogg3 |
邮件里说是和外部media有关,结合系统opensuse,搜索到相关漏洞:
- CVE-2025-6018 Common Vulnerabilities and Exposures | SUSE
https://www.suse.com/security/cve/CVE-2025-6018.html - CVE-2025-6019 Common Vulnerabilities and Exposures | SUSE
https://www.suse.com/security/cve/CVE-2025-6019.html - ibrahmsql/CVE-2025-6018: CVE-2025-6018 Poc and Exploit
https://github.com/ibrahmsql/CVE-2025-6018 - guinea-offensive-security/CVE-2025-6019
https://github.com/guinea-offensive-security/CVE-2025-6019
CVE-2025-6018 & CVE-2025-6019
所以先利用6018创造出6019所需的allow_active条件:
1 | python3 CVE-2025-6018.py -i pterodactyl.htb -u phileasfogg3 -p '!QAZ2wsx' |
得到的是一个交互终端,在里面运行6019,要先本地生成xfs.image然后传上去:
1 | scp xfs.image phileasfogg3@pterodactyl.htb:/home/phileasfogg3 |
root flag
运行完6019之后,tmp里可以看到一个suid的bash(这里输出不完整,没显示出suid bash路径,自己手动检查tmp即可):
shadow
1 | root:$6$iOhjvxjnk.Sgt97C$Fr4NzyL9SEFOiH653sh30DAR1kmR9jxGNeWMplTMQmlXVO/CfRXy7q2xopOBkfG2SG/I3O7KDOFHT7bOTZG.a0:20343:::::: |
参考资料
- Pterodactyl
https://pterodactyl.io/ - Pterodactyl Panel Allows Unauthenticated Arbitrary Remote Code Execution · CVE-2025-49132 · GitHub Advisory Database
https://github.com/advisories/GHSA-24wv-6c99-f843 - malw0re/CVE-2025-49132—Pterodactyl-RCE-HTB-Season-10-
https://github.com/malw0re/CVE-2025-49132---Pterodactyl-RCE-HTB-Season-10-/ - CVE-2025-6018 Common Vulnerabilities and Exposures | SUSE
https://www.suse.com/security/cve/CVE-2025-6018.html - CVE-2025-6019 Common Vulnerabilities and Exposures | SUSE
https://www.suse.com/security/cve/CVE-2025-6019.html - ibrahmsql/CVE-2025-6018: CVE-2025-6018 Poc and Exploit
https://github.com/ibrahmsql/CVE-2025-6018 - guinea-offensive-security/CVE-2025-6019
https://github.com/guinea-offensive-security/CVE-2025-6019