7.Password Spraying - Making a Target User List
CrackMapExec (CME):
Retrieves detailed password policy information.
Without Credentials (Linux)
rpcclient:
Commands within rpcclient:
querydominfo
- Retrieves domain information.getdompwinfo
- Retrieves password policy.
enum4linux:
Enumerates password policy information.
enum4linux-ng:
Enhanced enumeration with JSON/YAML output.
ldapsearch (LDAP Anonymous Bind):
Extracts password policy attributes.
From Windows
SMB NULL Session:
Analyze error messages for policy insights.
Authenticated Access (net.exe):
Displays password policy details.
PowerView:
Retrieves detailed domain password policies.
enum4linux:
rpcclient:
Commands within rpcclient:
enumdomusers
- Enumerates domain users.
CrackMapExec:
ldapsearch:
windapsearch:
Kerbrute:
Critical Password Policy Parameters
Minimum password length
Account lockout threshold
Lockout duration
Password complexity requirements
Password Spraying Considerations
Understand the policy to avoid account lockouts.
If the policy is unknown, proceed cautiously.
Create a target user list for more accurate spraying.
User Enumeration Methods
SMB NULL Sessions
Retrieves a complete list of domain users from the Domain Controller.
Tools: enum4linux, rpcclient, CrackMapExec.
LDAP Anonymous Binds
Queries LDAP anonymously to retrieve the domain user list.
Tools: ldapsearch, windapsearch.
Kerbrute
Validates users using wordlists (e.g., statistically-likely-usernames GitHub repo).
Uses Kerberos Pre-Authentication, which is faster and potentially stealthier.
Generates event ID 4768: A Kerberos authentication ticket (TGT) was requested.
Credentialed Enumeration
Uses valid domain credentials to query Active Directory.
Tools: CrackMapExec.
OSINT Gathering
Searching for company email addresses.
Using tools such as linkedin2username.
Key Considerations
Domain Password Policy
Importance of knowing the password policy (minimum password length, complexity, lockout thresholds).
Methods to obtain the password policy (SMB NULL sessions, LDAP anonymous binds, credentialed access).
Precautions when the password policy is unknown.
Logging
Maintaining detailed logs of password spraying activities (targeted accounts, Domain Controller, time, date, passwords attempted).
Helps prevent duplicate efforts and provides information for troubleshooting.
SYSTEM Account Impersonation
The SYSTEM account can impersonate the computer, allowing it to query Active Directory.
Important Notes
Kerbrute username enumeration generates Kerberos event ID 4768.
CrackMapExec's --users flag displays badpwdcount and baddpwdtime.
When using multiple domain controllers, keep in mind that the badpwdcount is kept on each domain controller separately.
If you have a PDC emulator FSMO role, that domain controller will hold the most accurate count.
External information gathering (OSINT) is essential when internal enumeration is limited.
Always exercise caution to avoid account lockouts during password spraying.
Last updated