Detection rules › Elastic

Suspicious Vault Files Access via RPC

Sequence by
Effective_process.entity_id, process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies when an unusual process attempt to access the Windows Credential Vault files using RPC via the VaultSvc. Adversaries may acquire credentials from Vault files.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies when an unusual process attempt to access the Windows Credential Vault files using RPC via the VaultSvc.
Adversaries may acquire credentials from Vault files.
"""
id = "e868a43a-9004-4aa0-951c-2d63252ac3d8"
license = "Elastic License v2"
name = "Suspicious Vault Files Access via RPC"
os_list = ["windows"]
reference = [
    "https://docs.microsoft.com/en-us/uwp/api/windows.security.credentials.passwordvault.retrieve?view=winrt-22000",
]
version = "1.0.17"

query = '''
sequence
 [process where event.action == "start" and
  not process.Ext.token.integrity_level_name == "system" and
  (
   ((process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
    (process.code_signature.trusted == false or process.code_signature.exists == false)) or

    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk", "USB*") and not process.executable : "C:\\*") or

    (process.executable : ("?:\\Users\\Public\\*", "?:\\Windows\\Tasks\\*",
                           "?:\\ProgramData\\*", "?:\\Users\\*\\AppData\\*",
                           "?:\\Users\\*\\Downloads\\*", "?:\\Users\\*\\Desktop\\",
                           "?:\\Windows\\Temp\\*") and
    (process.code_signature.trusted == false or process.code_signature.exists == false)) or

    process.name : ("rundll32.exe", "regsvr32.exe", "powershell.exe", "wscript.exe", "cscript.exe") or

    process.executable : "?:\\Windows\\Microsoft.NET\\*.exe" or

    (process.executable regex~ """(c:\\windows\\system32\\[a-z0-9\-\_\.]+\.exe|c:\\windows\\syswow64\\[a-z0-9\-\_\.]+\.exe|c:\\windows\\[a-z0-9\-\_\.]+\.exe)""" and
     process.args_count <= 1) or

    process.parent.name : ("cmd.exe", "powershell.exe")
  ) and 
  not (process.executable : "?:\\Windows\\Explorer.exe" and
       process.parent.executable : ("?:\\Windows\\System32\\userinit.exe", "?:\\Windows\\System32\\winlogon.exe")) and
  not (process.name : "rundll32.exe" and
       process.args : ("?:\\WINDOWS\\sys*\\inetcpl.cpl,ClearMyTracksByProcess", "InetCpl.cpl,ClearMyTracksByProcess")) and
  not process.hash.sha256 : ("57fb008faeb05dd34fc1c224ce456b38ced950243fbac7f7cb348df68f990ebe", "56f291895ecc3f8ae647428f68d2e9de7fc81074a876dbfb24f9276c759e0675")
  ] by process.entity_id
 [file where event.action == "open" and process.name : "lsass.exe" and
  file.path : "?:\\Users\\*\\AppData\\Local\\Microsoft\\Vault\\?*" and user.id : ("S-1-5-21*", "S-1-12-*") and
  Effective_process.name != null and not file.name : "desktop.ini"] by Effective_process.entity_id
  until [process where event.action:"end"] by process.entity_id
'''

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

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[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

Ordered sequence: each step below must occur in order, correlated by Effective_process.entity_id, process.entity_id.

Stage 1: process

[process where event.action == "start" and
  not process.Ext.token.integrity_level_name == "system" and
  (
   ((process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
    (process.code_signature.trusted == false or process.code_signature.exists == false)) or

    (process.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk", "USB*") and not process.executable : "C:\\*") or

    (process.executable : ("?:\\Users\\Public\\*", "?:\\Windows\\Tasks\\*",
                           "?:\\ProgramData\\*", "?:\\Users\\*\\AppData\\*",
                           "?:\\Users\\*\\Downloads\\*", "?:\\Users\\*\\Desktop\\",
                           "?:\\Windows\\Temp\\*") and
    (process.code_signature.trusted == false or process.code_signature.exists == false)) or

    process.name : ("rundll32.exe", "regsvr32.exe", "powershell.exe", "wscript.exe", "cscript.exe") or

    process.executable : "?:\\Windows\\Microsoft.NET\\*.exe" or

    (process.executable regex~ """(c:\\windows\\system32\\[a-z0-9\-\_\.]+\.exe|c:\\windows\\syswow64\\[a-z0-9\-\_\.]+\.exe|c:\\windows\\[a-z0-9\-\_\.]+\.exe)""" and
     process.args_count <= 1) or

    process.parent.name : ("cmd.exe", "powershell.exe")
  ) and 
  not (process.executable : "?:\\Windows\\Explorer.exe" and
       process.parent.executable : ("?:\\Windows\\System32\\userinit.exe", "?:\\Windows\\System32\\winlogon.exe")) and
  not (process.name : "rundll32.exe" and
       process.args : ("?:\\WINDOWS\\sys*\\inetcpl.cpl,ClearMyTracksByProcess", "InetCpl.cpl,ClearMyTracksByProcess")) and
  not process.hash.sha256 : ("57fb008faeb05dd34fc1c224ce456b38ced950243fbac7f7cb348df68f990ebe", "56f291895ecc3f8ae647428f68d2e9de7fc81074a876dbfb24f9276c759e0675")
  ] by process.entity_id

Stage 2: file

[file where event.action == "open" and process.name : "lsass.exe" and
  file.path : "?:\\Users\\*\\AppData\\Local\\Microsoft\\Vault\\?*" and user.id : ("S-1-5-21*", "S-1-12-*") and
  Effective_process.name != null and not file.name : "desktop.ini"] by Effective_process.entity_id

Until: process

until [process where event.action:"end"] by process.entity_id

Ends the sequence: the steps above must complete before an event matching this clause occurs.

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Effective_process.nameis_not_null
  • (no value, null check)
field:"Effective_process.name" kind:is_not_null
event.actioneq
  • open corpus 52 (elastic 51, sigma 1)
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq
event.actionwildcard
  • end corpus 18 (elastic 18)
field:"EventType" kind:wildcard value:"end"
file.pathwildcard
  • ?:\Users\*\AppData\Local\Microsoft\Vault\?*
field:"TargetFilename" kind:wildcard value:"?:\Users\*\AppData\Local\Microsoft\Vault\?*"
process.Ext.device.product_idwildcard
  • USB*
  • Virtual DVD-ROM corpus 13 (elastic 13)
  • Virtual Disk corpus 13 (elastic 13)
field:"process.Ext.device.product_id" kind:wildcard
process.Ext.relative_file_creation_timele
  • 500 transforms: number corpus 28 (elastic 28)
field:"process.Ext.relative_file_creation_time" kind:le value:"500"
process.Ext.relative_file_name_modify_timele
  • 500 transforms: number corpus 21 (elastic 21)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"500"
process.args_countle
  • 1 transforms: number corpus 5 (elastic 5)
field:"process.args_count" kind:le value:"1"
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.executableregex_match
  • (c:\windows\system32\[a-z0-9\-\_.]+.exe|c:\windows\syswow64\[a-z0-9\-\_.]+.exe|c:\windows\[a-z0-9\-\_.]+.exe) corpus 2 (elastic 2)
field:"Image" kind:regex_match value:"(c:\windows\system32\[a-z0-9\-\_.]+.exe|c:\windows\syswow64\[a-z0-9\-\_.]+.exe|c:\windows\[a-z0-9\-\_.]+.exe)"
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Users\*\AppData\* corpus 12 (elastic 12)
  • ?:\Users\*\Desktop\
  • ?:\Users\*\Downloads\* corpus 12 (elastic 12)
  • ?:\Users\Public\* corpus 4 (elastic 4)
  • ?:\Windows\Microsoft.NET\*.exe corpus 8 (elastic 8)
  • ?:\Windows\Tasks\* corpus 7 (elastic 7)
  • ?:\Windows\Temp\* corpus 9 (elastic 9)
field:"Image" kind:wildcard
process.namewildcard
  • cscript.exe corpus 67 (elastic 65, splunk 2)
  • lsass.exe corpus 9 (elastic 9)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:wildcard
process.parent.namewildcard
  • cmd.exe corpus 36 (elastic 31, splunk 4, kusto 1)
  • powershell.exe corpus 39 (elastic 36, kusto 2, splunk 1)
field:"parent_process_name" kind:wildcard
user.idwildcard
  • S-1-12-* corpus 46 (elastic 46)
  • S-1-5-21* corpus 47 (elastic 47)
field:"user.id" kind:wildcard