Information
Room
- Name: Lookback
- Profile: tryhackme.com
- Difficulty: Easy
- Description: You’ve been asked to run a vulnerability test on a production environment.
Write-up
Overview
Install tools used in this WU on BlackArch Linux:
Network enumeration
Add the custom local domain in the hosts file.
Port and service enumeration with nmap:
We can add the hostname of the machine too.
Web discovery
The homepage of http://win-12ouo7a66m7.thm.local/ returns nothing, while https://win-12ouo7a66m7.thm.local redirects us to the Microsoft OWA login page: https://win-12ouo7a66m7.thm.local/owa/auth/logon.aspx?replaceCurrent=1&url=https%3A%2F%2Fwin-12ouo7a66m7.thm.local%2Fowa%2F.
Web enumeration
On the http endpoint we can identify Microsoft ECP (Exchange Admin Center): https://win-12ouo7a66m7.thm.local/owa/auth/logon.aspx?replaceCurrent=1&url=https%3A%2F%2Fwin-12ouo7a66m7.thm.local%2Fecp.
And we don't have access for http://win-12ouo7a66m7.thm.local/test but over HTTPS (https://win-12ouo7a66m7.thm.local/test) it's asking us for credentials.
The default admin
/ admin
are working.
This gives us access to a LOG ANALYZER feature.
Web exploitation
If we input .
, we trigger an error disclosing the path where we are (C:
) and that we are in the context of PowerShell Get-Content
.
Now if we input '
, it allows to escape out context Get-Content('C:\'')
:
So to inject a command without errors, we can send BitlockerActiveMonitoringLogs') | whoami #
.
Which returns thm\admin
.
Reverse shell
So let's go to https://www.revshells.com/ to generate a reverse shell. The base64 payload is useful because it's not using quotes.
BitlockerActiveMonitoringLogs') | INJECT_PS_HERE #
On the user desktop there is the user flag and a a hint for the following steps.
Elevation of Privilege (EoP) - Exchange exploitation
The list of local users:
From the hint, it sounds that Exchange is outdated and vulnerable and that the way we should use to elevate privileges.
Let's find Exchange version.
So it's corresponding to Exchange Server 2019 CU9
(March 16, 2021) as we can see on Exchange Server build numbers and release dates.
As we can see on Microsoft Exchange Server Remote Code Execution Vulnerability - CVE-2021-34473, Microsoft Exchange Server 2019 Cumulative Update 9 is vulnerable to this EoP discovered by Orange Tsai.
There is an exploit on metasploit:
Here are the options I used:
Exploit is a success:
Here is the root flag: