--- name: ad-discovery description: Active Directory enumeration and reconnaissance — domain/forest facts, users, groups, computers, GPOs, trusts, ACLs, delegations, SPNs, shares and password policy, from unauthenticated, low-privileged and post-compromise vantage points. Feeds BloodHound attack-path analysis. Use at the start of and throughout any AD engagement. --- # AD Discovery & Enumeration You cannot attack what you cannot see. Enumerate broadly from every privilege level you gain, and re-run after each escalation. BloodHound is the centerpiece. ## Trigger phrases `ad enumeration, domain enum, bloodhound, sharphound, ldap enum, spn, password policy, domain trusts` ## Unauthenticated / pre-cred - Identify DCs: `nmap -p53,88,389,445,636,3268 `; `nslookup -type=SRV _ldap._tcp.dc._msdcs.`. - Null/guest SMB & LDAP: `netexec smb -u '' -p ''`, `enum4linux-ng -A `, `ldapsearch -x -H ldap:// -s base namingContexts`. - RID cycling / user enum: `netexec smb --rid-brute`; `kerbrute userenum -d users.txt` (no lockout, no logs on failure). - Password policy: `netexec smb --pass-pol` (plan spraying around lockout). ## Authenticated (any domain user) - **BloodHound** (do this first): `bloodhound-python -d -u -p -ns -c All`, or SharpHound on-host. Import and analyze shortest paths to DA/high-value. - LDAP dumps: users (`--users`), groups (`--groups`), computers (`--computers`), with `netexec ldap`. `ldapdomaindump` for an offline HTML view. - **SPNs** (Kerberoast targets): `GetUserSPNs.py /:`. - **AS-REP** candidates (no preauth): `GetNPUsers.py / -usersfile users.txt`. - **Delegations:** `findDelegation.py`; BloodHound flags unconstrained/constrained/RBCD. - **ADCS:** `certipy find -u @ -p -dc-ip ` → vulnerable templates (ESC1-8). - **Shares & files:** `netexec smb --shares`, then spider for creds/configs (`--spider`, Snaffler). - **LAPS/gMSA:** readable LAPS passwords, gMSA password read rights. ## Post-compromise Re-enumerate as each new identity; hunt local admin rights (`netexec smb -u -p ` → `(Pwn3d!)`), sessions (for token/credential theft), and new reachable segments. ## Depth - Map high-value targets (DAs, DCs, servers with admin sessions) and the shortest graph path to them. - Note stale/abandoned accounts, service accounts, and trust edges for cross-domain moves (`trust-attacks`). ## Evidence BloodHound DB + path screenshots, LDAP dumps, SPN/AS-REP/delegation/ADCS findings, share inventory.