HackTheBoxActiveDirectoryWindows

Monteverde

1. Enumeration

I started with an Nmap scan to see what we're dealing with. It’s a standard Windows Domain Controller.

There was no guest access to smb

Since there was no guest access to SMB or a website, I figured this would be a password attack. I first enumerated a user list using an LDAP anonymous bind.

2. Initial Access

I first tried rockyou.txt, but didn't get anything. I decided to try usernames as passwords. made a list of usernames

The user AAD_987d7f2f57d2 was a sign that this machine was about Azure AD, which is pretty interesting for me. then i first tried rockyou.txt, but didn't got anything so then tried using usernames as password.

And got access to 1 user

Logged in as SABatchJobs, I checked the SMB shares. In users$/mhope, I found an azure.xml file.

Content of azure.xml:

I expected this password to belong to the AAD account, but since it didn't work, I password sprayed my user list again.

Straight away, it worked on mhope. I used evil-winrm to get the user flag.

3. Privilege Escalation

I checked my groups and saw I belonged to Azure Admins, and ran a bloodhound scan as well (tho it wasn't needed, i just wanted to see which account had what type of privileges)

And azure admin privilege straight away gave the privilege escalation path, because Azure Admins have the permissions to access the local Microsoft SQL Server Express database (LocalDB) that Azure AD Connect uses. This database, typically named ADSync, stores the credentials used to synchronize the on-premises Active Directory with Azure AD. so i downloaded the Azure-ADConnect.ps1arrow-up-right script to extract the credentials synced between Azure AD and op-prem AD, and got the admin password in clear text

I logged back in with evil-winrm as the Administrator and grabbed the root flag.

Last updated