Sitemap
4 min readSep 2, 2025

--

Nocturnal

Nmap

Press enter or click to view image in full size

Ports dicovered: 22 and 80

gobuster scan:

Press enter or click to view image in full size

Login screen

Press enter or click to view image in full size

Register screen

Press enter or click to view image in full size

Created an account and was taken to a dashboard that allows uploads

Press enter or click to view image in full size

File types that I am allowed to use:

Uploaded a docx file

Press enter or click to view image in full size

After uploading the docx file, we try to save it and capture the traffic via burpsuite. We are showned a view.php GET request

Press enter or click to view image in full size

ran an ffuf scan with the following command

ffuf -w /usr/share/wordlists/seclists/Usernames/Names/names.txt -u ‘http://nocturnal.htb/view.php?username=FUZZ&file=shell.docx' -H ‘Cookie: PHPSESSID=nmui7j7sl7ov9r2ori00qnmi7c’ -fs 2985

The output showed three users

Press enter or click to view image in full size

In burpsuite I changed the username parameters to amanda and found a new file

Press enter or click to view image in full size

Forward the request in burpsuite and confirmed the file within the dashboard

Press enter or click to view image in full size

I opened the file and found a password

Press enter or click to view image in full size

Logged in as amanda with the password I found. As I logged in, I noticed she has access to the admin panel

Press enter or click to view image in full size
Press enter or click to view image in full size

I used burpsuite to capture once I create a backups password

Press enter or click to view image in full size
Press enter or click to view image in full size

login.php shows the location of the database

Press enter or click to view image in full size

I was able to receive the username and encrypted password within the backups by changing the following parameters

Get Brian’s stories in your inbox

Join Medium for free to get updates from this writer.

within the password parameters I used the following

%0Abash%09-c%09"sqlite3%09/var/www/nocturnal_database/nocturnal_database.db%09.dump”0A
Press enter or click to view image in full size

I utilized hashcat to decrypt tobias password

The command I used was:

hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/rockyou.txt
Press enter or click to view image in full size

With the password, I ssh into tobias and found the user.txt file

I ran linpeas and found port 8080 active, which were not initially discovered during the nmap scan

Press enter or click to view image in full size

I used the following command on a separate terminal to conduct an ssh tunnel

ssh -L 8080:127.0.0.1:8080 tobias@nocturnal.htb

If successful you should be redirected to a ISPconfig login screen

Press enter or click to view image in full size

You are able to log in with username admin and the password for tobias

If successful you will see the dashboard

Press enter or click to view image in full size

I discovered the ISPconfig version

Press enter or click to view image in full size

Found this exploit

CVE-2023–46818
Press enter or click to view image in full size

Ran the exploit and successfully gain root shell

Press enter or click to view image in full size

Root.txt

Rating

Press enter or click to view image in full size

--

--