Skip to content

Commit 5422265

Browse files
committed
[Rule Tuning] File Transfer or Listener Established via Netcat
1 parent 871cfb6 commit 5422265

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

rules/linux/execution_file_transfer_or_listener_established_via_netcat.toml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/02/18"
33
integration = ["endpoint", "sentinel_one_cloud_funnel"]
44
maturity = "production"
5-
updated_date = "2025/03/20"
5+
updated_date = "2025/10/15"
66

77
[rule]
88
author = ["Elastic"]
@@ -20,7 +20,6 @@ false_positives = [
2020
]
2121
from = "now-9m"
2222
index = [
23-
"auditbeat-*",
2423
"logs-endpoint.events.network*",
2524
"logs-endpoint.events.process*",
2625
"logs-sentinel_one_cloud_funnel.*",
@@ -124,15 +123,12 @@ tags = [
124123
"Data Source: SentinelOne",
125124
]
126125
type = "eql"
127-
128126
query = '''
129-
sequence by process.entity_id
130-
[process where host.os.type == "linux" and event.type == "start" and
131-
process.name:("nc","ncat","netcat","netcat.openbsd","netcat.traditional") and (
132-
/* bind shell to echo for command execution */
133-
(process.args:("-l","-p") and process.args:("-c","echo","$*"))
134-
/* bind shell to specific port */
135-
or process.args:("-l","-p","-lp")
127+
sequence by process.entity_id with maxspan=1m
128+
[process where host.os.type == "linux" and event.type == "start"
129+
process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional") and (
130+
/* bind shell to specific port or listener */
131+
or process.args:("-*l*","-*p*")
136132
/* reverse shell to command-line interpreter used for command execution */
137133
or (process.args:("-e") and process.args:("/bin/bash","/bin/sh"))
138134
/* file transfer via stdout */
@@ -141,26 +137,23 @@ sequence by process.entity_id
141137
or (process.args:("|") and process.args:("nc","ncat"))
142138
) and
143139
not process.command_line like~ ("*127.0.0.1*", "*localhost*")]
144-
[network where host.os.type == "linux" and (process.name == "nc" or process.name == "ncat" or process.name == "netcat" or
145-
process.name == "netcat.openbsd" or process.name == "netcat.traditional")]
140+
[network where host.os.type == "linux" and process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional")]
146141
'''
147142

148-
149143
[[rule.threat]]
150144
framework = "MITRE ATT&CK"
145+
151146
[[rule.threat.technique]]
152147
id = "T1059"
153148
name = "Command and Scripting Interpreter"
154149
reference = "https://attack.mitre.org/techniques/T1059/"
150+
155151
[[rule.threat.technique.subtechnique]]
156152
id = "T1059.004"
157153
name = "Unix Shell"
158154
reference = "https://attack.mitre.org/techniques/T1059/004/"
159155

160-
161-
162156
[rule.threat.tactic]
163157
id = "TA0002"
164158
name = "Execution"
165159
reference = "https://attack.mitre.org/tactics/TA0002/"
166-

0 commit comments

Comments
 (0)