CTFroom: Steel Mountain — Rejetto HFS Exploitation & Windows Unquoted Service Path
Exploiting Rejetto HTTP File Server 2.3 (CVE-2014-6287) to achieve initial foothold on Windows, running PowerUp.ps1 to uncover an Unquoted Service Path vulnerability, and replacing the service binary to gain SYSTEM authority.
Challenge Overview
Steel Mountain is a premier Windows machine walkthrough. It demonstrates targeting common third-party Windows software (Rejetto HTTP File Server) to obtain an initial PowerShell shell, followed by privilege escalation through one of the most classic Windows misconfigurations: Unquoted Service Paths.
Phase 1: Service Enumeration
Key services identified:
Visiting http://10.10.155.43:8080/ displays HttpFileServer 2.3.
Phase 2: Vulnerability Analysis (CVE-2014-6287)
Rejetto HFS version 2.3 is vulnerable to CVE-2014-6287, a Remote Code Execution vulnerability caused by improper handling of null bytes in search parameters.
We use an unauthenticated Python exploit or send a crafted HTTP GET request:
We stage a nc.exe (Netcat for Windows) binary on our Python HTTP server:
We execute a PowerShell command via the HFS vulnerability to download nc.exe and initiate a reverse shell:
On our Netcat listener:
User flag recovered from C:\Users\bill\Desktop\user.txt.
Phase 3: Enumerating Windows Privilege Escalation with PowerUp.ps1
To identify Windows privilege escalation vectors, we transfer PowerUp.ps1 (part of the PowerSploit suite):
We execute the audit suite:
PowerUp identifies an Unquoted Service Path vulnerability in a third-party service:
Phase 4: Exploiting the Unquoted Service Path
How the Vulnerability Works:
When Windows starts a service whose path contains spaces and is not wrapped in quotation marks, the Windows Service Control Manager interprets spaces as argument delimiters.
For the path:
C:\Program Files (x86)\IObit\Advanced SystemCare\ASCService.exe
Windows searches for executable files in this order:
C:\Program.exeC:\Program Files (x86)\IObit\Advanced.exeC:\Program Files (x86)\IObit\Advanced SystemCare\ASCService.exeBecause our user bill has write permissions inside C:\Program Files (x86)\IObit\, we can drop a malicious payload named `Advanced.exe`!
We generate our reverse shell payload with msfvenom:
We transfer Advanced.exe to the target:
Phase 5: Triggering Service Execution to SYSTEM
We start our listener on port 9999:
We restart the vulnerable service using the Windows command line:
When the service starts, Windows encounters our Advanced.exe and executes it as NT AUTHORITY\SYSTEM:
We are now SYSTEM. We navigate to C:\Users\Administrator\Desktop and collect root.txt.
Defense Remediation
HKLM\SYSTEM\CurrentControlSet\Services are surrounded by quotes: "C:\Program Files (x86)\...\ASCService.exe".