Launchctl Submit Execution of Downloaded File
Description
Identifies the execution of a recently downloaded file via launchctl submit. Adversaries may download payloads with curl or wget and register them as transient launchd jobs in order to execute them in the background.
Query · eql
sequence with maxspan=1m
[process where event.type == "start" and event.action == "exec" and
process.name in ("curl", "nscurl", "wget") and process.command_line like "*http*"] as event0
[file where event.action != "deletion" and process.name in ("curl", "nscurl", "wget") and
process.entity_id == event0.process.entity_id] as event1
[process where event.type == "start" and event.action == "exec" and
process.name == "launchctl" and process.args == "submit" and process.args == "-l" and
stringcontains~(process.command_line, event1.file.name)]