Password Spraying

Password Spraying

Password spraying is an effective authentication attack technique that attempts to access a large number of accounts with a few commonly used passwords. Unlike traditional brute force attacks that try many passwords against a single account, password spraying tries a single password against many accounts before moving on to the next password, which helps to avoid account lockouts.

Understanding Password Spraying

Password Spraying vs. Brute Force

Password Spraying
Traditional Brute Force

Few passwords against many accounts

Many passwords against few accounts

Typically uses common, weak passwords

Can use dictionary or exhaustive attacks

Designed to evade lockout policies

Often triggers account lockouts

Lower chance of success per account

Higher chance of success per account

Lower risk of detection

Higher risk of detection

When to Use Password Spraying

Password spraying is most effective when:

  • Account lockout policies are in place

  • You have identified many valid usernames

  • You want to remain stealthy

  • You suspect default, common, or weak password usage

  • Organization-wide password patterns might exist

Preparation for Password Spraying

Understanding the Target Environment

Before performing password spraying, gather intelligence about:

  1. Account lockout thresholds: Determine how many failed attempts trigger a lockout

  2. Lockout duration: Learn how long accounts remain locked

  3. Lockout observation window: Understand the time window for counting failed attempts

  4. Password complexity requirements: Tailor your password list to meet requirements

  5. Authentication endpoints: Identify all services that can be used for authentication

Creating Target Lists

Generate a list of valid usernames using techniques from user enumeration:

Building Password Lists

Effective password spraying requires carefully selected passwords:

  1. Season-based passwords: Spring2023!, Summer2023!, etc.

  2. Company-specific passwords: CompanyName2023!, CompanyName123, etc.

  3. Common patterns: Welcome1, Password1, etc.

  4. Default passwords: Known defaults for the target system

  5. Previously breached passwords: From public data breaches

  6. Password variations: Account for common substitutions (@ for a, 0 for o, etc.)

Example of a minimal but effective password list:

Password Spraying Techniques

Windows/Active Directory Environment

Using CrackMapExec for SMB

Using Kerbrute for Kerberos

Using PowerShell Empire/Invoke-DomainPasswordSpray

Web Applications

Using FFUF

Using Hydra

Other Common Protocols

SMTP

SSH

FTP

Executing a Safe Password Spray

Time-Based Approach

To avoid triggering account lockouts, spread attempts across time:

  1. Determine the lockout threshold (e.g., 5 attempts)

  2. Determine the observation window (e.g., 30 minutes)

  3. Use a single password against all accounts

  4. Wait for the observation window to reset

  5. Try the next password

Jitter-Based Approach

Add randomness to your attempts to avoid detection:

Batching Approach

Divide the user list into smaller batches:

Detection and Evasion Considerations

Common Detection Methods

  1. Threshold alerts: Multiple failed attempts detected

  2. Source IP pattern: Multiple attempts from the same IP

  3. Timing patterns: Regular intervals between attempts

  4. Account coverage: Failed attempts across many accounts

  5. Unusual authentication times: Activity outside business hours

Evasion Techniques

  1. Rotate source IPs: Use multiple exit nodes or proxies

  2. Add jitter: Randomize timing between attempts

  3. Limit scope: Target fewer accounts per spray

  4. Use expected credentials: Start with the most likely passwords

  5. Timing selection: Perform spraying during normal business hours

After a Successful Spray

Credential Validation

Confirm that obtained credentials are valid:

Privilege Assessment

Determine the permissions of compromised accounts:

Lateral Movement

Use compromised credentials to access other systems:

Best Practices

  1. Start conservatively: Begin with a small subset of accounts

  2. Monitor for lockouts: Watch for signs of account lockouts during spraying

  3. Document everything: Keep detailed records of attempts and results

  4. Avoid service accounts: These often have monitoring and may trigger alerts

  5. Test one password fully: Complete a full spray with one password before moving to the next

  6. Prioritize attempts: Start with the most likely passwords for your target environment

  • Only perform password spraying with explicit permission

  • Document all activities thoroughly

  • Be mindful of potential system impacts

  • Report findings responsibly

  • Follow proper data handling procedures for any credentials discovered

Password spraying remains one of the most effective techniques for gaining initial access to environments with multiple user accounts. When performed carefully and methodically, it can yield valuable access while minimizing the risk of detection or account lockouts.

Last updated