TryHackMe: Steel Mountain Walkthrough

We will solve this room from TryHackMe, Steel Mountain.

Starting off with deploying the machine and quickly scanning the open ports with rustscan,

Rustscan result

We got the open ports and now we can scan them in detail using nmap,

Result scan shows that port 80 is running webserver, port 139,445 is running SMB service, port 5985 is running MS HTTPAPI service, port 8080 is running HttpFileServer service.

Let’s visit,

We landed on the page where we can see the picture of employee of the month. But after enumerating this website like looking at it’s source page, fuzzing it’s hidden directories, checking what technologies are there on this website, but I couldn’t find anything interesting.

So I decided to visit to enumerate port 8080 by visiting,

We landed on a page where HttpFileServer 2.3 is running and there is no file uploaded already on this website.

So I decided to search for the service exploit on the ExploitDB for HttpFileServer 2.3 exploit, Rejetto HTTP File Server (HFS) 2.3.x — Remote Command Execution (2)

CVE-2014–6287 : Rejetto HttpFileServer (HFS) is vulnerable to remote command execution attack due to a poor regex in the file ParserLib.pas. This module exploits the HFS scripting commands by using ‘%00’ to bypass the filtering. This module has been tested successfully on HFS 2.3b over Windows XP SP3, Windows 7 SP1 and Windows 8.

There is also metasploit module for this exploit so I decided to first boot up the metasploit using msfconsole -q (neglecting the banner), and the search for the exploit,

There is a module. We can use this module to exploit the machine which is vulnerable to this service.

Let’s use this module,

Let’s set the options:

Running the exploit using run and we got a shell,

we got a meterpreter shell. Issuing getuid command and we got to know that we are STEELMOUNTAIN\bill user.

Okay, so now we got a meterpreter shell so we can drop into shell (which is cmd, default for windows) using shell command. Navigating to bill user desktop, we got the user flag,

Now, that we are done with getting foothold process on machine, we now have to perform Privilege Escalation and to achieve this, we have to enumerate the system first. So Let’s upload the winpeas executable on the target machine using,

winpeas.exe got uploaded on the machine.

Let’s run this executable using winpeas.exe and after scrolling down the result, we can see that there are Unquoted Service Paths and bill user has permissions to write data/ create files on the directory making it’s easy for bill user to escalate privileges to Administrator user,

Now question arises, What are Unquoted Service Path?

When a service is created whose executable path contains spaces and isn’t enclosed within quotes, leads to a vulnerability known as Unquoted Service Path which allows a user to gain SYSTEM privileges (only if the vulnerable service is running with SYSTEM privilege level which most of the time it is).
In Windows, if the service is not enclosed within quotes and is having spaces, it would handle the space as a break and pass the rest of the service path as an argument.

Let’s try another command to confirm that there is Unquoted Service Path,

We can see that there is indeed an Unquoted Service Path and we can abuse this vulnerability to escalate our privilege to Administrator user by creating the file with same name as directory just before the service executable, Advanced.exe and windows will execute it first before even executing the original ASCService.exe and since our malicious file gets executed first, we will get a reverse shell.

Let’s create a malicious payload using msfvenom,

Our payload is generated and now is the time to transfer this payload into C:\Program Files (x86)\IObit directory. To transfer executable on target machine, first start the python server using python3 -m http.server and now we can use certutil command to transfer the payload,

Our malicious payload gets transferred successfully on the target machine.

Now, let’s first start the netcat listener using nc -nvlp 5555 and then let’s stop the service using,

The service is stopped.

Starting the service again,

After starting the service again, we will get the reverse shell and issuing the whoami command, we get to know that we are system user,

Now we can grab the Administrator user flag and we have successfully completed this challenge.

Alas, I can put my pen down. If you find any mistake, feel free to correct me. Thanks and have a great day (:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store