25.Attacking Domain Trusts - Child - Parent Trusts - from Windows
I. SID History Primer
Purpose:
Used in Active Directory migrations to retain access to resources from the original domain after a user is migrated.
Mechanism:
The original user's Security Identifier (SID) is stored in the
sidHistory
attribute of the new account in the target domain.
Abuse Potential:
Attackers can inject privileged SIDs into the
sidHistory
attribute of a compromised account.This allows privilege escalation by impersonating high-privilege users or groups.
II. ExtraSIDs Attack - Mimikatz
Concept:
Exploits the absence of SID filtering within an Active Directory forest to escalate privileges.
Injects the SID of the Enterprise Admins group into a user's
sidHistory
attribute.Grants the attacker Enterprise Admin privileges within the parent domain.
Requirements:
KRBTGT hash of the child domain.
SID of the child domain.
Name of a target user in the child domain (can be nonexistent).
FQDN of the child domain.
SID of the Enterprise Admins group in the parent domain.
Attack Steps:
Obtain KRBTGT hash:
Retrieve Child Domain SID:
Retrieve Enterprise Admins SID:
OR
Execute ExtraSIDs Attack using Mimikatz:
Verify the Ticket:
Access Parent Domain Resources:
III. ExtraSIDs Attack - Rubeus
Concept:
An alternative method for executing the ExtraSIDs attack.
Attack Steps:
Gather Required Data (Same as Mimikatz).
Perform ExtraSIDs Attack using Rubeus:
Verify Ticket in Memory:
Perform DCSync Attack or Other Privileged Actions:
IV. Security Considerations & Defense Strategies
Enable SID Filtering:
Prevents SID injection across trusts.
Command:
Monitor for Unauthorized SID History Modifications:
Track changes in event logs (
Event ID 4765
&4766
).
Restrict Privileged Group Membership:
Minimize Enterprise Admins and Domain Admins group membership.
Implement Tiered Administration Model:
Reduce exposure of high-privilege accounts to compromise.
Regularly Audit Trust Relationships:
Identify and remediate unnecessary or insecure trusts.
By understanding and securing against SID History and ExtraSIDs abuse, organizations can reduce the risk of privilege escalation and domain compromise.
Last updated