Curl Download and OsaScript Payload Execution via Node


Description

Detects when curl or nscurl is executed as an argument of a shell interpreter via a node parent process. This is a common technique used by malware to download additional payloads and evade traditional defenses.

Query · eql

sequence with maxspan=30s
[process where event.type == "start" and process.parent.name == "node" and
 (
  (process.name like~ ("sh", "bash", "zsh", "tclsh*") and
    process.args == "-c" and
    process.args like~ ("curl*", "nscurl*")) or 
  (process.name in ("curl", "nscurl"))
 )] by process.entity_id
[process where event.type == "start" and event.action == "exec" and process.name == "osascript"] by process.parent.entity_id
Raw source Curl Download and OsaScript Payload Execution via Node · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Detects when curl or nscurl is executed as an argument of a shell interpreter via a node parent process. This is a
common technique used by malware to download additional payloads and evade traditional defenses.
"""
id = "1ef77794-f718-4bc0-a846-971c45aa00e7"
license = "Elastic License v2"
name = "Curl Download and OsaScript Payload Execution via Node"
os_list = ["macos"]
reference = ["https://medium.com/@D00MFist/loads-of-fun-e1f0dac3d4f8"]
version = "1.0.11"

query = '''
sequence with maxspan=30s
[process where event.type == "start" and process.parent.name == "node" and
 (
  (process.name like~ ("sh", "bash", "zsh", "tclsh*") and
    process.args == "-c" and
    process.args like~ ("curl*", "nscurl*")) or 
  (process.name in ("curl", "nscurl"))
 )] by process.entity_id
[process where event.type == "start" and event.action == "exec" and process.name == "osascript"] by process.parent.entity_id
'''

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 = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"


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

[internal]
min_endpoint_version = "8.7.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.