HTB: Monteverde · leaked Azure AD Connect credentials to Domain Admin
Overview
Monteverde is a retired medium-difficulty Windows Domain Controller from Hack The Box, built around a real-world misconfiguration: running Azure AD Connect directly on a Domain Controller. The path is:
- Anonymous LDAP enumeration recovers the real domain user list.
- A password spray using each username as its own password finds a working but low-privileged account.
- That account’s SMB access reveals a cleartext credential left in a user’s home share, giving an authenticated foothold.
- Group membership in a suspicious-looking “Azure Admins” group turns out to be a red herring for both ACL abuse and DCSync.
- The real path is Azure AD Connect’s own local credential store: since the sync service runs on this box, its connector account credentials can be decrypted locally, and that accountis the Domain Administrator.
Target: 10.129.228.111, a Windows Server Domain Controller for the domain MEGABANK.LOCAL.
Enumeration
Full TCP scan:
| |
| |
Kerberos, LDAP, the Global Catalog and ADWS (9389) confirm a Domain Controller. 593/49xxx (ncacn_http) is RPC-over-HTTP, not a browsable web server, so it doesn’t add attack surface here. With no starting credentials, the first thing worth checking is whether LDAP accepts an anonymous bind, a vector separate from, and in addition to, SMB null sessions:
| |
This works and returns the full list of domain users, along with userPrincipalName and description attributes. Note this is a genuinely separate enumeration path from the classic SMB/RPC null session (which also gets tested but, on this box, is not the one that pays off): LDAP anonymous bind is its own vector, worth testing even when SMB is locked down.
Foothold
With real usernames, AS-REP Roasting is the obvious next move, but it comes back empty:
| |
No account here has Kerberos pre-authentication disabled. Before trying anything louder, check the password policy:
| |
| |
No lockout and no enforced complexity mean password spraying is both safe and likely to work. A specific and often-overlooked variant is trying each username as its own password:
| |
| |
One hit. SABatchJobs authenticates over SMB but is not in the Remote Management Users group, so WinRM rejects it. Authenticated SMB access, though, unlocks shares that were denied anonymously:
| |
| |
users$ holds a per-user home directory tree. Browsing it as SABatchJobs turns up an interesting file in mhope’s folder:
| |
| |
A serialized PowerShell credential object with the password left in cleartext, plausibly created by an admin exporting Azure AD sync credentials for a script and dropping the file in the wrong place. It works directly against WinRM:
| |
| |
User flag captured.
Privilege escalation · Azure AD Connect credential decryption
Post-foothold enumeration shows mhope is a member of a custom group, Azure Admins, alongside Administrator and an account named AAD_987d7f2f57d2. That naming pattern is characteristic of an Azure AD Connect sync service account. It’s tempting to assume this group grants some special right, so it’s worth testing directly rather than guessing:
- ACL abuse:
dsaclsand a domain-wide ACL sweep forAzure Adminsormhopereturn nothing. No delegated permission exists onAAD_987d7f2f57d2or anywhere else. - DCSync:
impacket-secretsdumpformhopefails outright.whoami /allalso shows nothing beyond default privileges.
Both are dead ends, confirmed rather than assumed. The actual clue is elsewhere: AAD_987d7f2f57d2’s AD description reads “Service account for the Synchronization Service … running on computer MONTEVERDE”. Azure AD Connect is installed directly on this Domain Controller, which is itself a real-world anti-pattern.
Azure AD Connect stores the credentials it uses to talk to on-prem AD in a local database (ADSync, a SQL Server LocalDB instance), encrypted with a library shipped in its own install directory. Any account that can query that database with integrated security, and load that same library, can decrypt it:
| |
| |
The “AD DS Connector account” that Azure AD Connect uses to sync the on-prem directory turns out to be the domain’s actual Administrator account, with its password recoverable by anyone who can reach this local database. Pass it straight to WinRM:
| |
| |
Root flag captured. Full domain compromise.
Lessons learned
Monteverde is a good reminder that “Azure AD Connect” and “hybrid identity” bring their own attack surface, distinct from classic on-prem AD misconfigurations:
- Never install Azure AD Connect on a Domain Controller. It should run on a dedicated, hardened server; anyone who can reach its local database with the right access can potentially recover the connector account’s password.
- Never grant the AD DS Connector account Domain Admin rights. Azure AD Connect only needs enough delegated permissions for directory synchronization and password hash sync, not full domain control.
- A tempting-looking group name is not evidence of a privilege. “Azure Admins” containing the sync account and
Administratorinvites ACL or DCSync theories; both were tested and both were dead ends. Verify rights directly instead of assuming from naming. - PSCredential XML exports are not a safe way to store secrets.
Export-Clixml-style credential files are only as protected as the file’s own permissions; one left on a shared home directory is a plaintext-adjacent leak. - A weak password policy amplifies every other issue. No lockout threshold and no complexity requirement is what made a simple username-as-password spray viable in the first place.
Flags are partially redacted, per convention.
I also wrote this engagement up as a formal penetration test report, the same format I would deliver to a client, with an executive summary, CVSS-scored findings, and remediation guidance.