Linux Background Process Execution via Shell
Description
Detects when a binary located in a suspicious location gets executed by a shell interpreter and put in the background via the & operator. Malware may execute their payloads in the background in an effort to remain hidden.
Query · eql
process where event.type == "start" and event.action == "exec" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "-c" and
process.args like ("/* &", "/*&") and process.args_count == 3 and
process.parent.executable like ("/dev/shm/*", "/var/tmp/*", "/tmp/*", "/var/www/*") and
not (
process.executable like "/tmp/newroot/*" or
process.command_line == "/bin/bash -c /opt/forticlient/fortitray &" or
process.parent.executable like ("/var/www/splynx/*", "/tmp/.mount_cursor*", "/tmp/newroot/*") or
process.parent.args == "cursor"
)