Detection rules › Elastic

Terminal Window Hidden or Closed via Osascript

Source
github.com/elastic/protections-artifacts

Detects the use of Osascript to hide or close a Terminal window from the user. The AMOS stealer has utilized this technique in order to hide its execution from on the system.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

[rule]
description = """
Detects the use of Osascript to hide or close a Terminal window from the user. The AMOS stealer has utilized this
technique in order to hide its execution from on the system.
"""
id = "c109fbb8-ef78-49a5-90b2-1c9ee3b10b09"
license = "Elastic License v2"
name = "Terminal Window Hidden or Closed via Osascript"
os_list = ["macos"]
reference = ["https://medium.com/@dineshdevadoss04/breaking-down-atomic-macos-stealer-amos-8cd5eea56024"]
version = "1.0.5"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "osascript" and
 process.args == "-e" and
 (process.command_line like~ "*Terminal* visible*window*false*" or process.command_line like~ "*Terminal* to*close*first*window*")
'''

min_endpoint_version = "8.7.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 = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"
[[threat.technique.subtechnique]]
id = "T1564.003"
name = "Hidden Window"
reference = "https://attack.mitre.org/techniques/T1564/003/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.name == "osascript" and
 process.args == "-e" and
 (process.command_line like~ "*Terminal* visible*window*false*" or process.command_line like~ "*Terminal* to*close*first*window*")

Indicators

These rows show field, operator, and value matches.