ID | Technique | Tactic |
---|---|---|
T1003.002 | Security Account Manager | Credential Access |
T1003 | OS Credential Dumping | Credential Access |
Detection: SAM Database File Access Attempt
Description
The following analytic detects attempts to access the SAM, SYSTEM, or SECURITY database files within the windows\system32\config
directory using Windows Security EventCode 4663. This detection leverages Windows Security Event logs to identify unauthorized access attempts. Monitoring this activity is crucial as it indicates potential credential access attempts, possibly exploiting vulnerabilities like CVE-2021-36934. If confirmed malicious, an attacker could extract user passwords, leading to unauthorized access, privilege escalation, and further compromise of the system.
Search
1`wineventlog_security` (EventCode=4663) ProcessName!=*\\dllhost.exe ObjectName IN ("*\\Windows\\System32\\config\\SAM*","*\\Windows\\System32\\config\\SYSTEM*","*\\Windows\\System32\\config\\SECURITY*")
2| stats values(AccessList) count by ProcessName ObjectName dest src_user
3| rename ProcessName as process_name
4| `sam_database_file_access_attempt_filter`
Data Source
Name | Platform | Sourcetype | Source |
---|---|---|---|
Windows Event Log Security 4663 | Windows | 'xmlwineventlog' |
'XmlWinEventLog:Security' |
Macros Used
Name | Value |
---|---|
wineventlog_security | eventtype=wineventlog_security OR Channel=security OR source=XmlWinEventLog:Security |
sam_database_file_access_attempt_filter | search * |
sam_database_file_access_attempt_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
Setting | Value |
---|---|
Disabled | true |
Cron Schedule | 0 * * * * |
Earliest Time | -70m@m |
Latest Time | -10m@m |
Schedule Window | auto |
Creates Risk Event | False |
Implementation
To successfully implement this search, you must ingest Windows Security Event logs and track event code 4663. For 4663, enable "Audit Object Access" in Group Policy. Then check the two boxes listed for both "Success" and "Failure."
Known False Positives
Natively, dllhost.exe
will access the files. Every environment will have additional native processes that do as well. Filter by process_name. As an aside, one can remove process_name entirely and add Object_Name=*ShadowCopy*
.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
The following process $process_name$ accessed the object $ObjectName$ attempting to gain access to credentials on $dest$ by user $src_user$. | 80 | 80 | 100 |
References
-
https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventID=4663
-
https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4663
-
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36934
-
https://github.com/JumpsecLabs/Guidance-Advice/tree/main/SAM_Permissions
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | ✅ Passing | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | XmlWinEventLog:Security |
XmlWinEventLog |
Integration | ✅ Passing | Dataset | XmlWinEventLog:Security |
XmlWinEventLog |
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
Source: GitHub | Version: 4