Domain Trust Abuse
Trust Types
Parent-child: Two-way transitive trust between parent and child domains in the same forest
Cross-link: Trust between child domains to speed up authentication
External: Non-transitive trust between separate domains in separate forests (uses SID filtering)
Tree-root: Two-way transitive trust between forest root and a new tree root domain
Forest: Transitive trust between two forest root domains
Trust Direction
One-way: Users in the trusted domain can access resources in the trusting domain, not vice-versa
Bidirectional: Users from both domains can access resources in the other domain
Transitive: Trust extends to objects that the child domain trusts (A trusts B, B trusts C, so A trusts C)
Non-transitive: Only the child domain itself is trusted
Enumerating Trusts
PowerShell AD Module
Import-Module activedirectory
Get-ADTrust -Filter *PowerView
netdom
BloodHound
Use pre-built query: "Map Domain Trusts"
Enumerate users in child domain
Child -> Parent Trust Abuse (ExtraSids Attack)
Overview
Within the same AD forest, the sidHistory property is respected (no SID Filtering)
We can create a Golden Ticket from the compromised child domain to compromise the parent
Set sidHistory to Enterprise Admins group SID for full forest access
Prerequisites
KRBTGT hash for the child domain
SID for the child domain
Name of a target user (does NOT need to exist)
FQDN of the child domain
SID of the Enterprise Admins group of the root domain
Gathering Info
Get KRBTGT hash (Mimikatz)
Get child domain SID (PowerView)
Get Enterprise Admins SID
From Windows
Mimikatz Golden Ticket
Rubeus Golden Ticket
Verify with klist
DCSync the parent domain
Full Windows chain (Rubeus + Mimikatz)
From Linux
DCSync child domain for KRBTGT hash
SID brute forcing with lookupsid.py
Construct Golden Ticket with ticketer.py
Use the ticket
Alternative: raiseChild.py (automated)
Automates the entire child->parent escalation
Obtains KRBTGT hash, creates Golden Ticket, DCSync parent domain, returns SYSTEM shell
Cross-Forest Trust Abuse
Kerberoasting Across Forest Trust
From Linux
Admin Password Reuse
Check if admin hashes/passwords work across trust boundaries
Foreign Group Membership
BloodHound: Check for users from one domain that are members of groups in another domain
Query: "Find users that belong to groups in another domain"
SID Filtering
SID Filtering sanitizes the SID History attribute for cross-forest trusts
External trusts and cross-forest trusts apply SID Filtering by default
Intra-forest trusts (parent-child) do NOT apply SID Filtering
This is why the ExtraSids attack works within a forest but NOT across forests
Last updated