Forests, Trees, and Domains: Who Trusts Whom and Why?
Concept
Section titled βConceptβInside an Active Directory forest, trusts are not manually provisioned one by one: they are automatically established, two-way, and transitive upon the addition of any child domain or new domain tree:
- Parent-Child Trust: Automatically provisioned between a parent domain and its immediate child domain.
- Tree-Root Trust: Automatically established between the forest root domain and the root domain of a new domain tree within the same forest.
- Automatic Transitivity: If Domain A trusts Domain B, and Domain B trusts Domain C, Domain A implicitly and transitively trusts Domain C.
Why It Matters in DFIR
Section titled βWhy It Matters in DFIRβTrust architectures determine how threat actors pivot between enterprise domains:
- Implicit Lateral Movement Paths: Attackers do not need to establish new trusts. Once a foothold is secured in an auxiliary domain, network RPC services (SMB 445, Kerberos 88, LDAP 389) allow querying and traversing DCs across domains.
- Directional Trust Confusion: Investigators frequently invert trust directions during triage. If
Finance.corptrustsPlant.corp, users inPlant.corpcan authenticate toFinance.corpassets, NOT the reverse! - Universal Privileged Groups: The
Enterprise Adminsgroup physically exists only in the forest root domain, but it is automatically added by default to the localAdministrators(RID 544) group of every domain across the entire forest.
How It Works
Section titled βHow It WorksβIntra-Forest Trust Flow Topology
Section titled βIntra-Forest Trust Flow Topologyβ ββββββββββββββββββββββββββββββ β Forest Root Domain β β corp.local β β (Contains Enterprise Adm) β βββββββββββββββ¬βββββββββββββββ β β² β Two-way β² β Authentication Flow β Transitive β Authentication Flow β βΌ β ββββββββ΄βββββββββββββββ ββββββββββββββββ΄βββββββ β Child Domain β β Child Domain β β emea.corp.local ββββββββββββββββββββΊβ apac.corp.local β βββββββββββββββββββββββ Transitivity βββββββββββββββββββββββ Implicit- Intra-Forest Transitivity: A user in
apac.corp.localaccessing a file share inemea.corp.localrequires no direct point-to-point trust: the APAC DC issues a referral to the root DC, which issues a referral to the EMEA DC. - Inter-Domain Trust Accounts: Each trust is represented in
ntds.ditby an internal machine account ending with$(e.g.,EMEA$on the root DC, andCORP$on the EMEA DC). Its password is synchronized between DCs of both domains and rotated automatically every 30 days.
What Is Possible
Section titled βWhat Is Possibleβ- Full Forest Traversal via Inter-Realm Kerberos Tickets: Legitimate users and adversaries can request cross-domain TGS tickets for any resource across the forest.
- Forest-Wide Domination via Enterprise Admins: Enterprise Admins possess administrative authority over all domain controllers and member servers across all domains in the forest.
- Unrestricted SID Injection Intra-Forest: By default, intra-forest trusts do not filter forest-internal SIDs present in the
sIDHistoryattribute.
What Is Not Possible
Section titled βWhat Is Not Possibleβ- Disabling Transitivity Within a Forest: You cannot selectively disable transitivity between domains of the same forest without breaking forest integrity.
- Creating an Enterprise Admins Group in a Child Domain: This group only exists in the root domain (
S-1-5-21-ROOT-519). Child domains only possessDomain Admins. - Automatic Resource Access Without DACLs: Trusts enable authentication. Access to specific shares or files still requires DACL permissions or group nesting.
Common DFIR Confusions
Section titled βCommon DFIR Confusionsβ| Frequent Confusion | Verifiable Forensic Reality |
|---|---|
| βDomain A trusts Domain B, therefore Domain A controls Domain B.β | Classic inversion: Domain A trusting Domain B means Domain B users can access Domain A resources. |
| βParent domain accounts can read all data in child domains by default.β | Only groups explicitly nested (like Enterprise Admins) have rights. Standard parent users have zero access without DACL entries. |
| βExternal trusts behave just like forest trusts.β | External trusts are non-transitive by default and strictly enforce SID Filtering. |
Concrete Forensic Example
Section titled βConcrete Forensic ExampleβAn adversary compromises a deployment server in a development child domain (dev.corp.local):
- Target goal: sensitive source code in
prod.corp.local. - The attacker uses BloodHound to map authentication paths:
dev.corp.local$ ightarrow$corp.local(root) $ ightarrow$prod.corp.local. - They discover that a development security group (
DEV-Ops) was nested into the local Administrators group of a build server inprod.corp.local. - The attacker impersonates a member of
DEV-Opsand traverses from DEV to PROD using Kerberos referrals without needing root Domain Admin credentials.
Key Forensic Artefacts
Section titled βKey Forensic Artefactsβ- Trusted Domain Objects (TDO):
- Objects of class
trustedDomainstored inCN=System,DC=domain,DC=local. - Attributes:
trustDirection(1=Inbound, 2=Outbound, 3=Bidirectional),trustType(2=Upx / Active Directory),trustAttributes(TRUST_ATTRIBUTE_WITHIN_FOREST= 0x20).
- Objects of class
- Security Event Logs (Source & Target DCs):
- Event ID 4769: TGS requests for the inter-domain trust account (e.g.,
krbtgt/CORP.LOCAL). - Event ID 4624 (Logon Type 3): On target servers, displaying the source domain in
TargetDomainName.
- Event ID 4769: TGS requests for the inter-domain trust account (e.g.,
Investigation Methods
Section titled βInvestigation Methodsβ- List All Trust Relationships for the Subject Domain:
Execute
nltest /domain_trusts /vor PowerShellGet-ADTrust -Filter *. - Identify Inter-Domain Trust Accounts:
Inspect inter-domain trust computer accounts (
Get-ADComputer -Filter 'OperatingSystem -like "*Trust*"'). - Audit Cross-Domain Group Nesting: Identify global groups from external or child domains added to local Domain Local groups.
Investigative Tooling
Section titled βInvestigative Toolingβ- Nltest & Netdom:
Terminal window nltest /domain_trusts /vnetdom trust <LocalDomain> /Domain:<RemoteDomain> /verify - PowerShell AD Module:
Terminal window Get-ADTrust -Filter * | Select-Object Name, Direction, TrustType, IntraForest, SIDFilteringForestAware
Key Takeaways
Section titled βKey Takeawaysβ- Trust direction is the opposite of access direction: Resource domain $ ightarrow$ trusts $ ightarrow$ Account domain.
- Intra-forest trusts are two-way and transitive by default.
- Trusts provide authentication pathways; authorization is determined by local DACLs and group memberships.