From 2e6b353f5e4cf72a3594d3f41e5a969c3ec146d6 Mon Sep 17 00:00:00 2001 From: Samirbous <64742097+Samirbous@users.noreply.github.com> Date: Mon, 8 Feb 2021 22:57:55 +0100 Subject: [PATCH] [New Rule] Potential Reverse Shell Activity via Terminal (#821) * [New Rule] Potential Reverse Shell Activity via Terminal * extra reference * adjusted process.args for coverage resilience * Update execution_revershell_via_shell_cmd.toml * Update rules/cross-platform/execution_revershell_via_shell_cmd.toml Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> * Update rules/cross-platform/execution_revershell_via_shell_cmd.toml Co-authored-by: Justin Ibarra * encoded ref url Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> Co-authored-by: Justin Ibarra --- .../execution_revershell_via_shell_cmd.toml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 rules/cross-platform/execution_revershell_via_shell_cmd.toml diff --git a/rules/cross-platform/execution_revershell_via_shell_cmd.toml b/rules/cross-platform/execution_revershell_via_shell_cmd.toml new file mode 100644 index 000000000..71160cc8b --- /dev/null +++ b/rules/cross-platform/execution_revershell_via_shell_cmd.toml @@ -0,0 +1,43 @@ +[metadata] +creation_date = "2020/01/07" +maturity = "production" +updated_date = "2020/01/07" + +[rule] +author = ["Elastic"] +description = "Identifies the execution of a shell process with suspicious arguments which may be indicative of reverse shell activity." +from = "now-9m" +index = ["auditbeat-*", "logs-endpoint.events.*"] +language = "eql" +license = "Elastic License" +name = "Potential Reverse Shell Activity via Terminal" +references = [ + "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md", + "https://github.com/WangYihang/Reverse-Shell-Manager", + "https://www.netsparker.com/blog/web-security/understanding-reverse-shells/", +] +risk_score = 73 +rule_id = "a1a0375f-22c2-48c0-81a4-7c2d11cc6856" +severity = "high" +tags = ["Elastic", "Host", "Linux", "macOS", "Threat Detection", "Execution"] +type = "eql" + +query = ''' +process where event.type in ("start", "process_started") and + process.name in ("sh", "bash", "zsh", "dash", "zmodload") and + process.args:("*/dev/tcp/*", "*/dev/udp/*", "zsh/net/tcp", "zsh/net/udp") +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1059" +name = "Command and Scripting Interpreter" +reference = "https://attack.mitre.org/techniques/T1059/" + + +[rule.threat.tactic] +id = "TA0002" +name = "Execution" +reference = "https://attack.mitre.org/tactics/TA0002/"