Azure Account Hijacking using mimikatz’s lsadump::setntlm
An attacker with domain admin privileges could temporarily change a user's password using Mimikatz's lsadump::setntlm, wait for the change to sync to Azure AD, access the user's cloud resources, and then restore the original password hash to avoid detection. This allowed access to sensitive customer data stored in Office 365 services like OneDrive and SharePoint.
trustedsec.com
Published on trustedsec.com
Not long ago, I was on an engagement where the client made use of a hybrid Office 365 environment. In their setup, authentication credentials were managed by the on-premises Active Directory (AD) Domain Controller and then synced to Azure AD via Azure AD Connect.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the design of hybrid identity sync, where password changes made on-premises are replicated to Azure AD, allowing an attacker with sufficient on-premises privileges to impersonate a user in the cloud without knowing their original password.
Impact
An attacker with domain admin access could gain unauthorised access to a user's Azure/Microsoft Online resources, potentially exposing sensitive customer data, though the attack may be limited by conditional access policies such as MFA and trusted network restrictions.
What the attacker needed
Domain Admin access or Replicating Directory Changes…; Hybrid Office 365 environment with Azure AD Connect; Ability to run Mimikatz on a domain-joined system
How it was found
- Extract the user's current NTLM hash using dcsync.
- Set the user's password to a known value using lsadump::setntlm.
- Wait 30 minutes for the change to replicate to Azure AD.
- Access the desired Azure/Microsoft Online resource.
- Set the user's NTLM hash back to the original hash.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
In a hybrid setup, on-premises Active Directory (AD) and Azure AD share user credentials. If an attacker gains high-level access to the on-premises AD, they can temporarily change a user's password, wait for the change to sync to the cloud, log in as that user to access cloud data, and then quietly restore the original password so the user never notices. This works because the cloud trusts the on-premises password change.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.