AdFind
Purpose
Use this skill for low-impact AD object discovery when the engagement needs a fast LDAP-backed view of specific domain metadata.
Phase Fit
- Primary: Discovery and Reconnaissance, Threat Modeling and Test Planning
- Secondary: Vulnerability Analysis, Retest and Closure
Use When
- Need focused queries for users, groups, computers, SPNs, or trusts.
- Need a lightweight alternative to broader collection frameworks.
- Need a repeatable AD metadata retest.
Avoid When
- Domain scope or query boundaries are unclear.
- Broad LDAP harvesting would exceed the approved objective.
Inputs
- Approved domain and host context
- Narrow query goal and attribute set
- Output handling requirements
Procedure
- Start with the narrowest filter that answers the question.
- Collect only the attributes needed for the current hypothesis.
- Correlate results with other AD evidence before escalation.
- Preserve the exact filter and output set for retest.
- Treat output as discovery context unless tied to material risk.
Command Syntax
Replace sample filters with approved in-scope queries.
:: List all domain users
AdFind.exe -f "(objectClass=user)" sAMAccountName userPrincipalName
:: List all domain computers
AdFind.exe -f "(objectClass=computer)" cn operatingSystem
:: List domain controllers
AdFind.exe -sc dclist
:: List members of Domain Admins
AdFind.exe -f "(&(objectClass=user)(memberof=CN=Domain Admins,CN=Users,DC=contoso,DC=com))"
:: List all GPOs
AdFind.exe -f "(objectClass=groupPolicyContainer)" displayName gPCFileSysPath
:: Enumerate domain trusts
AdFind.exe -f "(objectClass=trustedDomain)"
:: Dump all attributes for a specific account
AdFind.exe -f "(sAMAccountName=administrator)"
Evidence to Capture
- Domain metadata relevant to the current hypothesis
- Exact filters and attributes used
- Why the returned objects materially affect the assessment
Safety Boundaries
- Keep filters narrow and approved.
- Avoid broad directory harvesting beyond the phase objective.