Detection rules › Elastic

Sensitive File Access by an Unsigned Process

Source
github.com/elastic/protections-artifacts

Identifies an unsigned process accessing sensitive files. Adversaries may attempt to discover and acquire credentials from system files.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies an unsigned process accessing sensitive files. Adversaries may attempt to discover and acquire credentials
from system files.
"""
id = "a05ce4c0-ce89-47ab-9ca0-ecf2b3a9e5a4"
license = "Elastic License v2"
name = "Sensitive File Access by an Unsigned Process"
os_list = ["windows"]
reference = ["http://www.harmj0y.net/blog/redteaming/operational-guidance-for-offensive-user-dpapi-abuse/"]
version = "1.0.3"

query = '''
file where event.action == "open" and
 file.path : ("C:\\USERS\\*\\APPDATA\\*\\MICROSOFT\\PROTECT\\S-1-5-21*",
              "C:\\USERS\\*\\APPDATA\\*\\MICROSOFT\\PROTECT\\S-1-12-1*",
              "C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Microsoft\\Vault\\*-*",
              "C:\\Windows\\SysWOW64\\LogFiles\\SAM",
              "C:\\Windows\\System32\\config\\RegBack\\SAM",
              "C:\\Windows\\System32\\config\\RegBack\\SECURITY",
              "C:\\Windows\\System32\\config\\RegBack\\SYSTEM") and
 process.executable : ("C:\\*", "\\Device\\Mup\\*") and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not file.name : ("desktop.ini", ".ignore", ".rgignore", "exclude", ".gitignore", ".fdignore") and
 not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
 not (process.name : "loki.exe" and file.extension : "vsch") and
 not (file.path : "C:\\Windows\\System32\\config\\RegBack\\SAM" and
      process.executable : ("C:\\ProgramData\\Guardicore\\utils\\osqueryd.exe", "C:\\ProgramData\\Guardicore\\utils\\gc-insight.exe"))
'''

min_endpoint_version = "8.4.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[threat.technique.subtechnique]]
id = "T1003.002"
name = "Security Account Manager"
reference = "https://attack.mitre.org/techniques/T1003/002/"


[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.004"
name = "Windows Credential Manager"
reference = "https://attack.mitre.org/techniques/T1555/004/"



[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: file

file where event.action == "open" and
 file.path : ("C:\\USERS\\*\\APPDATA\\*\\MICROSOFT\\PROTECT\\S-1-5-21*",
              "C:\\USERS\\*\\APPDATA\\*\\MICROSOFT\\PROTECT\\S-1-12-1*",
              "C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Microsoft\\Vault\\*-*",
              "C:\\Windows\\SysWOW64\\LogFiles\\SAM",
              "C:\\Windows\\System32\\config\\RegBack\\SAM",
              "C:\\Windows\\System32\\config\\RegBack\\SECURITY",
              "C:\\Windows\\System32\\config\\RegBack\\SYSTEM") and
 process.executable : ("C:\\*", "\\Device\\Mup\\*") and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not file.name : ("desktop.ini", ".ignore", ".rgignore", "exclude", ".gitignore", ".fdignore") and
 not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
 not (process.name : "loki.exe" and file.extension : "vsch") and
 not (file.path : "C:\\Windows\\System32\\config\\RegBack\\SAM" and
      process.executable : ("C:\\ProgramData\\Guardicore\\utils\\osqueryd.exe", "C:\\ProgramData\\Guardicore\\utils\\gc-insight.exe"))

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.extensioneqvschexcludes:file.extension field:"file.extension" value:"vsch"
process.nameeqloki.exeexcludes:process.name field:"process.name" value:"loki.exe"
file.patheqC:\Windows\System32\config\RegBack\SAMexcludes:file.path field:"file.path" value:"C:\Windows\System32\config\RegBack\SAM"
process.executableeqC:\ProgramData\Guardicore\utils\osqueryd.exe, C:\ProgramData\Guardicore\utils\gc-insight.exeexcludes:process.executable field:"process.executable" value:"C:\ProgramData\Guardicore\utils\osqueryd.exe" field:"process.executable" value:"C:\ProgramData\Guardicore\utils\gc-insight.exe"
file.nameeqdesktop.ini, .ignore, .rgignore, exclude, .gitignore, .fdignoreexcludes:file.name
process.executablestarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:process.executable field:"process.executable" value:"?:\Program Files\" field:"process.executable" value:"?:\Program Files (x86)\"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • open corpus 52 (elastic 51, sigma 1)
field:"EventType" kind:eq value:"open"
file.pathwildcard
  • C:\USERS\*\APPDATA\*\MICROSOFT\PROTECT\S-1-12-1*
  • C:\USERS\*\APPDATA\*\MICROSOFT\PROTECT\S-1-5-21*
  • C:\Windows\SysWOW64\LogFiles\SAM
  • C:\Windows\System32\config\RegBack\SAM
  • C:\Windows\System32\config\RegBack\SECURITY
  • C:\Windows\System32\config\RegBack\SYSTEM
  • C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Vault\*-*
field:"TargetFilename" kind:wildcard
process.code_signature.existseq
  • false transforms: boolean corpus 119 (elastic 119)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 115 (elastic 115)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • C:\* corpus 16 (elastic 16)
  • \Device\Mup\* corpus 8 (elastic 8)
field:"Image" kind:wildcard