Skip to content

Commit bd13749

Browse files
authored
Update execution_file_transfer_or_listener_established_via_netcat.toml
1 parent eae1ae1 commit bd13749

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

rules/linux/execution_file_transfer_or_listener_established_via_netcat.toml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,19 @@ tags = [
124124
]
125125
type = "eql"
126126
query = '''
127-
sequence by process.entity_id with maxspan=1m
128-
[process where host.os.type == "linux" and event.type == "start" and
129-
process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional") and
130-
(
131-
/* bind shell to specific port or listener */
132-
process.args:("-*l*","-*p*") or
133-
/* reverse shell to command-line interpreter used for command execution */
134-
(process.args:("-e") and process.args:("/bin/bash","/bin/sh")) or
135-
/* file transfer via stdout */
136-
process.args:(">","<") or
137-
/* file transfer via pipe */
138-
(process.args:("|") and process.args:("nc","ncat"))
139-
) and not process.command_line like~ ("*127.0.0.1*", "*localhost*")]
140-
[network where host.os.type == "linux" and process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional")]
127+
process where host.os.type == "linux" and event.type == "start" and
128+
process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional") and
129+
(
130+
/* bind shell to specific port or listener */
131+
process.args:("-*l*","-*p*") or
132+
/* reverse shell to command-line interpreter used for command execution */
133+
(process.args:("-*e*")) or
134+
/* file transfer via stdout */
135+
process.args:(">","<") or
136+
/* file transfer via pipe */
137+
(process.args:"|")
138+
) and
139+
not process.command_line like~ ("*127.0.0.1*", "*localhost*")
141140
'''
142141

143142
[[rule.threat]]

0 commit comments

Comments
 (0)