What Is Golden SAML Theft
ADFS Configuration (AADINTERNALS)
Attacker steals the ADFS certificate and private key to forge SAML tokens. Allows for persistence for password reset and impersonation of any user.
ADFS is a SSO tool that links a user's identity across on-prem, cloud, web apps, etc. ADFS preforms claims based authentication and provides a SAML token that contains a user's access rights whenever required.
Why Golden SAML?
Persistent through password resets
Impersonate any user in domain without their password
ADFS certificates are valid for one year (organizations often change this to 10 years).
Difficult to detect and certain auditing must be be enabled for any visual.
Attack flow:
Compromise ADFS service account (default name: aadcsvc$) OR Domain Administrator.
Obtain Object GUID of user you want to impersonate
Access specified resource (m365, web app, etc)
Find out what user is the ADFS service account by looking at "Log On As" in services or enumerate accounts to find it.
Recon for ADFS Object
Select the second one "CN=ADFS, CN=Microsoft, CN=Program Data, etc"
Export DKM Commands:
Export ADFS Configuration:
Export Token Signing Certificate:
Forge SAML Token:
HTTP Request (Netwrix)
Mandiant ADFSDUMP
What logs are available?
Enable ADFS logging and set it to verbose
Enable logs for "Audit Service Ticket Operations"
Enable "Audit Applications Generated"
Enable AFDS trace logging
Enable ADFS Logging:
AD FS Audit Level Event IDs:
The table below describes the events that are generated when the audit level is set to Basic:
The table below shows some of the additional events that are generated when the audit level is set to Verbose:
Type 3 and 4662:
DCSync with MSOL or ADFS account will be present if the DKIM is accessed. Does not prove that it was exported but will be present.
SACL to Detect DKM Export:
Normal SAML Creation:
ADFS will generate the following 3 events in security.evtx file if logging is enabled. Because Golden SAML is done offline, these will not be present for the user who forged the SAML ticket. These are not enabled by default.
Compare legitimate logins vs lack of ADFS login
Without Event Logs/EDR:
Credential Dumping/ Pass the hash of ADFS account
If this is ever suspected, burn it down with fire. If ADFS server was ever accessed, maintain abundance of caution and issue new certificate.
Treat ADFS as tier 0 device
Issue new ADFS certificate if Golden SAML is suspected
Ensure all auditing logging is enabled and audit logging is set to detect access to DKM
Revoke all refresh tokens
Revoke Refresh Tokens: