Detecting Pass The Hash with Sysmon
Detecting Pass The Hash (PtH) Attacks with Sysmon
Pass the Hash (PtH) attacks exploit the ability to authenticate using stolen NTLM hashes instead of plaintext passwords. Detecting such attacks requires focused monitoring of system behaviors using both Windows Event Logs and Sysmon.
1. How PtH Attacks Work
Steps in a PtH Attack:
Initial Access: The attacker gains a foothold using phishing or exploits.
Hash Extraction: Tools like Mimikatz extract NTLM hashes from
lsass.exe
.Lateral Movement: The attacker uses tools like PsExec, wmiexec, or Metasploit to authenticate with the stolen hash across the network.
2. Detection Techniques
A. Event Log Analysis
Key Event ID: 4624 (Successful Login)
Focus on Security Logs to identify unusual authentication behavior:
Logon Type = 3: Indicates network logon (used for lateral movement).
Logon Process = NtLmSsP: Indicates NTLM authentication.
Key Length = 0: Signals that a hash, not a password, was used.
Security ID = NULL SID: Often associated with unauthorized hash-based logons.
Workstation Name: Check for unexpected or random workstation names.
Indicators of PtH in Event Viewer:
B. Sysmon Detection Configuration
Sysmon provides granular visibility into process and access events. Below are essential configurations for PtH detection:
1. Monitoring PsExec and Related Tools
Track tools frequently used for lateral movement:
2. Detecting Unauthorized lsass.exe
Access
lsass.exe
AccessMonitor attempts to read memory from lsass.exe
, often targeted for hash extraction:
3. Suspicious Process Creations Post-Exploitation
Detect command executions originating from compromised processes:
4. Sample Sysmon Logs for PtH Detection
Sysmon Event ID 1 (Process Create)
Detect suspicious child processes spawned from critical system processes:
Sysmon Event ID 10 (Process Access)
Identify processes accessing lsass.exe
:
5. Best Practices for Mitigating PtH Attacks
Enforce Least Privilege:
Limit administrative access to reduce exposure.
Use Just-In-Time (JIT) administration to grant temporary privileges.
Enable Credential Guard:
Protect
lsass.exe
from unauthorized memory access.Prevent hash extraction even if
lsass.exe
is targeted.
Monitor Logs Continuously:
Leverage SIEM tools to aggregate and analyze Event Viewer and Sysmon logs in real-time.
Set alerts for specific Sysmon events indicating PtH activity.
Disable NTLM Authentication:
Migrate to Kerberos wherever possible to eliminate NTLM's inherent vulnerabilities.
Apply Network Segmentation:
Isolate sensitive systems to limit lateral movement opportunities.
Key Points
By combining Event Viewer’s 4624 logs with Sysmon’s granular process and memory monitoring, defenders can effectively detect Pass the Hash attacks. With a robust Sysmon configuration and continuous monitoring, security teams can quickly identify and mitigate such threats.
Last updated