Detection rules › Splunk

SAM, System, Security Files Accessed (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

This use case looks for file access of C:\Windows\System32\config(SAM|System|Security) as seen with HiveNightmare/SeriousSam CVE-2021-33757. Vulnerability that allows non-admins to access the Security Account Manager (SAM) database, which stores users’ passwords

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '6561.7484'
title: SAM, System, Security Files Accessed
description: 'This use case looks for file access of C:\Windows\System32\config\(SAM|System|Security)
  as seen with HiveNightmare/SeriousSam CVE-2021-33757. Vulnerability that allows
  non-admins to access the Security Account Manager (SAM) database, which stores users’
  passwords. - Threat Actor Association: Flax Typhoon, Lapsus$ -- Software Association:
  Rhysida'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4663) OR
  "<EventID>4663<") TERM("C:\\Windows\\System32\\config\\*") (TERM(SAM) OR TERM(SYSTEM)
  OR TERM(security))| regex Object_Name="(?i)(sam|system|security)$" | eval file_path=Object_Name|
  fields _time, host, user, signature_id, process, process_*, parent_*, signature,
  file_path, parameters `group_events("host", 1)` '
techniques:
- credential-access:os credential dumping:security account manager
technique_id:
- T1003.002
data_category:
- Windows event logs
- File monitoring
references:
- https://www.blumira.com/sam-database-vulnerability/

Stages and Predicates

Stage 1: search

search EventCode=4663 source="*" source IN ("WinEventLog:Security", "XmlWinEventLog:Security")

Stage 2: regex

regex match(Object_Name, "(?i)(sam|system|security)$")

Stage 3: eval

eval file_path = ({ uses: Object_Name })

Stage 4: fields

fields _time, file_path, host, parameters, parent_*, process, process_*, signature, signature_id, user

Stage 5: bucket

bucket _time

Stage 6: stats

stats BY host, _time

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)
Object_Nameregex_match
  • "(?i)(sam|system|security)$"

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>4663<"
1"\"
1C:\\\\Windows\\\\System32\\\\config\\\\*\""
1TERM
1SAM
1TERM
1SYSTEM
1TERM
1security