Detection rules › Splunk

SAM Database File Access Attempt

Status
production
Group by
dest, object_name, process_name, user
Author
Michael Haag, Mauricio Velazco, Splunk
Source
github.com/splunk/security_content

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.

MITRE ATT&CK coverage

Event coverage

Rule body splunk

name: SAM Database File Access Attempt
id: 57551656-ebdb-11eb-afdf-acde48001122
version: 8
creation_date: '2021-07-23'
modification_date: '2026-05-13'
author: Michael Haag, Mauricio Velazco, Splunk
status: production
type: Hunting
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.
data_source:
    - Windows Event Log Security 4663
search: '`wineventlog_security` (EventCode=4663)  ProcessName!=*\\dllhost.exe ObjectName IN ("*\\Windows\\System32\\config\\SAM*","*\\Windows\\System32\\config\\SYSTEM*","*\\Windows\\System32\\config\\SECURITY*") | stats values(AccessList) count by ProcessName ObjectName dest src_user | rename ProcessName as process_name | `sam_database_file_access_attempt_filter`'
how_to_implement: 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*`.
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/GossiTheDog/HiveNightmare
    - https://github.com/JumpsecLabs/Guidance-Advice/tree/main/SAM_Permissions
    - https://en.wikipedia.org/wiki/Security_Account_Manager
analytic_story:
    - Credential Dumping
    - Graceful Wipe Out Attack
    - Rhysida Ransomware
asset_type: Endpoint
cve:
    - CVE-2021-36934
mitre_attack_id:
    - T1003.002
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1003.002/serioussam/windows-xml.log
          source: XmlWinEventLog:Security
          sourcetype: XmlWinEventLog
      test_type: unit

Stages and Predicates

Stage 1: search

`wineventlog_security` (EventCode=4663)  ProcessName!=*\\dllhost.exe ObjectName IN ("*\\Windows\\System32\\config\\SAM*","*\\Windows\\System32\\config\\SYSTEM*","*\\Windows\\System32\\config\\SECURITY*")

Stage 2: stats

| stats values(AccessList) count by ProcessName ObjectName dest src_user

Stage 3: rename

| rename ProcessName as process_name

Stage 4: search

| `sam_database_file_access_attempt_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
EventCodeeq
  • 4663 corpus 34 (splunk 29, kusto 5)
ObjectNamein
  • "*\\Windows\\System32\\config\\SAM*"
  • "*\\Windows\\System32\\config\\SECURITY*"
  • "*\\Windows\\System32\\config\\SYSTEM*"
ProcessNamene
  • *\\dllhost.exe