Unsigned or Untrusted Process Execution and Immediate Self-Deletion


Description

Detects when a process executes and then immediately deletes itself (the file on disk). Removal of these files can occur during an intrusion, or as part of a post-intrusion process to minimize the adversary's footprint.

Query · eql

sequence by process.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and 
  process.executable like ("/Applications/*", "/Volumes/*", "/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/Users/*/Public/*") and
  (process.code_signature.trusted == false or process.code_signature.exists == false)]
[file where event.action == "deletion" and startswith~(file.path,process.executable)]
Raw source Unsigned or Untrusted Process Execution and Immediate Self-Deletion · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Detects when a process executes and then immediately deletes itself (the file on disk). Removal of these files can occur
during an intrusion, or as part of a post-intrusion process to minimize the adversary's footprint.
"""
id = "43d525a1-fe8a-4b24-b973-8e708fabaf4c"
license = "Elastic License v2"
name = "Unsigned or Untrusted Process Execution and Immediate Self-Deletion"
os_list = ["macos"]
reference = ["https://attack.mitre.org/techniques/T1070/004/"]
version = "1.0.22"

query = '''
sequence by process.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and 
  process.executable like ("/Applications/*", "/Volumes/*", "/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/Users/*/Public/*") and
  (process.code_signature.trusted == false or process.code_signature.exists == false)]
[file where event.action == "deletion" and startswith~(file.path,process.executable)]
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[threat.technique.subtechnique]]
id = "T1070.004"
name = "File Deletion"
reference = "https://attack.mitre.org/techniques/T1070/004/"



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

[internal]
min_endpoint_version = "8.11.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.