Command and Control (TA0011)(external, opens in a new tab or window)
text code block:file where host.os.type == "linux" and event.action in ("rename", "creation") and file.Ext.header_bytes like "7f454c46*" and ( process.name in ( "curl", "wget", "ftp", "tftp", "scp", "rsync", "busybox", "timeout", "env", "cp", "mv", "install", "dd", "tee", "touch", "tar", "gzip", "gunzip", "bzip2", "bunzip2", "xz", "unxz", "zip", "unzip", "7z", "bun" ) or process.name like (".*", "python*", "perl*", "php*", "ruby*", "lua*", "node*", "deno*") or process.executable like ( "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "*/www/html/*", "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/mnt/*", "/media/*", "*/wp-content/*", "*/wp-includes/*", "*/wp-admin/*", "?memfd:*", "memfd:*" ) ) and file.path like ( "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/var/mail/*", "*/www/html/*", "*/wp-content/*", "*/wp-includes/*", "*/wp-admin/*" )
Install detection rules in Elastic Security
Detect ELF Payload Staged in a Suspicious Directory 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).