Optimum

Machine Level: Easy OS: Windows

Scanning

An aggressive NMAP scan revealed the HTTP server on port 80.

ajread@aj-ubuntu:~/hackthebox$ nmap -A [REDACTED] -Pn
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-14 17:13 EST
Nmap scan report for [REDACTED]
Host is up (0.012s latency).
Not shown: 999 filtered ports
PORT   STATE SERVICE VERSION
80/tcp open  http    HttpFileServer httpd 2.3
|_http-server-header: HFS 2.3
|_http-title: HFS /
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 15.33 seconds

Initial Access

I navigated to the web page and it appeared to be a bare-bones page. I noticed the version of the web page and looked for some exploits. I found a CVE with remote code execution here: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6287.

I used the proof of concept found here: https://www.exploit-db.com/exploits/49584. I changed the lhost and lport to point to my local box IP at port 8888. I ran the command got a shell!

And I was able to find the flag on the desktop for the user.

Privilege Escalation

I wanted to use the windows exploit suggester(https://github.com/AonCyberLabs/Windows-Exploit-Suggester) to see what was available for privilege escalation. I needed to update the database before running the command.

I had to revert my version of xlrd to be version 1.2.0 to run successfully in python2.

Using the writeup that I saw, I should target MS16-032 because of the exact version of Windows that matches the target and the ease of use with a Powershell command. I searched for an exploit in metasploit.

But, I needed to backtrack and get on the system using the HFS exploit and was made evident from the intial NMAP scan and can be found here.I started up metasploit and grabbed the windows/http/rejetto_hfs_exec exploit with the correct values or rhost, lhost, srvport, and srvhost.

I backgrounded the metasploit session and searched for the MS16-032 from the exploit suggester.

I set the correct session and executed the post exploitation vulnerability.

And I was able to get root!

Assistance

I used the writeup here and here for help with inital access and privilege escalation. It was interesting to try initial access without the use of Metasploit. It made things slightly more complicated. Thanks for the help!

Last updated