-
Notifications
You must be signed in to change notification settings - Fork 603
[Rule Tuning] File Transfer or Listener Established via Netcat #5223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Rule: Tuning - GuidelinesThese guidelines serve as a reminder set of considerations when tuning an existing rule. Documentation and Context
Rule Metadata Checks
Testing and Validation
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
| not process.command_line like~ ("*127.0.0.1*", "*localhost*")] | ||
| [network where host.os.type == "linux" and (process.name == "nc" or process.name == "ncat" or process.name == "netcat" or | ||
| process.name == "netcat.openbsd" or process.name == "netcat.traditional")] | ||
| [network where host.os.type == "linux" and process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the network event is really necessary here ? (the 1st event of the seq should be enough to triage and less performance req)
process where host.os.type == "linux" and event.type == "start" and
process.name in ("nc","ncat","netcat","netcat.openbsd","netcat.traditional") and (
/* bind shell to specific port or listener */
process.args:("-*l*","-*p*")
/* reverse shell to command-line interpreter used for command execution */
or (process.args: "-e" and process.args:("/bin/bash","/bin/sh"))
/* file transfer via stdout */
or process.args:(">","<")
/* file transfer via pipe */
or (process.args:("|") and process.args:("nc","ncat"))
) and
not process.command_line like~ ("*127.0.0.1*", "*localhost*")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++, good call; removed network piece and also tuned the rest of the rule a bit as logic did not make 100% sense. Should be good to go now.
rules/linux/execution_file_transfer_or_listener_established_via_netcat.toml
Outdated
Show resolved
Hide resolved
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
Summary
Tuning this rule to ensure it is not bypassed through double command-line flag usage.