Detection rules › Elastic
Unusual Bundle Execution via Shell
Detects when a bundle identifier binary, denoted by the com. syntax, is executed via a shell interpreter where the effective parent process is the path of the bundle identifier itself.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry coverage
Rule body
[rule]
description = """
Detects when a bundle identifier binary, denoted by the com. syntax, is executed via a shell interpreter where the
effective parent process is the path of the bundle identifier itself.
"""
id = "b2c0f8bb-890b-4938-9427-fc66650451b3"
license = "Elastic License v2"
name = "Unusual Bundle Execution via Shell"
os_list = ["macos"]
reference = [
"https://github.com/center-for-threat-informed-defense/adversary_emulation_library/tree/4a57b3dd5d28ad1bd79e927e04b20fd4d66934a0/ocean_lotus",
]
version = "1.0.3"
query = '''
process where event.type == "start" and event.action == "exec" and process.name like "com.*" and
process.executable like ("/Users/*", "/Volumes/*", "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/var/root/*") and process.parent.name in ("bash", "zsh", "sh") and
startswith~(process.executable, process.Ext.effective_parent.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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name like "com.*" and
process.executable like ("/Users/*", "/Volumes/*", "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/var/root/*") and process.parent.name in ("bash", "zsh", "sh") and
startswith~(process.executable, process.Ext.effective_parent.executable)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.executable | starts_with |
| field:"Image" kind:starts_with value:"process.Ext.effective_parent.executable" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | wildcard |
| field:"process_name" kind:wildcard value:"com.*" |
process.parent.name | in |
| field:"parent_process_name" kind:in |