Practice library / Active Directory and Windows attacks
Lab · Hard · 3 hoursFree account
Active Directory Trust Attacks
Map trusts, escalate child-to-parent with a SID-history golden ticket, and test the SID-filtering boundary between forests.
On this page 15 sections
- ·Overview
- ·Prerequisites
- ·Lab setup
- ·Build the target
- 1Enumerate the trusts
- 2Confirm the forest layout
- Locked: Find foreign security principals
- Locked: Collect the keys for the forged ticket
- Locked: Escalate child to parent with SID history
- Locked: Automate the same chain
- Locked: Hit the SID-filtering wall across the forest trust
- Locked: Record the trusts and their controls
- Locked: Check
- Locked: Clean-up
- Locked: Command reference
A trust lets one Active Directory domain accept logons from another, and a forest is one or more domains that trust each other by default. The forest is the real security boundary, not the domain, and a child-domain compromise usually reaches the forest root within one Kerberos ticket. The exercises here enumerate trusts, forge a SID-history golden ticket from a child domain to Enterprise Admin, and watch SID filtering stop the same trick across a forest trust.
Lab Objectives
- Enumerate every domain and forest trust and read its direction and transitivity
- Find foreign security principals that reach across a trust boundary
- Escalate from Domain Admin in a child domain to Enterprise Admin in the forest root with a SID-history golden ticket
- Automate the same child-to-parent escalation with Impacket
raiseChild - Explain why SID filtering stops the same trick across a forest trust
- Map each step to the Windows events and trust controls a defender uses
Overview
Trusts let one domain accept logons and tickets from another. A forest is one or more domains that trust each other automatically, with a shared schema and a shared configuration. The forest, not the domain, is the real security boundary. This lab proves that claim. You start as Domain Admin in a child domain. You finish as Enterprise Admin over the whole forest, using one trust and one forged Kerberos ticket. Then you try the same attack across a forest trust and watch SID filtering block it.
A trust has a direction and a transitivity. Direction decides which side can authenticate to the other. Transitivity decides whether the trust chains onward to further domains. Intra-forest parent-child trusts are two-way and transitive, and they do not filter privileged SIDs. That one fact is the whole of Step 5.
Prerequisites
- Finish Kerberos Attacks first. This lab assumes you already know a TGT, a TGS, the KRBTGT account and how a golden ticket is forged. Here you add one field to that forged ticket and cross a domain boundary with it.
- Active Directory Basics defines a Domain Controller, a domain SID and a RID. This lab uses all three.
- Active Directory Enumeration & Attacks is the theory workbook for this topic. Read its trust chapter if the words "transitive" and "SID filtering" are new.
- AD Enumeration with BloodHound draws trust edges for you. This lab enumerates the same trusts by hand so you know what those edges mean.
- DACL Attacks in Active Directory and Active Directory LDAP Enumeration cover the foreign-principal ACL abuse that Step 7 relies on.
Lab setup
| Item | Purpose |
|---|---|
Impacket (secretsdump.py, ticketer.py, lookupsid.py, raiseChild.py, GetUserSPNs.py) | Dumps secrets, forges the cross-domain ticket, enumerates SIDs, and automates the chain |
ldapsearch (from ldap-utils) | Reads trustedDomain objects over LDAP from your Kali box |
PowerView (powerview.ps1) | Enumerates trusts and foreign members from a Windows foothold, as an alternative to the Linux path |
| A Kali attack box | Runs every Linux command below |
Build the target
KaliRange hosts no targets, no virtual machines and no lab files. You run this lab on your own machine, against a forest that you build. The names and 10.0.x.x addresses below are the example addresses of this lab. Replace them with the addresses of your own forest.
Your lab forest must have these parts:
| Host | Role |
|---|---|
DC01 (10.0.0.10) | Domain Controller of the forest root domain CORP.LOCAL |
DC02 (10.0.1.10) | Domain Controller of the child domain DEV.CORP.LOCAL, under CORP.LOCAL |
DC03 (10.0.2.10) | Domain Controller of a second, separate forest PARTNER.LOCAL |
| Your Kali machine | The attack box, with network access to all three |
- The parent-child trust between
DEV.CORP.LOCALandCORP.LOCAL, created with the child domain (two-way, transitive, in the same forest, SID filtering off). - A forest trust between
CORP.LOCALandPARTNER.LOCAL, with SID filtering on (the default). In Step 1, thetrustedDomainobject ofpartner.localonDC01showstrustDirection: 1,trustType: 2andtrustAttributes: 8. Apartner.localaccount must be able to request service tickets forcorp.localservice names (Step 7). - The foothold account
dev-admin@DEV.CORP.LOCALwith the passwordPassword123!: a Domain Admin in the child domain only. It stands in for a child-domain compromise that is already finished. Use your own password and put it in the commands. - A
dev.corp.localaccount that is a member of the groupBackup Operatorsincorp.local(the foreign member of Step 3). - In
partner.local, a plain usersvc-readerwith the passwordSummer2026!(Step 7). Use your own password. - In
corp.local, a service accountsvc_sqlin the groupService Accounts, with the Service Principal NameMSSQLSvc/sql01:1433and a weak password that your wordlist cracks (Step 7).
Build such a forest from free, legal parts. Install evaluation copies of Windows Server from the Microsoft Evaluation Center (180 days) in virtual machines on your own computer and build the three domain controllers. Or start from GOAD ("Game of Active Directory"), a deliberately vulnerable Active Directory lab that Orange Cyberdefense publishes on GitHub, which has more than one domain and forest. Isolate it from the internet. Its names differ from CORP.LOCAL, so change the names in the commands. Take a snapshot of each virtual machine before Step 1. Your goal in the lab is Enterprise Admin over CORP.LOCAL.
Authorized-lab only. Run every command in this lab against 10.0.0.10, 10.0.1.10 and 10.0.2.10, only against a forest that you own or have written permission to test, inside your isolated lab forest, and nowhere else. Forging Kerberos tickets or crossing a trust against a domain you do not own is unauthorized access and computer-fraud in most countries. These techniques apply to real domains; a real engagement needs written scope that names the forest and every trust in it.
Step 1: Enumerate the trusts
List every trust the child domain holds
Read the trustedDomain objects from DC02 over LDAP. Each object is one trust the child domain knows about. Record the partner name, the direction and the attributes for every trust it returns.
ldapsearch -x -H ldap://10.0.1.10 \
-D 'dev-admin@dev.corp.local' -w 'Password123!' \
-b 'CN=System,DC=dev,DC=corp,DC=local' '(objectClass=trustedDomain)' \
trustPartner trustDirection trustType trustAttributesExample output:
dn: CN=corp.local,CN=System,DC=dev,DC=corp,DC=local
trustPartner: corp.local
trustDirection: 3
trustType: 2
trustAttributes: 32The child domain holds one trustedDomain object: the parent trust to corp.local. The forest trust to partner.local is created at the forest root, so its trustedDomain object lives in the root domain's System container, not the child's. Read it against the root Domain Controller, DC01:
ldapsearch -x -H ldap://10.0.0.10 \
-D 'dev-admin@dev.corp.local' -w 'Password123!' \
-b 'CN=System,DC=corp,DC=local' '(objectClass=trustedDomain)' \
trustPartner trustDirection trustType trustAttributesExample output:
dn: CN=partner.local,CN=System,DC=corp,DC=local
trustPartner: partner.local
trustDirection: 1
trustType: 2
trustAttributes: 8From a Windows foothold, PowerView reads the same data and maps the whole forest in one call:
Get-DomainTrust
Get-DomainTrustMappingtrustDirection: 3 is bidirectional; 1 is inbound only. trustAttributes: 32 (WITHIN_FOREST), on the object in the child's own System container, marks the corp.local trust as an intra-forest parent-child trust, the kind that does not filter SIDs. trustAttributes: 8 (FOREST_TRANSITIVE), on the object in the root domain's System container, marks partner.local as a separate forest. Those two numbers decide which attack works later: the parent is the target of Step 5, the forest trust is the wall in Step 7.
What a defender would see. Reading trustedDomain objects is LDAP traffic to DC02 and DC01, logged as Event ID 4662 (object access) when object-access auditing covers the System container. One account reading the full trust map in a single query, from a host that never did so before, is the pattern to watch.
Step 2: Confirm the forest layout
Verify the trust directions from the Domain Controller's own view
Cross-check the LDAP result against the Domain Controller's own trust list. This confirms you read the directions the right way round before you build an attack on them.
nltest /domain_trusts /all_trusts /vExample output:
List of domain trusts:
0: DEV dev.corp.local (NT 5) (Forest Tree Root) (Direct Member of forest ...)
1: CORP corp.local (NT 5) (Forest Tree Root) (Primary Domain) (Native)
2: PARTNER partner.local (NT 5) (Forest: 2) (Direct Outbound) (Direct Inbound)
The command completed successfullyThree facts matter here. corp.local is the forest root and the parent of your child domain. partner.local is a second forest reached through a trust. The parent-child link to corp.local is inside your forest, so SID filtering does not apply to it. Write these three facts down; the rest of the lab is built on them.
What a defender would see. nltest runs locally on a host and reads cached trust data, so it produces little network noise. Its value to a defender is as an EDR process-creation signal: nltest.exe with /domain_trusts from a non-administrator session is a common early discovery step in trust-abuse tradecraft.
Sign in to continue
9 more sections are for signed-in members. It is free: sign in with Google.