Detection rules › Elastic

OsaScript Download Cradle Spawned

Time window
15s
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Detects when a new OsaScript download cradle is spawned as a backgrounded process to launch a new callback. The Apfell agent payload utilizes this method in order to spawn additional payload callbacks.

MITRE ATT&CK coverage

TacticTechniques
Command & Control

Telemetry coverage

Rule body

[rule]
description = """
Detects when a new OsaScript download cradle is spawned as a backgrounded process to launch a new callback. The Apfell
agent payload utilizes this method in order to spawn additional payload callbacks.
"""
id = "c8e816ab-360f-4608-aebf-a056437c7df0"
license = "Elastic License v2"
name = "OsaScript Download Cradle Spawned"
os_list = ["macos"]
reference = [
    "https://github.com/MythicAgents/apfell/blob/master/documentation-payload/apfell/commands/spawn_download_cradle.md",
    "https://github.com/MythicAgents/apfell/",
]
version = "1.0.9"

query = '''
sequence by process.entity_id with maxspan=15s
[process where event.type == "start" and event.action == "exec" and 
 process.name == "osascript" and process.args == "-l" and 
 process.args like~ "JavaScript" and process.args == "-e" and
 process.parent.name == "osascript"]
[network where event.type == "start" and process.name == "osascript"]
'''

min_endpoint_version = "8.16.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 = "T1008"
name = "Fallback Channels"
reference = "https://attack.mitre.org/techniques/T1008/"


[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "8.16.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 15s, correlated by process.entity_id.

Stage 1: process

[process where event.type == "start" and event.action == "exec" and 
 process.name == "osascript" and process.args == "-l" and 
 process.args like~ "JavaScript" and process.args == "-e" and
 process.parent.name == "osascript"]

Stage 2: network

[network where event.type == "start" and process.name == "osascript"]

Indicators

These rows show field, operator, and value matches.