Context
Enumeration
Rustscan
sudo rustscan -t 1500 -b 1500 --ulimit 65000 -a 10.13.37.12 -- -sV -sC -oA ./{{ip}}Ports
Open 10.13.37.12:443
Open 10.13.37.12:1433
Open 10.13.37.12:3389
Open 10.13.37.12:5985Services
PORT STATE SERVICE REASON VERSION
443/tcp open https? syn-ack ttl 127
1433/tcp open ms-sql-s syn-ack ttl 127 Microsoft SQL Server 2019 15.00.2070.00; GDR1
|_ms-sql-info: ERROR: Script execution failed (use -d to debug)
|_ms-sql-ntlm-info: ERROR: Script execution failed (use -d to debug)
3389/tcp open ms-wbt-server syn-ack ttl 127 Microsoft Terminal Services
5985/tcp open http syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windowsCurl
Dirsearch
But we have SSL!?
Enumeration
Since there's not that much of stuff to cover I started with getting a deeper look on the Webpage itself. The usual stuff like going through every site and checking the page source for example.
Flag
The flag was hidden under /Home/Staff. As soon as you check the page source you will find the flag and credentials for a user.
That shouldn't be there...
Enumeration
Using the credentials found earlier we are able to login as administrator for the webpage. First thing discovered was the new management tab where I'm able to add new products or remove current products.
This screamed SQL Injection in my face and after testing around I could confirm that we indeed have a SQL Injection here.
Can be verified by putting this into the name or certified field
Exploitation
Used SQLmap and a captured request from burp to dumo credentials from the database.
Flag
The flag is found under user id 3 in database table users
Have we met before?
Enumeration
I tried to use abbie.buckfast credentials to login to /ecp which unfortunately didn't work as abbie isn't an exchange admin. A login to /owa worked.
There was nothing much to check but the option to "open another mailbox" seemed interesting.
Exploitation
I checked the "People" tab to identify any users that exist and have a mailbox. In the end I was able to open jay.teningtons mailbox. Whic hwas obvious as stated in the comment for "But we have SSL!?" it states that abbie will take over his duties.
Flag
The flag can be found within jays account mailbox in the Sent Items folder.
Is it a bird? Is it a plane?
Enumeration
After getting hold of jays OWA mailbox I was able to view a mail which had the webapp attached to it. Since there's nothing else to find I will analyze the source.
One thing that I always keep an eye out for is deserialization and this time I was lucky to spot something easily.
_ViewStart.cshtml
Exploitation
I'm used to do everything on my Linux machine this time I had to switch to Windows for generating my payload. Used ysoserial.net for it.
I then opened a listener to catch my shell
Next set a cookie called Profile and add the value generated by ysoserial as Value. Login to /admin and receive your shell.
Flag
The flag was located at:
This looks bad!
Enumeration
Poking around the system I found an interesting folder
In there was another folder called WEBDB which hold a couple of logs. To be specific a couple of MSSQL Trace Logs which can include interesting data.
Exploitation
Using the login details discovered I was able to connect to the mssql server.
Flag
Connecting to mssql server using sqsh
Find trustable links
Get DBs
Get Tables and dump content
That's were the flag was found.
It's not a backdoor, it's a feature
Enumeration
Couldn't find that much on the DB itself so I logged into OWA using karls account to find an E-Mail that says
Now it was time to check the DB again for stuff that could be used as a user
Let's get that file onto my client
I used ILSpy to decompile the dll and check the source code. You'll find a function called BackupClients there, this part holds credentials for the user jay.teignton.
Exploitation
Nothing to "exploit" just use evil-winrm to get access to the system
Flag
Locating the flag wasn't as straight forward as I thought. Most of the time it's just a file on Desktop or any other location. After poking around I started to check a file that seemed suspicious and was called WindowsService.exe and located in the documents folder.
Key to the castle
Enumeration
Exploitation
No need to exploit anything
Flag
The flag can be found here
Last updated