Less Pipe Backdoor Execution
Description
This rule detects the execution of a backdoor script or command via the less pipe. Less is a utility that is used to view text files. By creating a malicious less configuration file, threat actors can execute a backdoor script or command on the target system upon file viewing.
Query · eql
process where event.type == "start" and event.action == "exec" and (
process.name in ("setsid", "nohup", "disown") or
(process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and process.args == "-c") or
process.name like (".*", "python*", "perl*", "php*", "ruby*", "lua*", "node") or
process.executable like (
"./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
"/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/root/*"
)
) and
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox") and
process.parent.command_line like "*lesspipe*" and not process.parent.args == "-c" and
not process.executable like "/nix/store/*"