Detecting Password Spraying
Overview
Password Spraying is a targeted attack that:
Attempts a limited number of commonly used passwords across multiple user accounts.
Avoids account lockout policies by using only a few password attempts per account.
Is designed to evade detection by exploiting weak passwords across a wide user base rather than brute-forcing individual accounts.
Example: Password spraying via the Spray tool, where the attacker tests a limited set of passwords across multiple accounts in a network.
Detection Opportunities
Log-Based Indicators of Password Spraying
Monitoring Windows logs for patterns of password spraying can reveal anomalies, especially when multiple failed logon attempts (Event ID 4625) from different user accounts originate from a single IP address over a short period.
Key Event Logs for Password Spraying Detection:
4625 - Failed Logon
Tracks failed logins for different accounts from a single source.
4768 - Kerberos Authentication Ticket (TGT) Request
ErrorCode 0x6: Invalid user attempts.
ErrorCode 0x12: Disabled user attempts.
4776 - NTLM Authentication
ErrorCode 0xC000006A: NTLM invalid users.
ErrorCode 0xC0000064: NTLM wrong password.
4648 - Logon Attempt Using Explicit Credentials
Identifies credential misuse.
4771 - Kerberos Pre-Authentication Failure
Detecting Password Spraying Using Splunk
Timeframe
Earliest:
1690280680Latest:
1690289489
Splunk Query
Query Breakdown
Filter by Index, Source, and Event Code:
Focuses on the Security Event Log entries (
WinEventLog:Security) withEventCode=4625, representing failed logons.
Time Range Filter:
Limits search to a specific timeframe based on Unix timestamps, filtering only relevant logs.
Time Binning:
The
bincommand groups events into 15-minute intervals, aiding in pattern detection by observing failed logon attempts over short time spans.
Statistics Aggregation:
The
statscommand aggregates by key fields to analyze logon failures across different accounts.values(user) as Users: Lists all unique users associated with failed logon attempts.dc(user) as dc_user: Counts distinct users within each group to identify multiple accounts targeted from a single IP source.
Last updated