Detection rules › Elastic

Potential Execution via ZIPExec

Time window
5m
Sequence by
process.entity_id, process.parent.entity_id
Source
github.com/elastic/protections-artifacts

Identifies the execution of file dropped via a compressed file (potentially password protected). This may indicate an attempt to bypass disk-based or anti-malware scanning mechanisms.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of file dropped via a compressed file (potentially password protected). This may indicate an
attempt to bypass disk-based or anti-malware scanning mechanisms.
"""
id = "8eb74917-9363-4073-a09b-c47101f52c40"
license = "Elastic License v2"
name = "Potential Execution via ZIPExec"
os_list = ["windows"]
reference = ["https://github.com/Tylous/ZipExec"]
version = "1.0.28"

query = '''
sequence with maxspan=5m

  /* cmdkey invoking Windows Shell to open a compressed file */
 [process where event.action == "start" and
   process.pe.original_file_name : "cmdkey.exe" and
   process.command_line : "*Microsoft_Windows_Shell*Folder*filename*"] by process.parent.entity_id

 /* executable file creation by parent of cmdkey*/
 [file where event.action == "creation" and file.Ext.header_bytes : "4d5a*"] by process.entity_id

 /* execution from Explorer temp decompression directory by parent of cmdkey */
 [process where event.action == "start" and process.command_line : "*\\Temp\\Temp?_*"] by process.parent.entity_id
'''

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

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 2

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"

[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by process.entity_id, process.parent.entity_id.

Stage 1: process

[process where event.action == "start" and
   process.pe.original_file_name : "cmdkey.exe" and
   process.command_line : "*Microsoft_Windows_Shell*Folder*filename*"] by process.parent.entity_id

Stage 2: file

[file where event.action == "creation" and file.Ext.header_bytes : "4d5a*"] by process.entity_id

Stage 3: process

[process where event.action == "start" and process.command_line : "*\\Temp\\Temp?_*"] by process.parent.entity_id

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
file.Ext.header_byteswildcard
  • 4d5a* corpus 46 (elastic 46)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
process.command_linewildcard
  • *Microsoft_Windows_Shell*Folder*filename*
  • *\Temp\Temp?_*
field:"CommandLine" kind:wildcard
process.pe.original_file_namewildcard
  • cmdkey.exe corpus 6 (splunk 3, sigma 2, elastic 1)
field:"OriginalFileName" kind:wildcard value:"cmdkey.exe"