Skip to content

Commit 57facdd

Browse files
[Rule Tuning] File Transfer or Listener Established via Netcat (#5223)
* [Rule Tuning] File Transfer or Listener Established via Netcat * Formatting * Update execution_file_transfer_or_listener_established_via_netcat.toml * Update execution_file_transfer_or_listener_established_via_netcat.toml * Add timestamp override to netcat execution rule --------- Co-authored-by: Eric Forte <119343520+eric-forte-elastic@users.noreply.github.com>
1 parent 37e18af commit 57facdd

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

rules/linux/execution_file_transfer_or_listener_established_via_netcat.toml

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[metadata]
22
creation_date = "2020/02/18"
3-
integration = ["endpoint", "sentinel_one_cloud_funnel"]
3+
integration = ["endpoint", "auditd_manager", "crowdstrike", "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"]
@@ -21,7 +21,9 @@ false_positives = [
2121
from = "now-9m"
2222
index = [
2323
"auditbeat-*",
24-
"logs-endpoint.events.network*",
24+
"endgame-*",
25+
"logs-auditd_manager.auditd-*",
26+
"logs-crowdstrike.fdr*",
2527
"logs-endpoint.events.process*",
2628
"logs-sentinel_one_cloud_funnel.*",
2729
]
@@ -121,46 +123,41 @@ tags = [
121123
"Tactic: Execution",
122124
"Resources: Investigation Guide",
123125
"Data Source: Elastic Defend",
126+
"Data Source: Elastic Endgame",
127+
"Data Source: Auditd Manager",
128+
"Data Source: Crowdstrike",
124129
"Data Source: SentinelOne",
125130
]
131+
timestamp_override = "event.ingested"
126132
type = "eql"
127-
128133
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")
136-
/* reverse shell to command-line interpreter used for command execution */
137-
or (process.args:("-e") and process.args:("/bin/bash","/bin/sh"))
138-
/* file transfer via stdout */
139-
or process.args:(">","<")
140-
/* file transfer via pipe */
141-
or (process.args:("|") and process.args:("nc","ncat"))
142-
) and
143-
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")]
134+
process where host.os.type == "linux" and event.type == "start" and
135+
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
136+
process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional") and
137+
process.args like~ (
138+
/* bind shell to specific port or listener */
139+
"-*l*","-*p*",
140+
/* reverse shell to command-line interpreter used for command execution */
141+
"-*e*",
142+
/* file transfer via stdout/pipe */
143+
">","<", "|"
144+
)
146145
'''
147146

148-
149147
[[rule.threat]]
150148
framework = "MITRE ATT&CK"
149+
151150
[[rule.threat.technique]]
152151
id = "T1059"
153152
name = "Command and Scripting Interpreter"
154153
reference = "https://attack.mitre.org/techniques/T1059/"
154+
155155
[[rule.threat.technique.subtechnique]]
156156
id = "T1059.004"
157157
name = "Unix Shell"
158158
reference = "https://attack.mitre.org/techniques/T1059/004/"
159159

160-
161-
162160
[rule.threat.tactic]
163161
id = "TA0002"
164162
name = "Execution"
165163
reference = "https://attack.mitre.org/tactics/TA0002/"
166-

0 commit comments

Comments
 (0)