Obtaining Domain Admin from Azure AD by abusing Cloud Kerberos Trust
A Global Admin in Azure AD can abuse the Cloud Kerberos Trust to modify a hybrid user's on-premises SAM name and SID via the synchronization API, then obtain a Kerberos ticket for a privileged on-premises account such as the AD Connect sync account, leading to Domain Admin.
Published on dirkjanm.io
Many modern enterprises operate in a hybrid environment, where Active Directory is used together with Azure Active Directory. In most cases, identities will be synchronized from the on-premises Active Directory to Azure AD, and the on-premises AD remains authoritative.
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 Cloud Kerberos Trust design allows Azure AD Global Admins to modify synced user attributes (SAM name and SID) via the synchronization API, and Azure AD then issues Kerberos tickets based on those modified attributes without verifying they match the real on-premises account.
Impact
An attacker with Global Admin in Azure AD could escalate to Domain Admin in the on-premises Active Directory, but this requires network connectivity to a Domain Controller and the Cloud Kerberos Trust feature to be set up.
What the attacker needed
Global Admin in Azure AD; Network access to a Domain Controller; Cloud Kerberos Trust enabled; A hybrid account to modify
The fix
The report suggests denying highly privileged accounts from the RODC password replication policy and ensuring privileged users are not synced to Azure AD, but does not state that a fix was applied.
How it was found
- Obtain an access token for a Global Admin account.
- Use the synchronization API to modify a hybrid user's on-premises SAM name and SID to match a privileged on-premises account.
- Request a Primary Refresh Token (PRT) for the modified hybrid user, which includes a partial Kerberos TGT.
- Exchange the partial TGT for a full TGT and recover the NT hash of the targeted account.
- Use the full TGT or NT hash to perform a DCSync attack and obtain the krbtgt hash, achieving Domain Admin.
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, Azure AD and on-premises Active Directory trust each other. This report shows that someone with the highest admin rights in Azure AD can trick that trust to get the highest admin rights on the on-premises side too, by changing a user's identity details so Azure AD issues a ticket for a powerful account.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.