Curl Execution via CommandLine Shell Script
Description
Detects when curl is executed as part of a shell script that gets executed via a forked shell interpreter. The activity has been observed in many different samples of the malware known as Shlayer. Shlayer uses this technique in order to avoid traditional scanning and command line detections. The Shlayer malware brings along an encoded shell script within a, usually, signed or sometimes valid application that gets decoded and passed to a forked shell interpreter (to avoid process lineage detections) for execution via the "-c" command parameter.
Query · eql
sequence by process.entity_id with maxspan=30s
[process where event.type == "start" and event.action == "fork" and
process.name in ("bash", "sh", "zsh") and
process.args == "-c" and process.args_count == 3 and
process.command_line == null and
process.parent.name in ("bash", "sh", "zsh")]
[process where event.type == "start" and event.action == "exec" and
process.name in ("curl", "nscurl")]