Password Spraying
Introduction
Password spraying is a technique used by attackers to gain unauthorised access to user accounts by exploiting weak or commonly used passwords. Unlike traditional brute-force attacks that repeatedly try many passwords on a single account (risking account lockout due to failed attempts), password spraying involves attempting a single password across multiple accounts. This method helps avoid triggering lockout policies, making it a stealthier and more effective attack technique.
Password spraying is categorised under the Credential Access tactic in the MITRE ATT&CK framework (ID: T1110.003) and is frequently used as a precursor to further attacks, such as lateral movement, privilege escalation, or data exfiltration.
How Password Spraying Works
Account Discovery:
Attackers compile a list of valid usernames or email addresses.
This can be achieved through OSINT (Open Source Intelligence), compromised databases, or reconnaissance tools.
Weak Password Selection:
Commonly used passwords, such as
Password123
,Welcome1
, or season/year combinations likeSpring2025
, are selected as attack vectors.
Spraying Process:
A single weak password is tested across multiple accounts.
If unsuccessful, another password is selected, avoiding consecutive failed attempts on any single account to evade lockout policies.
Successful Compromise:
Once a valid username-password pair is identified, the attacker gains unauthorised access to the account.
They can then escalate privileges or use the account to launch further attacks.
Why Password Spraying is Effective
Avoids Lockouts:
By distributing authentication attempts across many accounts, attackers stay under account lockout thresholds.
Exploits Weak Password Policies:
Organisations with poorly enforced password complexity policies are especially vulnerable.
Large Attack Surface:
Modern organisations with hundreds or thousands of user accounts provide attackers with ample opportunities.
Low Detection Probability:
Spraying attacks mimic normal authentication attempts, making them harder to detect.
Indicators of Password Spraying
High Volume of Failed Logons:
A significant number of failed authentication attempts distributed across multiple accounts within a short timeframe.
Unusual Authentication Sources:
Logon attempts originating from unknown or suspicious IP addresses, especially from geographic locations where the organisation has no presence.
Targeting Multiple Accounts:
Logon failures affecting many accounts, often with the same password.
Successful Logons Following Failures:
Successful logons from the same IP after multiple failed attempts suggest spraying success.
Mitigation Strategies
Strong Password Policies:
Enforce password complexity requirements (e.g., length, special characters, and no common passwords).
Implement password expiration policies.
Multi-Factor Authentication (MFA):
Require MFA for all user accounts, making password spraying ineffective even if the password is compromised.
Account Lockout Policies:
Configure account lockout settings to limit the number of failed login attempts.
Monitor Authentication Logs:
Continuously analyse logs for patterns of failed and successful logons.
Set alerts for unusual logon activity.
Limit Exposure:
Reduce publicly accessible account lists, such as employee directories or email address formats.
User Awareness Training:
Educate users on creating strong passwords and recognising social engineering techniques.
Detection Techniques
Log Analysis:
Event ID 4625: Monitor logs for failed login attempts.
Event ID 4624: Event is generated when an object logs on successfully, such as to a user
Event ID 2889: Event is generated when a computer object tries to make an unsigned LDAP bind.
Event ID 4648: Event is generated when a logon is attempted using explicit credentials.
Event ID 4740: Event is generated when a user object is locked out.
Event ID 4771: Event is generated when Kerberos pre-authentication fails.
Detect patterns of failures distributed across multiple accounts from the same IP.
Correlation Rules:
Use SIEM solutions (e.g., Splunk, Sentinel) to detect suspicious patterns, such as failed logons from unusual IPs followed by a successful logon.
Geographic Analysis:
Flag logons from locations inconsistent with the user's typical behaviour.
Threat Intelligence Integration:
Cross-reference IP addresses with known malicious actors or threat intelligence feeds.
Password spraying remains a prevalent and effective attack method due to its simplicity and the prevalence of weak passwords in many organisations. By understanding how it works and proactively implementing strong defences and monitoring, organisations can significantly reduce their exposure to this attack vector.
KQL Detection Queries
Query to Detect Password Spraying
Query Breakdown
Failed Logons (Event ID 4625):
Captures failed logon events, grouping by
ClientIP
and aggregating failed attempts over 15-minute intervals.Identifies IPs with a high number of failed attempts and multiple targeted accounts:
FailedAttempts > 10
: Adjust based on environment baseline.UniqueAccounts > 5
: Indicates many accounts were targeted.
Successful Logons (Event ID 4624):
Captures successful logons from the same IPs within the same 15-minute window.
Identifies instances where spraying attempts succeeded.
Suspicious Scoring:
Assigns a
SuspiciousScore
based on the severity of activity:High: Over 20 failed attempts, more than 10 accounts, and successful logons.
Medium: Over 10 failed attempts and 5 accounts targeted.
Correlation:
Joins failed logon data with successful logon data using
ClientIP
andTimeGenerated
.
Final Output:
Displays the client IP, time, number of failed attempts, number of successful attempts, and targeted accounts.
Focuses on High and Medium suspicious activity.
Customisations
Threshold Tuning:
Adjust thresholds (
FailedAttempts > 10
,UniqueAccounts > 5
) based on the baseline of your environment.
Time Binning:
Modify
bin(TimeGenerated, 15m)
to adjust the time window for detecting spraying.
Exclusions:
Exclude trusted IPs or service accounts to reduce false positives:
Additional Recommendations
Alert Configuration:
Set up alerts for
SuspiciousScore = High
to notify SOC analysts.
Dashboard Integration:
Create a visualisation showing failed logon trends, unique accounts targeted, and suspicious IPs.
Threat Intelligence:
Cross-reference
ClientIP
with known malicious IPs from threat intelligence feeds.
Splunk Detection Queries
Basic Splunk Query for Password Spraying Detection
Query Breakdown
Filters Relevant Events:
EventCode=4625
: Failed logons.EventCode=4624
: Successful logons.
Evaluates Logon Type:
Label events as "Failed Logon" or "Successful Logon" for clarity.
Aggregates Data:
FailedAttempts
: Count of failed logons per source IP.SuccessfulAttempts
: Count of successful logons per source IP.UniqueAccounts
: Number of distinct accounts targeted by the source IP.SourceIPs
: IP addresses involved in the activity.
Detects Suspicious Behavior:
Flags source IPs with:
More than 10 failed attempts across 5 or more accounts.
Assigns a "High" or "Medium" SuspiciousScore for prioritised analysis.
Excludes Low-Risk Activity:
Focuses only on high or medium risk patterns by filtering out low scores.
Reference
Last updated