Detection rules › Elastic
Unsigned or Untrusted Process Execution and Immediate Self-Deletion
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.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry coverage
Rule body
[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"
Stages and Predicates
Ordered sequence: each step below must occur in order within 15s, correlated by process.entity_id.
Stage 1: process
[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)]
Stage 2: file
[file where event.action == "deletion" and startswith~(file.path,process.executable)]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
file.path | starts_with |
| field:"TargetFilename" kind:starts_with value:"process.executable" |
process.code_signature.exists | eq |
| field:"process.code_signature.exists" kind:eq value:"false" |
process.code_signature.trusted | eq |
| field:"process.code_signature.trusted" kind:eq value:"false" |
process.executable | wildcard |
| field:"Image" kind:wildcard |