Suspicious Execution of Unsigned or Untrusted Process via Sudo
Description
Detects when Sudo is used to execute an untrusted or unsigned binary via the -S option allowing a password or pre-gathered key to be piped to the binary upon execution. A recent stealer sample was seen executing a second stage payload in this manner passing the user provided password to supply the second stage payload with upon execution. The use of Sudo with the -S option in itself is not common but when its used to execute an untrusted or unsigned binary it should be considered highly suspicious acitvity.
Query · eql
sequence with maxspan=5s [process where event.type == "start" and event.action == "exec" and process.name == "sudo" and process.args == "-S"] by process.entity_id [process where event.type == "start" and event.action == "exec" and process.parent.name == "sudo" and (process.code_signature.trusted == false or process.code_signature.exists == false)] by process.parent.entity_id