Detection rules › Elastic
Bind Shell via Node
Detects the creation of a bind shell via Node. Attackers may spawn bind shells to establish persistence onto a target system.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule body
[rule]
description = """
Detects the creation of a bind shell via Node. Attackers may spawn bind shells to establish persistence onto a target
system.
"""
id = "08697d36-4c07-4f54-b177-a39e473705c0"
license = "Elastic License v2"
name = "Bind Shell via Node"
os_list = ["linux"]
reference = ["https://gtfobins.github.io/gtfobins/node/"]
version = "1.0.4"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "node" and
process.args == "-e" and process.command_line : "*spawn*sh*" and process.command_line : "*listen*" and
not process.parent.executable like "/home/*/.local/zed.app/libexec/zed-editor"
'''
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.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[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 == "node" and
process.args == "-e" and process.command_line : "*spawn*sh*" and process.command_line : "*listen*" and
not process.parent.executable like "/home/*/.local/zed.app/libexec/zed-editor"
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | wildcard | /home/*/.local/zed.app/libexec/zed-editor | excludes:process.parent.executable field:"process.parent.executable" value:"/home/*/.local/zed.app/libexec/zed-editor" |
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.args | eq |
| field:"process.args" kind:eq value:"-e" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | eq |
| field:"process_name" kind:eq value:"node" |