Detection rules › Elastic
JavaScript Execution via Deno on Linux
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
| Tactic | Techniques |
|---|---|
| Execution |
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.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.command_line | eq | deno run --allow-all --quiet --no-config https://deno.land/x/wmill/main.ts completions zsh | excludes: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.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | eq |
| field:"process_name" kind:eq value:"deno" |