Monteverde
https://app.hackthebox.com/machines/Monteverde
Nmap
Add "10.10.10.172 megabank.local" to /etc/hosts.
Starting out again LDAP
we fire off a few nmap
scripts with null credentials.
This returns a large amount of information. This time, we can utilize ldapsearch
to grep
for userPrincipalName's
With valid user accounts we check them against Impacket's GetNPUsers.py
for any accounts that may have "Do not require kerberos preauthentication" enabled. As shown below we have zero valid results.
Using crackmapexec
we can spray the known usernames against themselves, looking for weak passwords against SMB
.
Which returns valid credentials for the account SABatchJobs.
Credentials
Using smbmap
with our new found account we see we have read access to the non default share "users$". Of which, the share contains a file of interest azure.xml
under the user mhope.
The file fortunately has clear text credentials.
Credentials
Checking the credentials against Evil-WinRM
gives us a valid login to the target system.
Once logged in, we can check the group memberships for the account mhope
. Noticing the user is a member of "Azure Admins" is of interest.
Further basic enumeration shows Azure AD Connect is installed.
Azure AD Connect is used to synchronize on premise AD identities and passwords up to Azure AD (AAD) and vice versa.
Azure AD Connect provides the following features:
Password hash synchronization - A sign-in method that synchronizes a hash of a users on-premises AD password with Azure AD.
Pass-through authentication - A sign-in method that allows users to use the same password on-premises and in the cloud, but doesn't require the additional infrastructure of a federated environment.
Federation integration - Federation is an optional part of Azure AD Connect and can be used to configure a hybrid environment using an on-premises AD FS infrastructure. It also provides AD FS management capabilities such as certificate renewal and additional AD FS server deployments.
Synchronization - Responsible for creating users, groups, and other objects. As well as, making sure identity information for your on-premises users and groups is matching the cloud. This synchronization also includes password hashes.
Health Monitoring - Azure AD Connect Health can provide robust monitoring and provide a central location in the Azure portal to view this activity.
Researching possible exploits with Azure AD Connect I came across the following blog post from VBscub, as well as tool to grab the plain text credentials stored in Azure AD Connect .
VBscrub: https://vbscrub.com/2020/01/14/azure-ad-connect-database-exploit-priv-esc/
Github: https://github.com/VbScrub/AdSyncDecrypt
Download the exploit and uploaded the contents to mhope's Documents directory.
Then change directory to "C:\Program Files\Microsoft Azure AD Sync\Bin"
. From here execute the AdDecrypt.exe
from mhope's
Documents directory.
Which gives us the domain administrator credentials.
Credentials
Where we are able to log in with Evil-WinRM
and grab the root flag.
Last updated