Nocturnal
Nmap
Ports dicovered: 22 and 80
gobuster scan:
Login screen
Register screen
Created an account and was taken to a dashboard that allows uploads
File types that I am allowed to use:
Uploaded a docx file
After uploading the docx file, we try to save it and capture the traffic via burpsuite. We are showned a view.php GET request
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 2985The output showed three users
In burpsuite I changed the username parameters to amanda and found a new file
Forward the request in burpsuite and confirmed the file within the dashboard
I opened the file and found a password
Logged in as amanda with the password I found. As I logged in, I noticed she has access to the admin panel
I used burpsuite to capture once I create a backups password
login.php shows the location of the database
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”0AI utilized hashcat to decrypt tobias password
The command I used was:
hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/rockyou.txtWith 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
I used the following command on a separate terminal to conduct an ssh tunnel
ssh -L 8080:127.0.0.1:8080 tobias@nocturnal.htbIf successful you should be redirected to a ISPconfig login screen
You are able to log in with username admin and the password for tobias
If successful you will see the dashboard
I discovered the ISPconfig version
Found this exploit
CVE-2023–46818Ran the exploit and successfully gain root shell
Root.txt
Rating





