Detection rules › Elastic

JavaScript Execution via Deno on Linux

Source
github.com/elastic/protections-artifacts

Identifies attempts to execute JavaScript using Deno with suspicious command line value. Adversaries may abuse this utility to execute malicious JavaScript.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies attempts to execute JavaScript using Deno with suspicious command line value. Adversaries may abuse this
utility to execute malicious JavaScript.
"""
id = "9c78eda8-68e7-49a8-87d2-5364381ba624"
license = "Elastic License v2"
name = "JavaScript Execution via Deno on Linux"
os_list = ["linux"]
reference = ["https://deno.com/"]
version = "1.0.0"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "deno" and
process.command_line like~ ("*base64*", "*eval(*", "*http*", "*javascript*import*") and
not process.command_line == "deno run --allow-all --quiet --no-config https://deno.land/x/wmill/main.ts completions zsh"
'''

min_endpoint_version = "7.15.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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.name == "deno" and
process.command_line like~ ("*base64*", "*eval(*", "*http*", "*javascript*import*") and
not process.command_line == "deno run --allow-all --quiet --no-config https://deno.land/x/wmill/main.ts completions zsh"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_lineeqdeno run --allow-all --quiet --no-config https://deno.land/x/wmill/main.ts completions zshexcludes:process.command_line field:"process.command_line" value:"deno run --allow-all --quiet --no-config https://deno.land/x/wmill/main.ts completions zsh"

Indicators

These rows show field, operator, and value matches.