Parent-Child Trust Abuse
Whenever a child domain (child.domain.com
) is added to a forest, the event automatically creates a transitive and bidirectional trust with the parent domain (domain.com
).
Other commands we can use to check the available trusts are
Get-DomainTrust
nltest /domain_trusts
([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).GetAllTrustRelationships()
In the output
Source
is the child domain, in this casechild.domain.com
Target
is the parent domain,domain.com
and as we can see the trust is BiDirectional
and the IntraForest
field is set to True
so we can safely say this is a Child/Parent trust.
The gist of the trust abuse is the following: if we have Domain Admin privileges in the child domain, we can easily get Domain Admin on the parent domain as well. This technique abuses a TGT attribute called SID History which is a legitimate attribute that was designed to handle the transition of a user from a domain to another: to make sure the moved user maintained access to the previous domain even after being moved to the second one, the user's old SID would be added to the SID History attribute of their account. More on SID History here. In the context of forest trust abuse we can create a ticket.
There are two main ways to (ab)use this kind of trust:
Golden Ticket
Diamond Ticket
Golden Ticket Method
First of all we need the SID for the Domain Admins group of both domains, this information can be obtained in a number of ways:
Powershell
Mimikatz
Impacket
Bloodhound (
DOMAIN-SID
attribute of aDOMAIN
node)
Now we need the NTLM or AES256 hash of the krbtgt
user for the child domain, we can get this with secretsdump
, donpapi
, nxc
or mimikatz
With this information we are ready to request a Golden Ticket
Rubeus
Mimikatz
Impacket following this guide
Impacket also has the raiseChild.py
script which automates the golden ticket process (from aleid.com)
This script implements a child-domain to forest privilege escalation by (ab)using the concept of Golden Tickets and ExtraSids.
This script automates the escalation process but it CAN fail from time to time.
Diamond Ticket
The requirements for the Diamond Ticket method are the similar as the golden ticket one: both domain SIDs and the AES256 hash of the krbtgt
account.
Rubeus
Impacket
OPSEC
From a OPSEC standpoint, Golden tickets can be easily detected both by monitoring for DCSync attacks (which are required to get the RC4 hash for the krbtgt
user) and TGS requests that have no matching TGT request.
Diamond tickets are more likely to go undetected as we can request a valid TGT before using the resulting TGS; moreover, since diamond tickets are created directly on the DC, some details of the ticket are more likely to be correct by default (one example is ticket creation time).
Last updated