ActiveDirectory渗透测试
noahfranklin2026-10-25查看 438复制 1819
在测试本地部署的 Active Directory 环境时使用——包括枚举、Kerberos 攻击(Kerberoasting、AS-REP roasting、委派滥用)、凭据访问(NTLM/哈希、LSASS、DCSync)、ACL/权限滥用、GPO 滥用、信任攻击以及域权限提升攻击路径。映射到 MITRE ATT&CK,包含检测信号和修复建议。仅限假定失陷、已授权的参与场景。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md4008 chars
--- name: active-directory-pentest description: "Use when testing an on-prem Active Directory environment — enumeration, Kerberos attacks (Kerberoasting, AS-REP roasting, delegation abuse), credential access (NTLM/hashes, LSASS, DCSync), ACL/permission abuse, GPO abuse, trust attacks, and domain-privilege-escalation attack paths. Maps to MITRE ATT&CK, with detection signals and remediation. Assumed-breach, authorized engagements only." --- # Active Directory Penetration Testing Attack-path-driven assessment of on-prem AD (typically assumed-breach: you start with a low-priv foothold and work toward Domain Admin / specific objectives). Mapped to **MITRE ATT&CK**. Every technique lists its detection signal so defenders can catch it. ## 0. Authorization gate - [ ] Written scope: domain(s), foothold provided, objectives (DA / specific data). - [ ] DCSync / credential-dumping explicitly authorized (high impact). - [ ] Data-handling + cleanup (remove any created objects/accounts) agreed. ## 1. Enumeration (map the terrain) - Domain/forest structure, trusts, OUs, users, groups, computers, GPOs, ACLs. - Build the attack graph: who can reach Domain Admin via group membership, ACLs, sessions, or delegation. (BloodHound-style graph analysis is central — see `vuln-chaining` for path reasoning.) - Find high-value targets: DAs, service accounts, privileged sessions, unconstrained-delegation hosts. ## 2. Kerberos attacks - **Kerberoasting:** request service tickets for SPN accounts → offline crack weak service-account passwords. **Detect:** anomalous TGS requests / RC4. - **AS-REP roasting:** accounts without pre-auth → crackable. **Detect:** AS-REQ without pre-auth. - **Delegation abuse:** unconstrained (capture TGTs), constrained, and resource-based constrained delegation → impersonation. **Detect:** unusual S4U / TGT use. - **Fix:** strong/managed service-account passwords (gMSA), require pre-auth, remove/limit delegation, tier-0 isolation. ## 3. Credential access - NTLM hash capture (pair with `network-pentest` relay/poisoning), LSASS credential extraction (authorized), DPAPI, cached creds. - **DCSync** (replicate directory secrets) with sufficient rights → domain-wide compromise. - **Fix:** Credential Guard, LSASS protection, restrict replication rights, tiered admin model, LAPS for local admin passwords. ## 4. ACL, GPO & object abuse - Dangerous ACLs (GenericAll/WriteDACL/WriteOwner, force-change-password rights) create escalation edges. - GPO edit rights → code execution across linked OUs. - **Fix:** audit and tighten ACLs, restrict GPO edit rights, monitor privileged object changes. ## 5. Persistence & domain dominance (document, don't linger) Golden/Silver ticket concepts, AdminSDHolder, DCShadow — understand for detection guidance; in engagements, prove capability and document rather than establishing lasting persistence. - **Fix:** krbtgt rotation (twice), tier-0 protection, monitoring of directory-level changes. ## 6. Trusts - Enumerate domain/forest trusts; assess cross-domain/forest escalation paths. - **Fix:** SID filtering, selective authentication, minimize trusts. ## 7. Tooling BloodHound/SharpHound (attack graph), PowerView, impacket (secretsdump, GetUserSPNs, ntlmrelayx), Rubeus, certipy (AD CS — ESC1–ESC8). Follow RoE. ## 8. AD CS (certificate services) Test for ESC1–ESC8 template/permission misconfigurations enabling privilege escalation via certificate abuse. **Fix:** harden certificate templates, restrict enrollment, monitor issuance. ## 9. Reporting & correlation Present findings as **attack paths**, not isolated issues (foothold → step → step → DA), with the single highest-leverage fixes that break the most paths. Route path reasoning to `vuln-chaining`, priv-esc to `privilege-escalation`, cloud-identity to `entra-cloud-pentest`. Checklist: `references/ad-checklist.md`. --- <sub>© 2026 noahfranklin · Part of the [Gideon](https://github.com/noahfranklin/gideon) security suite · MIT License · Original work.</sub>