Detection rules › Elastic

Process Execution with Unusual File Extension

Source
github.com/elastic/protections-artifacts

Identifies the creation of a process with an unusual file extension (3 to 3 chars) and from the most commonly abused Windows processes for initial access. Attackers may attempt to evade detection by masquerading files using the file extension values used by image, logs, or document file types.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the creation of a process with an unusual file extension (3 to 3 chars) and from the most commonly abused
Windows processes for initial access. Attackers may attempt to evade detection by masquerading files using the file
extension values used by image, logs, or document file types.
"""
id = "6daf97b0-8e29-476b-998a-c3d168d98506"
license = "Elastic License v2"
name = "Process Execution with Unusual File Extension"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doing-time-with-the-yipphb-dropper"]
version = "1.0.26"

query = '''
process where event.action == "start" and

 /* 3 to 4 chars to match on common file extensions length */
 process.name regex~ """.+\.[a-z]{3,4}""" and

 /* excluding common or noisy file extensions */
  not process.name regex~ """.+\.(exe|scr|pif|com|tmp|bin|dll|sys|dat|upd|cgi|out|pro|ngn|dep|cxp|axp|srv)""" and

 /* most common parents observed in malware behavior */
  process.parent.name : ("cmd.exe", "powershell.exe", "WmiPrvSe.exe", "winword.exe", "excel.exe", "wscript.exe", "cscript.exe", "mshta.exe") and 

  process.hash.sha256 != "28ebebabf1687e5577178b386b92591062b857b8ac04784354c2d501bd69d378"
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.007"
name = "Double File Extension"
reference = "https://attack.mitre.org/techniques/T1036/007/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 process.name regex~ """.+\.[a-z]{3,4}""" and
  not process.name regex~ """.+\.(exe|scr|pif|com|tmp|bin|dll|sys|dat|upd|cgi|out|pro|ngn|dep|cxp|axp|srv)""" and
  process.parent.name : ("cmd.exe", "powershell.exe", "WmiPrvSe.exe", "winword.exe", "excel.exe", "wscript.exe", "cscript.exe", "mshta.exe") and
  process.hash.sha256 != "28ebebabf1687e5577178b386b92591062b857b8ac04784354c2d501bd69d378"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.nameregex_match.+.(exe|scr|pif|com|tmp|bin|dll|sys|dat|upd|cgi|out|pro|ngn|dep|cxp|axp|srv)excludes:process.name field:"process.name" value:".+.(exe|scr|pif|com|tmp|bin|dll|sys|dat|upd|cgi|out|pro|ngn|dep|cxp|axp|srv)"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.hash.sha256ne
  • 28ebebabf1687e5577178b386b92591062b857b8ac04784354c2d501bd69d378
field:"Hashes" kind:ne value:"28ebebabf1687e5577178b386b92591062b857b8ac04784354c2d501bd69d378"
process.nameregex_match
  • .+.[a-z]{3,4}
field:"process_name" kind:regex_match value:".+.[a-z]{3,4}"
process.parent.namewildcard
  • WmiPrvSe.exe corpus 25 (elastic 19, splunk 5, kusto 1)
  • cmd.exe corpus 36 (elastic 31, splunk 4, kusto 1)
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • excel.exe corpus 28 (elastic 27, splunk 1)
  • mshta.exe corpus 24 (elastic 22, splunk 2)
  • powershell.exe corpus 39 (elastic 36, kusto 2, splunk 1)
  • winword.exe corpus 26 (elastic 26)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_name" kind:wildcard