๐Ÿ“š Learning Objectives

By the end of this lesson, you will be able to:

๐Ÿ—๏ธ Active Directory Hierarchical Structure

Forest Level

The forest is the top-level container in Active Directory. It represents the complete logical structure of the directory service and contains all objects within the organization.

๐Ÿ”‘ Key Forest Characteristics:

  • Security Boundary: Forest is the ultimate security boundary
  • Schema: Single schema applies to entire forest
  • Global Catalog: Forest-wide search and authentication
  • Trust Relationships: Can establish trusts with other forests

Domain Level

A domain is a logical grouping of network objects (users, computers, groups) that share a common directory database and security policies.

Domain Structure Example:

Forest: company.local
โ”œโ”€โ”€ Domain: company.local (Root Domain)
โ”‚   โ”œโ”€โ”€ DC: dc1.company.local
โ”‚   โ”œโ”€โ”€ DC: dc2.company.local
โ”‚   โ””โ”€โ”€ OU: Corporate
โ”‚       โ”œโ”€โ”€ Users
โ”‚       โ”œโ”€โ”€ Computers
โ”‚       โ””โ”€โ”€ Groups
โ””โ”€โ”€ Domain: branch.company.local (Child Domain)
    โ”œโ”€โ”€ DC: dc1.branch.company.local
    โ””โ”€โ”€ OU: Branch Office
        โ”œโ”€โ”€ Users
        โ””โ”€โ”€ Computers
                    

Organizational Units (OUs)

Organizational Units are containers within domains used to organize objects and apply Group Policy settings.

๐ŸŽฏ OU Best Practices:

  • Delegation: OUs enable administrative delegation
  • Group Policy: Apply policies to specific OU levels
  • Organization: Reflect business structure
  • Security: Implement least privilege access

๐Ÿ–ฅ๏ธ Domain Controller Roles and Functions

Primary Domain Controller (PDC) Emulator

Function: Manages password changes and time synchronization

๐Ÿ”’ Security Implications:

  • Target for password attacks
  • Critical for time-based attacks
  • Single point of failure

Relative ID (RID) Master

Function: Allocates unique security identifiers (SIDs)

๐Ÿ”’ Security Implications:

  • Controls SID generation
  • Potential for SID enumeration
  • Affects object creation

Infrastructure Master

Function: Updates references to objects in other domains

๐Ÿ”’ Security Implications:

  • Cross-domain reference attacks
  • Object reference manipulation
  • Trust relationship exploitation

Schema Master

Function: Manages the Active Directory schema

๐Ÿ”’ Security Implications:

  • Schema modification attacks
  • Object class manipulation
  • Forest-wide impact

Domain Naming Master

Function: Manages domain additions and removals

๐Ÿ”’ Security Implications:

  • Domain manipulation attacks
  • Forest structure modification
  • Trust relationship changes

๐Ÿ—„๏ธ Active Directory Database (NTDS.dit)

Database Structure

The Active Directory database (NTDS.dit) stores all directory information and uses the Extensible Storage Engine (ESE).

๐Ÿ“Š NTDS.dit Key Information:

  • Location: %SystemRoot%\NTDS\NTDS.dit
  • Size: Grows with directory objects
  • Access: Exclusive access by LSASS process
  • Backup: Critical for disaster recovery

Database Tables

Table Name Purpose Security Relevance
datatable Main object storage Contains all AD objects and attributes
link_table Relationship storage Stores object relationships and references
sd_table Security descriptors Contains ACLs and permissions
msysobjects Schema definitions Defines object classes and attributes

๐Ÿ” Security Implications of AD Architecture

Attack Vectors

๐Ÿฐ Forest Trust Attacks

Exploiting trust relationships between forests to gain unauthorized access.

  • SID filtering bypass
  • Kerberos delegation abuse
  • Cross-forest privilege escalation

๐ŸŽฏ Domain Controller Compromise

Gaining control of domain controllers to access sensitive directory information.

  • NTDS.dit extraction
  • Golden ticket attacks
  • DCSync exploitation

๐Ÿ”‘ Role-Based Attacks

Targeting specific FSMO roles for privilege escalation.

  • PDC emulator password attacks
  • Schema master manipulation
  • RID master SID generation

Defense Strategies

๐Ÿ›ก๏ธ Network Segmentation

  • Isolate domain controllers
  • Implement firewall rules
  • Use dedicated management networks

๐Ÿ”’ Access Controls

  • Implement least privilege
  • Regular access reviews
  • Multi-factor authentication

๐Ÿ“Š Monitoring

  • Audit FSMO role access
  • Monitor NTDS.dit access
  • Track administrative activities

๐Ÿงช Hands-On Exercise

Exercise: AD Architecture Analysis

Objective: Analyze Active Directory architecture and identify potential security vulnerabilities.

๐Ÿ“‹ Steps:

  1. Domain Information Gathering

    Use PowerShell to enumerate domain information:

    Get-ADDomain | Select-Object Name, Forest, DomainMode, DomainControllers
    Get-ADForest | Select-Object Name, ForestMode, SchemaMaster, DomainNamingMaster
                                
  2. FSMO Role Identification

    Identify all FSMO role holders:

    netdom query fsmo
    # Or using PowerShell:
    Get-ADForest | Select-Object SchemaMaster, DomainNamingMaster
    Get-ADDomain | Select-Object PDCEmulator, RIDMaster, InfrastructureMaster
                                
  3. OU Structure Analysis

    Examine organizational unit hierarchy:

    Get-ADOrganizationalUnit -Filter * | Select-Object Name, DistinguishedName
                                
  4. Trust Relationship Mapping

    Document all trust relationships:

    Get-ADTrust -Filter * | Select-Object Name, Direction, TrustType
                                

๐Ÿ“„ Deliverables:

  • Domain architecture diagram
  • FSMO role holder documentation
  • Trust relationship map
  • Security vulnerability assessment

๐Ÿ“Š Knowledge Check

Question 1: What is the top-level container in Active Directory?

Question 2: Which FSMO role is responsible for password changes?

Question 3: What is the name of the Active Directory database file?

๐Ÿ”— Additional Resources

๐Ÿ“ง Stay Updated with New Lessons

Get notified when we add new lessons and expert content!