Remote
Last updated
Last updated
This write-up details the steps taken to solve the Remote machine from Hack The Box. The approach includes reconnaissance, enumeration, exploitation, and privilege escalation to gain root access.
To begin the process, an nmap
scan was conducted to identify open ports and services running on the target machine:
The initial Nmap scan revealed a variety of open ports and running services on the target machine:
FTP anonymous is enabled, so I attempted to enumerate files on the FTP service:
I didn't find anything interesting:
During enumeration, I discovered a login page for Umbraco CMS:
Using gobuster to scan for directories, several were revealed. None appeared immediately exploitable, but it confirmed that Umbraco CMS was in use:
Attempts to access Samba shares as a guest were unsuccessful, as guest access was not permitted.
Reviewing the initial Nmap output for this port, I noticed that NFS (Network File System) services were running:
To check which folders were available for mounting, I used the following command:
Then, I mounted the discovered folder:
While researching typical Umbraco configurations, I learned that credentials are often stored in the App_Data/umbraco.sdf
file. Although I wasn’t familiar with the best way to parse this file type, using strings
on the file revealed sensitive information right at the top:
I detected a SHA-1 hashed password. Using CrackStation, I successfully cracked the hash:
This revealed the Umbraco admin password: baconandcheese
.
Next, I searched the version of Umbraco in use:
This exploit initially launches calc.exe
as the payload, so I modified it to download and execute a PowerShell reverse shell script instead. I used Nishang’s TCP reverse shell (shell.ps1
), hosted on my machine with Python’s http.server
. REMEMBER TO EDIT THE POWERSHELL SCRITP!
I hosted the shell.ps1
file using python -m http.server 80
to serve it for download by the target machine. Simultaneously, I started a listener on port 4444 with nc -lvnp 4444
to catch the reverse shell connection. When I ran the exploit, it triggered the payload, and the reverse shell successfully connected back to my machine, granting me access.
Finally, I retrieved the first flag from C:/Users/Public/Desktop/flag.txt
.
We noticed that SeImpersonatePrivilege
was enabled on the target machine, a Windows Server 2019 system. This configuration is vulnerable to token impersonation attacks. Given this, I decided to use PrintSpoofer to escalate privileges to SYSTEM.
First, I uploaded both nc.exe
and PrintSpoofer64.exe
to the victim machine using PowerShell:
Next, I started a listener on port 5555 on my machine. By executing PrintSpoofer64.exe
with a reverse shell command targeting nc.exe
, I gained SYSTEM-level access on the target.
The exploit successfully escalated privileges, completing the attack.
Using the credentials admin@htb.local:baconandcheese, I accessed the Umbraco CMS panel. The version in use was 7.12.4, a version vulnerable to an authenticated remote code execution exploit: .