Curl Download and Execution of JavaScript Payload
Description
Identifies when curl is used to download a JavaScript payload and subsequently execute it using the built-in osascript utility. An adversary may use this technique to execute their malicious payload and obtain initial access to an endpoint.
Query · eql
sequence by process.parent.entity_id with maxspan=15s
[process where event.action == "exec" and
process.name in ("curl", "nscurl") and process.args like ("-o", "--output", "-O", "--remote-name") and process.parent.name in~ ("bash", "zsh", "sh", "Terminal") and
not process.args like ("https://*.jamfcloud.com/JSSResource/computercommands/command/BlankPush/id/*", "POST")]
[process where event.action == "exec" and process.name == "osascript" and
(process.args == "-e" or process.args == "-l") and
not process.Ext.effective_parent.executable in
("/usr/local/jamf/bin/jamf",
"/Library/Addigy/auditor",
"/opt/jc/bin/jumpcloud-agent",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService") and
not process.command_line : ("osascript -e display dialog \"Please advise your Support Representative of the following error:\\r\\r• Dialog Team ID verification failed\\r\\r\" with title \"Setup Your Mac: Error\" buttons {\"Close\"} with icon caution",
"osascript -e display dialog \"Please advise your Support Representative of the following error:\\r\\r• Dialog Team ID verification failed\\r\\r\" with title \"App Auto-Patch: Error\" buttons {\"Close\"} with icon caution") and
not process.parent.command_line == "/bin/bash /Library/Management/super/super"
]