AD Architecture
Domains, Trees, Forests
These three concepts form the AD naming hierarchy and define the security boundaries of your environment. Understanding this hierarchy is critical because trusts flow automatically within these structures, creating attack paths you can exploit.
The Hierarchy
π² FOREST (Top-level security boundary)
β
βββ π³ TREE 1 (Shared DNS namespace: contoso.com)
β β
β βββ Domain: contoso.com β Root Domain
β β βββ User: admin
β β βββ Computer: DC01$
β β βββ Group: Domain Admins
β β
β βββ Domain: uk.contoso.com β Child Domain
β β βββ User: uk_user
β β βββ Computer: UK-DC01$
β β
β βββ Domain: us.contoso.com β Child Domain
β βββ User: us_user
β βββ Computer: US-DC01$
β
βββ π³ TREE 2 (Separate DNS namespace: fabrikam.com)
β
βββ Domain: fabrikam.com
βββ User: fab_user
βββ Computer: FAB-DC01$
Component Details
| Component |
Description |
Trust Behavior |
Security Boundary? |
| Domain |
A security boundary containing its own copy of the AD database (NTDS.dit). Each domain has its own set of users, groups, and computers. |
N/A |
YES β Each domain has separate security principals |
| Tree |
A group of domains sharing a contiguous DNS namespace. Child domains are subdomains of the parent. |
Two-way transitive auto-trusts between parent and child |
No β trusts connect all domains in the tree |
| Forest |
The top-level AD boundary. Contains one or more trees. All domains in a forest share the same schema, configuration, and global catalog. |
Two-way transitive between ALL domains in the forest |
YES β The forest is the ultimate security boundary |
Key Architectural Points
- A forest is the top-level security boundary. Everything inside a forest trusts everything else.
- Each domain has its own copy of the AD database (
NTDS.dit). Compromising one domainβs DC does not automatically give you another domainβs hashes.
- Transitive trusts flow automatically within a forest. If A trusts B and B trusts C, then A trusts C β no configuration needed.
- Cross-forest trusts must be explicitly created. They require Enterprise Admins from BOTH forests.
- Domain Admins have full control over their domain but NOT other domains in the forest.
- Enterprise Admins have full control over the entire forest (all domains).
Trust Flow Within a Forest
contoso.com ββ uk.contoso.com (Parent-Child, Two-way Transitive)
contoso.com ββ us.contoso.com (Parent-Child, Two-way Transitive)
uk.contoso.com ββ us.contoso.com (Cross-Link, Two-way Transitive)
Result: Any user in any domain can be authenticated to any other domain.
Sites and Subnets
AD Sites represent the physical network topology. They are used to optimize authentication traffic and replication.
Site Components
| Concept |
Purpose |
| Site |
Represents a well-connected IP network (typically a physical location like an office or data center). |
| Subnet |
An IP range associated with a site. Clients use subnet membership to determine which site they are in. |
| Site Link |
Defines the replication cost and schedule between sites. Lower cost = preferred replication path. |
| Site-aware Authentication |
Clients authenticate to DCs in their own site first, reducing WAN traffic. |
Why Sites Matter for Attacks
| Attack Scenario |
Site Relevance |
| RODCs (Read-Only DCs) |
Branch offices often have RODCs with cached credentials. The Password Replication Policy controls which passwords are cached. |
| Admin SD Protection Replication |
ASR (Admin SD Protection) replication has delays between sites, creating a window for ACL manipulation. |
| DCSync |
Can target any writable DC regardless of site. RODCs cannot be used for DCSync. |
| Replication Topology |
Understanding sites helps identify which DCs are writable vs. read-only, and which credentials may be cached where. |
Identifying RODCs vs Writable DCs
# Find RODCs
Get-ADComputer -Filter {isReadOnly -eq $true}
# Find all DCs
Get-ADComputer -Filter {primaryGroupID -eq 516}
# Check if a DC is a GC
Get-ADComputer DC_NAME -Properties * | Select-Object @\
@{N='IsGC';E={$_.options -band 1}}
Domain Controllers
Domain Controllers (DCs) are the servers that run Active Directory Domain Services (AD DS). They host the AD database, authenticate users, and enforce policies.
FSMO Roles
FSMO (Flexible Single Master Operations) roles are specialized responsibilities held by specific DCs. There are 5 FSMO roles total:
| Role |
Scope |
Count |
Purpose |
Attack Relevance |
| Schema Master |
Forest |
1 total |
Controls schema updates (adding new object classes/attributes) |
Rarely relevant for OSCP. Schema modifications can be used for backdoor attacks (e.g., adding malicious attributes). |
| Domain Naming Master |
Forest |
1 total |
Controls adding/removing domains from the forest |
Prevents domain name conflicts. Rarely an attack target. |
| PDC Emulator |
Domain |
1 per domain |
Handles password changes, time synchronization, and account lockouts. The authoritative source for password changes. |
High value β password changes are processed here first. Time sync attacks possible. Target for DCSync. |
| RID Master |
Domain |
1 per domain |
Allocates pools of Relative Identifiers (RIDs) to DCs for creating new objects |
RID exhaustion attacks possible. Rarely targeted directly. |
| Infrastructure Master |
Domain |
1 per domain |
Updates cross-domain object references (e.g., group membership with users from other domains) |
In single-domain forests, should be on the same DC as PDC. Misconfiguration can cause replication issues. |
FSMO Role Identification
# Using PowerShell
Get-ADDomain | Select-Object PDCEmulator, RIDMaster, InfrastructureMaster
Get-ADForest | Select-Object SchemaMaster, DomainNamingMaster
# Using netdom
netdom query fsmo
# Using ldapsearch
ldapsearch -x -H ldap://DC_IP -b "CN=Partitions,CN=Configuration,DC=domain,DC=com" \
"(fSMORoleOwner=*)" fSMORoleOwner
DC Attack Relevance
| Attack |
DC Target |
Requirements |
| DCSync |
Any writable DC |
Replication privileges (DA, EA, or delegated) |
| Golden Ticket |
Any DC (to extract KRBTGT) |
KRBTGT NT hash (obtained via DCSync or NTDS.dit dump) |
| NTDS.dit Extraction |
Local DC access |
Local admin on the DC |
| RODC Credential Caching |
RODC specifically |
Password Replication Policy allows caching of target account |
| FSMO Role Seizure |
FSMO holder |
DA privileges, used for persistence/disruption |
Global Catalog
The **Global Catalog (GC) is a special type of Domain Controller that maintains a partial replica of every object in the entire forest. It is the βsearch engineβ of Active Directory.
How the Global Catalog Works
| Replica Type |
Scope |
Content |
| Full Replica |
Objects in the GCβs own domain |
ALL attributes for ALL objects in the local domain |
| Partial Replica |
Objects in ALL other domains in the forest |
Only the Partial Attribute Set (PAS) β a subset of ~150 commonly queried attributes |
Partial Attribute Set (PAS)
The GC stores only frequently-used attributes for objects in other domains. Key attributes include:
| Attribute |
Why Itβs in PAS |
Attack Relevance |
sAMAccountName |
Needed for logon |
Identify users across the forest |
displayName |
Needed for address lookups |
Information gathering |
mail |
Needed for email routing |
Information gathering |
userPrincipalName |
Needed for UPN logon |
Kerberos TGT requests |
servicePrincipalName |
Needed for service location |
Kerberoasting targets across the entire forest |
memberOf |
Needed for group membership checks |
Attack path discovery |
distinguishedName |
Needed for object identification |
Navigation |
Global Catalog Ports
| Port |
Protocol |
Description |
| 3268 |
LDAP (unencrypted) |
GC queries without TLS |
| 3269 |
LDAPS (TLS encrypted) |
GC with TLS encryption |
Identifying Global Catalog Servers
# PowerShell
Get-ADDomainController -Filter {GlobalCatalogTitle -eq $true}
# ldapsearch
ldapsearch -x -H ldap://DC_IP -b "CN=Sites,CN=Configuration,DC=domain,DC=com" \
"(objectClass=nTDSDSA)" dnsHostName options
# The 'options' attribute value 1 indicates the DC is a GC
GC Attack Relevance
| Aspect |
Detail |
| Forest-wide visibility |
Querying the GC gives you visibility into ALL domains in the forest, even if you only have credentials in one domain. |
| SPN enumeration |
The GC contains servicePrincipalName attributes for ALL objects in the forest β making it ideal for forest-wide Kerberoasting. |
| No password hashes |
The GC does NOT store password hashes (they are not in the PAS). This makes it safe to query without triggering additional authentication. |
| Multi-domain enumeration |
In OSCP labs with multiple domains, the GC is your best tool for discovering objects across domain boundaries. |
| Identification |
The msDS-IsGC attribute (or DC options flag) identifies GC servers. |
OSCP Exam Checklist: AD Architecture
Must-Know Concepts
Must-Remember Commands
# Find all DCs
Get-ADDomainController -Filter *
# Find GC servers
Get-ADDomainController -Filter {GlobalCatalogTitle -eq $true}
# Find RODCs
Get-ADComputer -Filter {isReadOnly -eq $true}
# Query FSMO roles
netdom query fsmo
# Query forest-wide via GC
ldapsearch -x -H ldap://DC_IP:3268 -D "user@domain.com" -w password \
-b "DC=domain,DC=com" "(objectClass=*)"