Detecting Pass-the-Hash
Overview of Pass-the-Hash
Pass-the-Hash (PtH) is a technique that allows attackers to authenticate to systems using the NTLM hash of a password instead of the plaintext password. It exploits how Windows stores password hashes in memory, making it possible to capture and reuse these hashes for lateral movement.
Pass-the-Hash Attack Steps:
Hash Extraction: The attacker, often using tools like Mimikatz, extracts the NTLM hash from memory (usually from the
lsass.exeprocess).Authentication with Hash: Using the NTLM hash, the attacker can authenticate to network resources as the compromised user.
Lateral Movement: The attacker gains unauthorized access to networked systems or resources without knowing the plaintext password.
Detection Opportunities for Pass-the-Hash
To detect PtH attacks, it is essential to monitor for unusual logon events and suspicious process access patterns, specifically targeting:
Event ID 4624: Logon event, particularly with LogonType 9 (NewCredentials) and Logon_Process of
seclogo, which may indicate alternate credentials.Sysmon Event ID 10: Process access events, focusing on attempts to access
lsass.exe, where tools like Mimikatz interact with LSASS to dump password hashes.
Detecting Pass-the-Hash With Splunk
The following Splunk searches help identify PtH attacks by correlating security logon events with Sysmon process access events.
Example 1: Detecting Alternate Credentials Logon
Description: Searches for logon events with LogonType 9 (NewCredentials) and Logon_Process seclogo, which may indicate the use of alternate credentials.
Timeframe: earliest=1690450689 latest=1690451116
index=main earliest=1690450689 latest=1690451116 source="WinEventLog:Security" EventCode=4624 Logon_Type=9 Logon_Process=seclogo
| table _time, ComputerName, EventCode, user, Network_Account_Domain, Network_Account_Name, Logon_Type, Logon_ProcessExample 2: Detecting Pass-the-Hash with LSASS Access
Description: Enhances the detection of PtH by combining LogonType 9 logons with Sysmon Event ID 10, which flags suspicious access to lsass.exe. This approach associates unauthorized process access with potential credential usage for lateral movement.
Timeframe: earliest=1690450689 latest=1690451116
Explanation of Key Search Components
Event Filtering:
The query isolates Sysmon events where
lsass.exeis accessed (EventCode 10) but excludes legitimate processes likeMsMpEng.exe.It also includes logon events with EventCode 4624, LogonType 9, and Logon_Process
seclogo, indicating alternate credentials.
Transaction Command:
Purpose: Links process access events targeting
lsass.exewith logon events within a brief time span.Configuration: Groups events based on the
hostfield, withmaxspan=1m, starting with EventCode 10 (indicating lsass access) and ending with EventCode 4624 (a logon).
Stats Aggregation:
Purpose: Summarizes the detection results to show unique combinations of suspicious events by IP, user, and process.
Output Fields: Filters and organizes key fields, such as
Computer,SourceImage,SourceProcessId, andNetwork_Account_Name.
Last updated