GO KALI FREE
AdvancedActive Directory

Active Directory Fundamentals: Windows Network Domains

A comprehensive introduction to Microsoft Active Directory covering domain services, LDAP, Group Policy, authentication protocols, and security fundamentals for Windows enterprise environments.

#Active Directory#Windows Server#LDAP#Domain Controller#Group Policy

Understanding Active Directory

Microsoft Active Directory (AD) is the directory service used in Windows enterprise environments to manage users, computers, groups, and network resources. First introduced with Windows 2000 Server, AD has become the backbone of identity and access management for the majority of organizations worldwide. Understanding AD is essential for any security professional because it represents both the central authentication authority and a prime target for attackers.

Active Directory stores information about network objects in a hierarchical database and makes this information available to administrators and users. It provides authentication, authorization, and accounting services through a centralized, policy-based infrastructure.

Prerequisites

Before diving into Active Directory security, you should have a solid understanding of:

  • **Networking Basics** — Familiarity with TCP/IP, DNS, and network protocols as covered in our Networking Basics guide
  • **Linux Commands** — Comfort with the command line for using security tools
  • **Windows Administration** — Basic knowledge of Windows Server and client operating systems
  • **Ethical Hacking Fundamentals** — Understanding of the penetration testing methodology
  • Core Components of Active Directory

    Domain Controllers

    Domain Controllers (DCs) are servers that host Active Directory Domain Services (AD DS). They store the directory database, authenticate users and computers, and replicate changes across the domain. Every domain should have at least two DCs for redundancy. The DC is the most critical server in a Windows network and the highest-value target for attackers.

    The AD Database (NTDS.dit)

    The heart of Active Directory is the NTDS.dit file, typically located at C:\Windows\NTDS\NTDS.dit. This database file stores all directory data including user objects, computer accounts, group memberships, password hashes, and security policies. If an attacker gains access to this file, they effectively own the entire domain.

    LDAP Protocol

    Active Directory uses Lightweight Directory Access Protocol (LDAP) for querying and modifying the directory. LDAP is an open, vendor-neutral protocol for accessing directory services over TCP port 389 (or 636 for LDAPS). Understanding LDAP queries is crucial for security analysis.

    # Query AD for all enabled users
    Get-ADUser -Filter {Enabled -eq $true} -Properties *
    
    # LDAP query using ADSI
    $searcher = [ADSISearcher]"(objectCategory=user)"
    $searcher.FindAll()
    

    Domain, Trees, and Forests

    AD organizes resources hierarchically. A domain is the core administrative unit, identified by its DNS name (like corp.example.com). A tree is a collection of domains sharing a contiguous DNS namespace. A forest is the highest-level container, grouping multiple trees that share a common schema and global catalog.

    Trust relationships connect domains and forests. Trusts allow users in one domain to access resources in another. Attackers frequently exploit trust relationships during lateral movement.

    Authentication Protocols in Active Directory

    Kerberos

    Kerberos is the default authentication protocol in modern Active Directory environments. It uses tickets and a trusted third-party (the Key Distribution Center on the Domain Controller) to authenticate users without transmitting passwords over the network. We cover Kerberos in depth in our dedicated article.

    NTLM

    NT LAN Manager (NTLM) is a legacy authentication protocol that remains enabled in most environments for backward compatibility. NTLM uses a challenge-response mechanism and is vulnerable to several attack types, including pass-the-hash and relay attacks. Disabling NTLM is a recommended security hardening step.

    Group Policy

    Group Policy is a feature that allows administrators to define and enforce configuration settings for users and computers across the domain. Group Policies are applied hierarchically at the site, domain, and organizational unit (OU) levels.

    # Backup all Group Policies
    Backup-GPO -All -Path C:\GPOBackup
    
    # Get resulting policy for a specific user
    gpresult /user targetuser /scope computer /v
    

    From a security perspective, Group Policy is significant because misconfigured policies can introduce vulnerabilities, and attackers who gain sufficient privileges can modify policies to deploy malware or disable security controls.

    Security Principles in Active Directory

    The Active Directory Attack Surface

    AD is a high-value target for several reasons:

  • Compromising AD means compromising the entire network
  • Password hashes for all domain users are stored on DCs
  • Trust relationships can be abused for cross-domain attacks
  • Misconfigurations are extremely common
  • Common Misconfigurations

    The most common AD security issues include overly permissive ACLs, service accounts with excessive privileges, legacy protocol support (NTLM, SMB1), unpatched domain controllers, weak password policies, and excessive group memberships (especially Domain Admin).

    Real-World Example: Initial Compromise to Domain Admin

    Consider a realistic attack chain:

  • An attacker phishes a user and gains access to a workstation
  • From the workstation, they enumerate the domain using native Windows tools
  • They discover a service account with delegated privileges
  • Using Kerberoasting, they crack the service account password
  • The service account has DCSync rights, allowing them to dump all password hashes from the DC
  • Using a golden ticket, they maintain persistent Domain Admin access
  • This chain illustrates why AD security requires defense in depth. Each step could have been blocked with proper security controls.

    Common Mistakes

  • **Running services under Domain Admin accounts** — Never use domain admin credentials for service accounts
  • **Ignoring the attack surface of service accounts** — Service accounts often have excessive privileges that go unnoticed
  • **Failing to monitor for AD-specific attack patterns** — Unusual replication activity or service ticket requests should trigger alerts
  • **Inconsistent patch management on Domain Controllers** — DCs must be patched promptly
  • **Trusting all domain-joined devices equally** — A compromised workstation should not lead to domain compromise
  • Best Practices

  • Implement **Protected Users** security group to enforce Kerberos-only authentication
  • Enable **Advanced Audit Policy** for AD object access and account management
  • Use **Group Managed Service Accounts (gMSA)** for service accounts
  • Deploy **Privileged Access Workstations (PAW)** for administrative tasks
  • Implement **tiering** (Tier 0/1/2) to separate high-privilege assets
  • Regularly audit **ACLs** for critical AD objects
  • Restrict **NTLM** usage through Group Policy
  • Enable **SMB signing** to prevent relay attacks
  • Deploy **LAPS** to manage local administrator passwords
  • Related Tools

  • **BloodHound** — Maps AD relationships for attack path analysis
  • **Impacket** — Python toolkit for AD protocol interaction
  • **PowerView** — PowerShell tool for AD enumeration
  • **CrackMapExec** — Swiss army knife for AD assessment
  • **Rubeus** — Kerberos interaction toolkit
  • [SMBClient](/tools/smbclient) — SMB share access and enumeration
  • Related Articles

  • Kerberos Explained: Authentication Protocol Deep Dive
  • BloodHound Guide: Mapping Active Directory Relationships
  • Domain Enumeration: Active Directory Reconnaissance Techniques
  • Pass-the-Hash: Understanding NTLM Authentication Attacks
  • Networking Basics
  • Summary

    Active Directory is the central authentication and management system for Windows enterprise environments. Understanding its components — domain controllers, LDAP, Kerberos, NTLM, Group Policy, and trust relationships — is essential for security professionals. The AD attack surface is broad, but proper security controls, monitoring, and hygiene can significantly reduce risk.

    Related SMB Tool Recommendations

  • [SMBClient](/tools/smbclient) - Verify share access and browse discovered SMB shares
  • [Enum4Linux](/tools/enum4linux) - Enumerate SMB users, groups, shares, and policies
  • [Enum4Linux-NG](/tools/enum4linux-ng) - Run modern SMB enumeration with structured output
  • [NBTScan](/tools/nbtscan) - Resolve NetBIOS names before deeper SMB testing
  • [CrackMapExec](/tools/crackmapexec) - Scale SMB enumeration across larger networks
  • [NetExec](/tools/netexec) - Use modern SMB and Active Directory automation
  • Knowledge Check

  • What is the primary database file that stores Active Directory data on a Domain Controller?
  • Which authentication protocol is the default in modern AD environments?
  • What is the purpose of a trust relationship between domains?
  • What tool maps AD relationships to identify attack paths?
  • Why are service accounts a common attack vector in Active Directory?
  • References

    {@ref mitre-attack-enterprise}

    {@ref mitre-attack-credential-access}

    Frequently Asked Questions

    What is Active Directory?

    Active Directory (AD) is Microsoft's directory service for Windows enterprise environments. It manages users, computers, groups, and network resources through centralized authentication, authorization, and policy enforcement. Understanding AD is essential because it controls access to nearly all resources in Windows networks.

    What is a Domain Controller?

    A Domain Controller (DC) is a server running Active Directory Domain Services (AD DS). It hosts the NTDS.dit database, authenticates users, and replicates changes across the domain. Every domain should have at least two DCs for redundancy — compromising a DC means compromising the entire domain.

    What is NTDS.dit and why is it important?

    NTDS.dit is the Active Directory database file stored at `C:\Windows\NTDS\NTDS.dit` on Domain Controllers. It contains all user objects, password hashes, group memberships, and security policies. An attacker who obtains this file effectively owns the entire domain.

    What is the difference between Kerberos and NTLM?

    Kerberos is the default modern AD authentication protocol using tickets without transmitting passwords. NTLM is a legacy challenge-response protocol that is vulnerable to pass-the-hash and relay attacks. Disabling NTLM is a recommended security hardening step.

    What are Active Directory trust relationships?

    Trust relationships allow users in one domain to access resources in another domain. They connect domains within forests and separate forests. Attackers frequently exploit trust relationships for lateral movement and cross-domain privilege escalation.

    What is Group Policy in Active Directory?

    Group Policy defines and enforces configuration settings for users and computers across the domain. Applied at site, domain, and OU levels, it controls password policies, software deployment, firewall rules, and security settings. Misconfigured Group Policies are a common source of vulnerabilities.

    What is LDAP and how does Active Directory use it?

    LDAP (Lightweight Directory Access Protocol) is the protocol AD uses for querying and modifying the directory. It runs on TCP port 389 (636 for LDAPS). Tools like PowerView and BloodHound use LDAP queries to enumerate users, groups, computers, and ACLs.

    What are service accounts in Active Directory?

    Service accounts run applications and services rather than human users. They often have elevated privileges and rarely change passwords, making them prime targets for Kerberoasting. Use Group Managed Service Accounts (gMSAs) for automatic password rotation and reduced risk.

    What are the most common Active Directory misconfigurations?

    Overly permissive ACLs, service accounts with excessive privileges, legacy NTLM support, unpatched Domain Controllers, weak password policies, and excessive Domain Admin group memberships are the most common AD security issues found in assessments.

    How do attackers escalate privileges in Active Directory?

    Attackers use Kerberoasting to crack service account passwords, exploit ACL misconfigurations for delegation, abuse trust relationships, leverage DCSync for hash extraction, and forge tickets (golden/silver) for persistent access. See our [Kerberos guide](/articles/kerberos-explained) for details.