Execution (TA0002)(external, opens in a new tab or window)
Command and Control (TA0011)(external, opens in a new tab or window)
text code block:sequence by host.id with maxspan=5s [network where event.type == "start" and host.os.type == "linux" and event.action in ("connection_attempted", "connection_accepted") and process.name : ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "socat") and destination.ip != null and not cidrmatch(destination.ip, "127.0.0.0/8", "169.254.0.0/16", "224.0.0.0/4", "::1")] by process.entity_id [process where event.type == "start" and host.os.type == "linux" and event.action in ("exec", "fork") and process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and ( (process.args : ("-i", "-l")) or (process.parent.name == "socat" and process.parent.args : "*exec*") )] by process.parent.entity_id
Install detection rules in Elastic Security
Detect Potential Reverse Shell in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).