Domain 6Active Directory AttacksCORE

AD Architecture

AD naming hierarchy (domains, trees, forests), sites and subnets, domain controllers and FSMO roles, Global Catalog, and their attack relevance for OSCP examinations.

Domain: Domain 6: Active Directory Exploitationβ€’Updated: 2026-09-01
#active-directory#architecture#domains#forests#domain-controllers#oscp

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

  1. A forest is the top-level security boundary. Everything inside a forest trusts everything else.
  2. 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.
  3. Transitive trusts flow automatically within a forest. If A trusts B and B trusts C, then A trusts C β€” no configuration needed.
  4. Cross-forest trusts must be explicitly created. They require Enterprise Admins from BOTH forests.
  5. Domain Admins have full control over their domain but NOT other domains in the forest.
  6. 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

  • Forest = top-level security boundary; Domain = security boundary with own NTDS.dit
  • Transitive trusts flow automatically within a forest
  • Cross-forest trusts must be explicitly created by Enterprise Admins
  • Domain Admins control their domain; Enterprise Admins control the forest
  • 5 FSMO roles: Schema Master (1 forest), Domain Naming Master (1 forest), PDC Emulator (1/domain), RID Master (1/domain), Infrastructure Master (1/domain)
  • PDC Emulator is the most attack-relevant FSMO role
  • RODCs are read-only and cannot be used for DCSync
  • Global Catalog has partial replica of ALL forest objects + full replica of local domain
  • GC ports: 3268 (LDAP), 3269 (LDAPS)
  • GC contains SPNs forest-wide β€” use for Kerberoasting across domains
  • GC does NOT contain password hashes

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=*)"