Detection rules › Elastic

Suspicious Unsigned Application Execution via Shell

Source
github.com/elastic/protections-artifacts

Detects when an unsigned binary is executed within the Applications directory via a shell with no command line arguments. Recent Geacon samples have been observed executing second stage payloads in this way via the .zshrc persistence mechanism.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

[rule]
description = """
Detects when an unsigned binary is executed within the Applications directory via a shell with no command line
arguments. Recent Geacon samples have been observed executing second stage payloads in this way via the .zshrc
persistence mechanism.
"""
id = "e9aa04eb-7d71-4c6e-aa86-f1f7c3003b67"
license = "Elastic License v2"
name = "Suspicious Unsigned Application Execution via Shell"
os_list = ["macos"]
version = "1.0.5"

query = '''
process where event.type == "start" and event.action == "exec" and 
 process.executable like "/Applications/*" and process.code_signature.exists == false and 
 process.args like "/Applications/*" and process.args_count == 1 and 
 process.parent.name in ("bash", "zsh", "sh") and process.parent.args_count == 0 and
 not process.args like~ "/Applications/*.app/*" and
 not process.executable == "/Applications/phits/bin/phits334_mac.exe"
'''

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.executable like "/Applications/*" and process.code_signature.exists == false and 
 process.args like "/Applications/*" and process.args_count == 1 and 
 process.parent.name in ("bash", "zsh", "sh") and process.parent.args_count == 0 and
 not process.args like~ "/Applications/*.app/*" and
 not process.executable == "/Applications/phits/bin/phits334_mac.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard/Applications/*.app/*excludes:process.args field:"process.args" value:"/Applications/*.app/*"
process.executableeq/Applications/phits/bin/phits334_mac.exeexcludes:process.executable field:"process.executable" value:"/Applications/phits/bin/phits334_mac.exe"

Indicators

These rows show field, operator, and value matches.