/claude-pentest-skills:ad-reconfrom claude-pentest-skills
Active Directory reconnaissance skill for host discovery and comprehensive AD enumeration. Maps AD environments, enumerates users, groups, shares, trusts, SPNs, and BloodHound data. Outputs feed into the ad-exploitation skill.
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_enum.sh # PHASES 1-2: host discovery + unauthenticated + authenticated enumeration
Each script:
<DC_IP> <DOMAIN> <OUT> [USERNAME] [PASSWORD_OR_HASH] [--phase=N] as args.phase_X.done) — re-run safely without repeating completed phases---AD_SUMMARY_JSON--- markers for Claude to parseBefore running anything, ensure you have:
DC_IP = IP of the Domain Controller (e.g., 192.168.1.10)
DOMAIN = FQDN of the domain (e.g., corp.local)
USERNAME = domain user (optional — Phases 1 and 2 work unauthenticated)
PASSWORD = plaintext password (optional)
NTLM_HASH = LM:NT hash (optional, alternative to password)
If any of these are unknown, ask the user before proceeding.
DC_IP="10.10.10.100"
DOMAIN="corp.local"
USERNAME="" # leave empty for unauthenticated phases
PASSWORD="" # leave empty if using hash
NTLM_HASH="" # format: LM:NT or just :NT
PROJECT=$(echo "$DOMAIN" | sed 's/\./-/g' | tr '[:upper:]' '[:lower:]')
OUT="$(pwd)/$PROJECT"
SCRIPTS="$HOME/.claude/skills/ad-recon/scripts"
mkdir -p "$OUT"/{enum,hashes,bloodhound}
Create progress tasks with TaskCreate:
"PHASE 1 — Host Discovery & Service Scan"
"PHASE 2 — Unauthenticated Enumeration (null sessions, LDAP, kerbrute)"
"PHASE 2auth — Authenticated Enumeration (ldapdomaindump, BloodHound, SPN/AS-REP lists)"
"PHASE 3 — Report & Attack Surface Summary"
Mark each task in_progress when starting, completed when done.
nmap / rustscan — host and port discovery
enum4linux-ng — SMB/LDAP null session enumeration (preferred over enum4linux)
rpcclient — null session: user/group enumeration
smbclient — null session: share listing
ldapsearch — anonymous LDAP bind, base DN discovery
kerbrute — user enumeration via Kerberos pre-auth (no account needed)
crackmapexec / netexec — credential validation, SMB/LDAP/WinRM enumeration
ldapdomaindump — full LDAP dump (requires valid creds)
bloodhound-python — AD graph data collection (requires valid creds)
impacket-GetNPUsers — identify AS-REP roastable accounts
impacket-GetUserSPNs — identify Kerberoastable SPNs
mcp__hexstrike-ai__* — nmap_scan, enum4linux_ng_advanced, netexec_scan, rpcclient_enumeration, nbtscan_netbios
mcp__Notion__* — publish final recon report
rpcclient -U "" -N <DC_IP> -c "enumdomusers"
ldapsearch -x -H ldap://<DC_IP> -b "" -s base namingContexts
smbclient -L //<DC_IP> -N
ping -c 1 $DC_IP before running scriptssudo ntpdate $DC_IPbash "$SCRIPTS/ad_enum.sh" "$DC_IP" "$DOMAIN" "$OUT" --phase=1
What it runs:
ping -c 1 $DC_IP — connectivity check/24 around DC_IP (finds other DCs, servers, workstations)53, 88, 135, 139, 389, 445, 464, 593, 636, 1433, 3268, 3269, 3389, 5985, 5986, 9389Read JSON summary. Flag key ports and note potential attack paths:
| Port | Service | Attack implication |
|---|---|---|
| 88 | Kerberos | AS-REP Roasting, Kerberoasting |
| 389/636 | LDAP/LDAPS | enumeration, BloodHound |
| 445 | SMB | null sessions, pass-the-hash, relay |
| 5985/5986 | WinRM | evil-winrm lateral movement |
| 3389 | RDP | xfreerdp/rdesktop |
| 1433 | MSSQL | xp_cmdshell, linked servers |
Output: $OUT/enum/nmap_dc.txt, $OUT/enum/live_hosts.txt
bash "$SCRIPTS/ad_enum.sh" "$DC_IP" "$DOMAIN" "$OUT" --phase=2
What it runs:
enum4linux-ng -A — users, groups, shares, password policy, OS inforpcclient -U "" -N — enumdomusers, enumdomgroups, querydominfosmbclient -L //<DC_IP> -N — list shares$OUT/enum/users_rpcclient.txtldapsearch -x -H ldap://$DC_IP -b "" -s base namingContexts$OUT/enum/ldap_anon.txtkerbrute userenum -d $DOMAIN --dc $DC_IP <userlist>$OUT/enum/users.txtRead JSON summary. Report total users found and password policy (lockout threshold matters for Phase 1 of ad-exploitation).
Output: $OUT/enum/users.txt — this file feeds directly into ad-exploitation Phase 1 (AS-REP Roasting).
Requires USERNAME + PASSWORD or NTLM_HASH.
bash "$SCRIPTS/ad_enum.sh" "$DC_IP" "$DOMAIN" "$OUT" "$USERNAME" "$PASSWORD" --phase=2auth
# OR with hash:
bash "$SCRIPTS/ad_enum.sh" "$DC_IP" "$DOMAIN" "$OUT" "$USERNAME" "$NTLM_HASH" --phase=2auth
What it runs:
smb $DC_IP -u $USERNAME -p $PASSWORDldapdomaindump — dumps all users, groups, computers, GPOs, trusts to $OUT/enum/ldap/domain_users.html, domain_groups.html, domain_computers.html, domain_trusts.htmlbloodhound-python -d $DOMAIN -u $USERNAME -p $PASSWORD -dc $DC_IP -c All --zip$OUT/bloodhound/*.zip — import into BloodHound GUI for attack path analysisimpacket-GetNPUsers — accounts with UF_DONT_REQUIRE_PREAUTH (AS-REP roastable) → $OUT/hashes/asrep_hashes.txtimpacket-GetUserSPNs — accounts with SPNs (Kerberoastable) → $OUT/hashes/kerberoast_hashes.txtRead JSON summary. Flag:
Consolidate all output into a structured report:
## AD RECON REPORT — [DOMAIN] — [DATE]
## DC: $DC_IP | Output: $OUT
### Environment
- Domain FQDN: [domain]
- DC IP: [ip]
- Additional DCs/servers found: [list from nmap sweep]
- Trust relationships: [from ldapdomaindump/enum4linux]
### Attack Surface
- Users enumerated: [count] → $OUT/enum/users.txt
- Password policy: [lockout threshold, min length, duration]
- Accessible shares (null session): [list]
- SMB signing: [enabled/disabled — disabled = relay attack possible]
### Exploitation Candidates (hand off to ad-exploitation)
1. [CRITICAL] AS-REP roastable accounts: [count] — no creds required
2. [HIGH] Kerberoastable SPNs: [count, accounts]
3. [HIGH] BloodHound data collected → import and run: Shortest Path to Domain Admins
4. [MEDIUM] Null session access — password policy retrieved (lockout: [N] attempts)
5. [INFO] Open ports suggesting attack paths: [list]
### Next Step
Load ad-exploitation skill with:
DC_IP="$DC_IP"
DOMAIN="$DOMAIN"
RECON_OUT="$OUT"
USERNAME="<user if any found/known>"
If Notion MCP is available, publish with mcp__Notion__notion-create-pages.
Save evidence from each recon phase to $OUT/evidence/. Essential for documenting the attack surface found.
mkdir -p "$OUT/evidence"
# Terminal screenshot (macOS)
screencapture -x "$OUT/evidence/recon_$(date +%Y%m%d_%H%M%S)_$DESCRIPTION.png"
# Terminal screenshot (Linux)
scrot "$OUT/evidence/recon_$(date +%Y%m%d_%H%M%S)_$DESCRIPTION.png"
What to capture per phase:
domain_users.html + domain_computers.html; BloodHound — capture "Shortest Paths to Domain Admins" graph before closing the GUIBloodHound GUI:
1. Import $OUT/bloodhound/*.zip
2. Click "Shortest Paths to Domain Admins"
3. Right-click the graph → Export → save as $OUT/evidence/bloodhound_path_to_DA.png
Submit to Notion:
mcp__Notion__notion-create-pages — create AD recon page with attack surface
mcp__Notion__notion-update-page — attach nmap output, user list, BloodHound screenshot
mcp__hexstrike-ai__*)Use for: nmap_scan, nmap_advanced_scan, enum4linux_ng_advanced, netexec_scan,
rpcclient_enumeration, nbtscan_netbios, smbmap_scan.
mcp__Notion__*)Publish recon report. Create a subpage for exploitation candidates.
| Mode | When to use | What runs |
|---|---|---|
--quick | Fast initial footprint | Phase 1 + Phase 2 (unauthenticated only) |
--full | Full recon | Phases 1 + 2 + 2auth |
--unauth | No credentials — OSINT only | Phases 1 + 2 only |
--authenticated | Already have creds | Phase 2auth only |
$OUT/enum/users.txt and $OUT/hashes/asrep_hashes.txt feed directly into ad-exploitation — point RECON_OUT="$OUT" when loading that skill$OUT/bloodhound/*.zipKRB_AP_ERR_SKEW, run sudo ntpdate $DC_IPWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
active-directory, enumeration, bloodhound, ldap, smb, kerbrute, impacket
8 skills in this plugin
/ad-exploitationActive Directory exploitation skill — credential attacks, lateral movement, privilege escalation, and domain domination. Activate when the user wants to exploit an AD environment after enumeration, or mentions: Kerberoasting, AS-REP Roasting, pass-the-hash, pass-the-ticket, lateral movement, DCSync, Golden Ticket, BloodHound attack paths, evil-winrm, PSExec, or any variation of "attack the domain", "escalate in AD", "get domain admin". Picks up from ad-recon output when available.
/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-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