Main concepts:
- Tenant
- The “space” which an organization “rents”. Has a name.
- Users
- Groups
- Applications
- Identity model
- Cloud only
- Accounts are only in foreign systems (“cloud”)
- Synchronized
- Accounts are created and managed on-premise and synchronized to foreign systems (“cloud”)
- Federated
- Accounts are created, managed and authentificated on-premise; foreign systems (“cloud”) are also checking againts a on-premise system.
- Cloud only
Tools
Non-authenticated
- Determine O365 users with o365enum.py.
Authenticated
- Determine users and more with O365Recon.
- ROADlib and ROADrecon — ROADtools for Azure enumeration and exploitation.
- PowerZure is a (post-) exploitation framework
Azure AD Connect
Azure AD Connect integrated on-premise directories with foreign servers (“cloud”).
Authentication methods
- PHS Password Hash Synchronization: Password hashes from the on-premise system are synchronized to the foreign system (“cloud”).
- PTA Pass-through Authentication: Password hashes are only on the on-premise system.
- User tries to access service
- Service redirects User to Azure AD
- User enters credentials in Azure AD
- Azure AD asks on-premise PTA agents.
- PTA agents asks on-premise AD host.
- If on-premise AD hosts says “ok”, then Azure AD redirects the user to the original service.
- ADFS Federation Integration: Password hashes are managed on-premise.
- Like Kerberos
- Multiple systems are connected (“federated”) to trust each other.
- Users can get authentication from on-premise servers, services trust these claims and only perform authorization.
SSO Seamless Single Sign-On is an additional method, which can be combined with PHS or PTA for an additional (Kerberos-style) authentication from an on-premise source. In this case, Azure AD returns a Challenge for a Kerberos ticket, which the client needs to get from a local AD and sends the response back so that Azure AD grants access to the initial service.
Attacking PHS
With the PowerShell AD Module, get details about accounts:
Get-ADUser -filter 'name -like "Msol*"' -Properties Description
- Hook auth APIs http://easyhook.github.io/
- Inject this https://github.com/fdiskyou/injectAllTheThings
This can add
- a skeleton Key
- and log all users and passwords it see.
Notes
- The role Global Administrator is the equivalent to the domain admin.
- Check if an organization uses Azure:
- For each tenant, a domain is created: $tenant.onmicrosoft.com.
- By checking the DNS, an attacker can guess if an organization has an account there.
- Checking the following url with a garbage mailbox name and a domain from the target organization:
- https://login.microsoftonline.com/getuserrealm.srf?login=blabla@$DOMAINNAME&xml=1
- For each tenant, a domain is created: $tenant.onmicrosoft.com.
Leave a Reply
You must be logged in to post a comment.