Active Directory Attacks - Shadow Protocol

Active Directory: The Kingdom and Its Keys

Active Directory is the heart of Windows enterprise environments. Compromise AD, and you control everything—every user, every computer, every secret. Understanding AD attacks is essential for both attackers and defenders.

Why AD Is the Ultimate Target

A single domain admin account grants access to every system in the domain. One misconfiguration can expose the entire organization. AD was designed for usability in the 90s—security was an afterthought. Those design decisions haunt enterprises today.

Understanding AD Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                     ACTIVE DIRECTORY STRUCTURE                       │
├─────────────────────────────────────────────────────────────────────┤
│                                                                       │
│  ┌─────────────┐       ┌─────────────┐       ┌─────────────┐        │
│  │   FOREST    │       │   FOREST    │       │   FOREST    │        │
│  │  (Trust)    │◄─────►│  (Trust)    │◄─────►│  (Trust)    │        │
│  └──────┬──────┘       └──────┬──────┘       └──────┬──────┘        │
│         │                      │                      │               │
│    ┌────┴────┐            ┌────┴────┐            ┌────┴────┐        │
│    │ DOMAIN  │            │ DOMAIN  │            │ DOMAIN  │        │
│    │ (Root)  │            │ (Root)  │            │ (Root)  │        │
│    └─────┬───┘            └─────────┘            └─────────┘        │
│         │                                                            │
│    ┌────┴────┬────────────┐                                         │
│    │         │            │                                          │
│    ▼         ▼            ▼                                          │
│  ┌─────┐  ┌─────┐     ┌─────┐                                       │
│  │Child│  │Child│     │Child│     Domain Controllers                │
│  │ DC  │  │ DC  │     │ DC  │     hold all the secrets              │
│  └─────┘  └─────┘     └─────┘                                       │
│                                                                       │
│  KEY COMPONENTS:                                                      │
│  • NTDS.dit  - The AD database (all hashes live here)               │
│  • SYSVOL    - Group policies (often contains passwords)            │
│  • Kerberos  - Authentication protocol (full of attacks)            │
│  • LDAP      - Directory queries (reconnaissance gold)              │
│                                                                       │
└─────────────────────────────────────────────────────────────────────┘

AD Reconnaissance

Before attacking AD, you need to understand its structure. LDAP queries and built-in Windows commands reveal everything about the domain.

Built-in Windows Commands

# Domain information
systeminfo | findstr /B /C:"Domain"
nltest /dclist:domain.local
nltest /domain_trusts

# User enumeration
net user /domain
net user administrator /domain
net group "Domain Admins" /domain
net group "Enterprise Admins" /domain

# Computer enumeration
net group "Domain Computers" /domain
nltest /dsgetdc:domain.local

# Trust relationships
nltest /trusted_domains

PowerShell AD Module

# Import module (if RSAT installed)
Import-Module ActiveDirectory

# Enumerate domain
Get-ADDomain
Get-ADForest
Get-ADTrust -Filter *

# Find privileged accounts
Get-ADGroupMember -Identity "Domain Admins" -Recursive
Get-ADGroupMember -Identity "Enterprise Admins" -Recursive
Get-ADGroupMember -Identity "Administrators" -Recursive

# Find service accounts (Kerberoasting targets)
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName

# Find accounts with no Kerberos preauth (AS-REP roasting)
Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true}

# Find computers
Get-ADComputer -Filter * -Properties OperatingSystem |
    Select Name, OperatingSystem

BloodHound - Attack Path Mapping

BloodHound is the most powerful AD reconnaissance tool. It maps relationships and finds attack paths that humans would miss.

# SharpHound collection (run from compromised host)
# All collection methods
.\