Detection rules › Elastic
Suspicious Executable Copied from Volume Mount
Detects when an executable file is copied from a hidden directory on a volume mounted disk to the applications directory. Geacon samples have been observed utilizing this technique as a method for setting up persistence with the second stage payload prior to establishing persistence via the .zshrc file.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry coverage
Rule body
[rule]
description = """
Detects when an executable file is copied from a hidden directory on a volume mounted disk to the applications
directory. Geacon samples have been observed utilizing this technique as a method for setting up persistence with the
second stage payload prior to establishing persistence via the .zshrc file.
"""
id = "0facb446-7d95-4b27-bd40-490bbec5a95b"
license = "Elastic License v2"
name = "Suspicious Executable Copied from Volume Mount"
os_list = ["macos"]
reference = ["https://github.com/darkr4y/geacon"]
version = "1.0.6"
query = '''
sequence by process.entity_id with maxspan=3s
[process where event.type == "start" and event.action == "exec" and process.name == "cp" and
process.args_count == 3 and process.args in ("cp", "/bin/cp", "/usr/bin/cp") and
process.args like~ "/Volumes/*/.*" and process.args like "/Applications/*"] as event0
[file where event.action == "modification" and process.name == "cp" and file.path like "/Applications/*" and
file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*") and
stringcontains~(event0.process.command_line, file.name)]
'''
min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.entity_id"
state = 1
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"
[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 3s, correlated by process.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and process.name == "cp" and
process.args_count == 3 and process.args in ("cp", "/bin/cp", "/usr/bin/cp") and
process.args like~ "/Volumes/*/.*" and process.args like "/Applications/*"] as event0
Stage 2: file
[file where event.action == "modification" and process.name == "cp" and file.path like "/Applications/*" and
file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*") and
stringcontains~(event0.process.command_line, file.name)]
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" |
event0.process.command_line | contains |
| field:"event0.process.command_line" kind:contains value:"file.name" |
file.Ext.header_bytes | wildcard |
| field:"file.Ext.header_bytes" kind:wildcard |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"/Applications/*" |
process.args | in |
| field:"process.args" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"3" |
process.name | eq |
| field:"process_name" kind:eq value:"cp" |