Detection rules › Elastic

Potential Decoy Document via Open

Source
github.com/elastic/protections-artifacts

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

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.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argswildcard
  • /Users/*/Library/*.pdf
  • /Users/Shared/*.doc*
  • /Users/Shared/*.pdf*
  • /private/tmp/*.doc*
  • /private/tmp/*.pdf*
  • /tmp/*.doc*
  • /tmp/*.pdf*
field:"process.args" kind:wildcard
process.args_countlt
  • 3 transforms: number
field:"process.args_count" kind:lt value:"3"
process.nameeq
  • open
field:"process_name" kind:eq value:"open"