Detection rules › Elastic

Execution of a downloaded executable with low or unknown reputation

Time window
5m
Source
github.com/elastic/protections-artifacts

Identifies Windows executable files that have been recently downloaded and have an unknown or malicious reputation. Attackers may rely upon a user downloading and opening a file in order for their malicious code to execute and gain initial access to an endpoint. Users may be subjected to social engineering to get them to open a file that will lead to code execution.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies Windows executable files that have been recently downloaded and have an unknown or malicious reputation.
Attackers may rely upon a user downloading and opening a file in order for their malicious code to execute and gain
initial access to an endpoint. Users may be subjected to social engineering to get them to open a file that will lead to
code execution.
"""
id = "90912b6c-fc36-4e13-83c2-469e6b60e915"
license = "Elastic License v2"
name = "Execution of a downloaded executable with low or unknown reputation"
os_list = ["windows"]
version = "1.0.3"

query = '''
sequence with maxspan=5m
 [file where event.action == "creation" and file.Ext.windows.zone_identifier >= 3 and
  file.origin_url regex~ """https?:[\/\\]{2}[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}[\/\\]{1}.*"""] as event0
 [process where event.action == "start" and
  (process.code_signature.trusted == false or process.code_signature.exists == false) and
  not process.code_signature.status like "errorCode_endpoint*" and startswith~(event0.file.name, process.name)]
'''

min_endpoint_version = "8.15.0"
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "8.15.0"

Stages and Predicates

Stage 1: file

[file where event.action == "creation" and file.Ext.windows.zone_identifier >= 3 and
  file.origin_url regex~ """https?:[\/\\]{2}[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}[\/\\]{1}.*"""] as event0

Stage 2: process

[process where event.action == "start" and
  (process.code_signature.trusted == false or process.code_signature.exists == false) and
  not process.code_signature.status like "errorCode_endpoint*" and startswith~(event0.file.name, process.name)]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.statusstarts_witherrorCode_endpointexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorCode_endpoint"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • creation corpus 58 (elastic 58)
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq
event0.file.namestarts_with
  • process.name (field reference) corpus 2 (elastic 2)
field:"event0.file.name" kind:starts_with value:"process.name"
file.Ext.windows.zone_identifierge
  • 3 transforms: number
field:"file.Ext.windows.zone_identifier" kind:ge value:"3"
file.origin_urlregex_match
  • https?:[\/\]{2}[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}[\/\]{1}.*
field:"file.origin_url" kind:regex_match value:"https?:[\/\]{2}[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}[\/\]{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"