GoldenGMSA Attack
Last updated
Last updated
If we discover a gMSA account in a parent domain we can compromise it from the child domain with the tool and obtain its password.
For the attack to work we need the following rights:
Membership in the Enterprise Admins
group in forest root domain
Membership in the Domain Admins
group in forest root domain
Access to a domain controller as NT/AUTHORITY SYSTEM
These will be used to read a list of attributes from the msKds-ProvRootKey
objects in CN=Master Root Keys,CN=Group Key Distribution Service,CN=Services,CN=Configuration,DC=domain,DC=com
of the parent domain.
cn
msKds-SecretAgreementParam
msKds-RootKeyData
msKds-KDFParam
msKds-KDFAlgorithmID
msKds-CreateTime
msKds-UseStartTime
msKds-Version
msKds-DomainID
msKds-PrivateKeyLength
msKds-PublicKeyLength
msKds-SecretAgreementAlgorithmID
Fortunately the GoldenGMSA tool makes the process totally automatic and will fetch the needed attributes if ran in the appropriate context.
The online attack queries the parent domain to obtain the gMSA's SID and uses it to calculate the password by querying both domains.
From a SYSTEM
shell we'll execute the tool
Once the SID is found we can use it to compute the gMSA account's password
The offline attack fetches the SID and msds-ManagedPasswordID
from the parent domain, the kdsinfo
from the child domain and uses calculates the password for the gMSA account by manually supplying the KDS Key
and account SID.
Now we should have a base64-encoded password, to convert it to a RC4 / NTLM hash we can use the following script
With the hash we're able to request a TGT as the gMSA account