Persistence (TA0003)(external, opens in a new tab or window)
Command and Control (TA0011)(external, opens in a new tab or window)
Defense Evasion (TA0005)(external, opens in a new tab or window)
text code block:sequence by host.id with maxspan=5s [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.name == "systemd" and ( process.name in ( "openssl", "nc", "ncat", "netcat", "nc.openbsd", "nc.traditional", "socat", "busybox", "mkfifo", "nohup", "setsid", "xterm", "telnet", "awk" ) or (process.name : "python*" and process.args : "-c" and process.args : ( "*import*pty*spawn*", "*import*subprocess*call*" )) or (process.name : "perl*" and process.args : "-e" and process.args : "*socket*" and process.args : ( "*exec*", "*system*" )) or (process.name : "ruby*" and process.args : ("-e", "-rsocket") and process.args : ( "*TCPSocket.new*", "*TCPSocket.open*" )) or (process.name : "lua*" and process.args : "-e" and process.args : "*socket.tcp*" and process.args : ( "*io.popen*", "*os.execute*" )) or (process.name : "php*" and process.args : "-r" and process.args : "*fsockopen*" and process.args : "*/bin/*sh*") or (process.name == "node" and process.args == "-e" and process.args : "*spawn*sh*" and process.args : "*connect*") or (process.name : ("awk", "gawk", "mawk", "nawk") and process.args : "*/inet/tcp/*") or (process.name in ("rvim", "vim", "vimdiff", "rview", "view") and process.args == "-c" and process.args : "*socket*") ) and not ( process.args in ("/usr/bin/pg_ctlcluster", "/usr/bin/pveproxy", "/usr/sbin/pveum", "/usr/bin/pveupdate") or process.executable like ("/usr/local/cpanel/*/bin/perl", "/opt/puppetlabs/puppet/bin/ruby") ) ] by process.entity_id [network where host.os.type == "linux" and event.action == "connection_attempted" and event.type == "start" and not process.executable == "/tmp/newroot/bin/curl"] by process.parent.entity_id
Install detection rules in Elastic Security
Detect Suspicious Network Connection via systemd 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).