Detection rules › Elastic
Potential Decoy Document via Open
Detects when the native system binary 'open' is used to open a .doc or .pdf file in a temporary directory or via an unsigned or untrusted process. Decoy documents are often used to trick users into believing a file or executable is harmless and distract them from what the malware is doing behind the scenes.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry coverage
Rule body
[rule]
description = """
Detects when the native system binary 'open' is used to open a .doc or .pdf file in a temporary directory or via an
unsigned or untrusted process. Decoy documents are often used to trick users into believing a file or executable is
harmless and distract them from what the malware is doing behind the scenes.
"""
id = "3f2c51ce-5da8-4c9b-8a39-17677ed08eb9"
license = "Elastic License v2"
name = "Potential Decoy Document via Open"
os_list = ["macos"]
reference = [
"https://github.com/center-for-threat-informed-defense/adversary_emulation_library/tree/4a57b3dd5d28ad1bd79e927e04b20fd4d66934a0/ocean_lotus",
]
version = "1.0.9"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "open" and
process.args_count < 3 and
process.args like~ ("/tmp/*.doc*", "/tmp/*.pdf*", "/private/tmp/*.doc*", "/private/tmp/*.pdf*", "/Users/Shared/*.doc*", "/Users/Shared/*.pdf*", "/Users/*/Library/*.pdf") and
not process.args like~ "/tmp/PKInstallSandbox*" and
not process.args == "-R" and
not process.Ext.effective_parent.executable in ("/usr/bin/open", "/Applications/Cursor.app/Contents/MacOS/Cursor")
'''
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 = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"
[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 == "open" and
process.args_count < 3 and
process.args like~ ("/tmp/*.doc*", "/tmp/*.pdf*", "/private/tmp/*.doc*", "/private/tmp/*.pdf*", "/Users/Shared/*.doc*", "/Users/Shared/*.pdf*", "/Users/*/Library/*.pdf") and
not process.args like~ "/tmp/PKInstallSandbox*" and
not process.args == "-R" and
not process.Ext.effective_parent.executable in ("/usr/bin/open", "/Applications/Cursor.app/Contents/MacOS/Cursor")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | in | /Applications/Cursor.app/Contents/MacOS/Cursor, /usr/bin/open | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/Applications/Cursor.app/Contents/MacOS/Cursor" field:"process.Ext.effective_parent.executable" value:"/usr/bin/open" |
process.args | eq | -R | excludes:process.args field:"process.args" value:"-R" |
process.args | starts_with | /tmp/PKInstallSandbox | excludes:process.args field:"process.args" value:"/tmp/PKInstallSandbox" |
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.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | lt |
| field:"process.args_count" kind:lt value:"3" |
process.name | eq |
| field:"process_name" kind:eq value:"open" |