[HTB] Optimum

This machine was pretty straightforward and much easier than I expected it to be. I truly feel like I have improved a lot in the past 2-3 weeks because 2 weeks ago, I definitely would’ve not been able to solve this machine by myself. I still have a lot of room to develop, and I found myself freezing and getting lost when it came to the privilege escalation stage. I definitely need to spend more time working on it. Still, I think I deserve to be proud of myself for tackling this machine (almost) entirely on my own.


alt text nmap scan showed that only 1 port open, which is the port 80 with the version of HttpFileServer httpd 2.3


alt text navigated to the web of target ip address 10.10.10.8.


alt text couldn’t find anything juicy excpet when I clicked on the login button there was this pop-up asking for credentials.


alt text I searched on searchsploit to see if there is an exploit for Httpfileserver 2.3 that I found through an nmap scan and there was one exploit titled Rejetto HttpFileserver 2.3.x - Remote Command Execution. RCE attack is exactly what I was hoping for.


alt text Since I knew there exists an exploit for the version that’s running on the server, I moved on to metasploit


alt text on the options page of the exploit, configured every required option including RHOSTS, RPORT, SRVHOST, SRVPORT, LHOST, and LPORT.


alt text successfully executed the exploit and gained access to the user shell.


alt text obtained the user flag.


alt text However with the current user privilege, I could not access the root user directory. It was time for privilege escalation to move up vertically.


alt text As I learned from the previous machines, searched for a post/multi/recon module and it returned 4 modules. The second module is the one I’ve used before on a machine which explores the current compromised local session and suggests all the potential exploits.

The post/multi/recon represents a category of post-exploitation modules designed to perform reconnaissance tasks on compromised systems.


alt text As you could see the module requires me to list a session I would like to use the exploit on. In my case, I listed the session that I previously obtained which had id 2.


alt text It outputted all the possible exploits I could run on the current backgrouned session and what I decided to use was named exploit/windows/local/ms16_032_secondary_logon_handle_privesc. As you could notice from its name, it is used for a privilege escalation exactly what I was looking for.


alt text successfully executed the exploit and gained the root shell! as you could see the getuid command returned NT AUTHORITY\SYSTEM, another name for root!


alt text Got the root flag :)


alt text

#Hack The Box