Unusually Large Script Executed by Osascript
Description
Detects when Osascript is executed and an abnormally large script is supplied to be executed. Threat actors have been increasingly been observed utilizing Osascript to collect sensitive files and stage them for exfiltration using AppleScript supplied to Osascript via the -e option for execution. These scripts are abnormally large and very uncommon to see executed in this manner.
Query · eql
process where event.type == "start" and event.action == "exec" and process.name == "osascript" and
process.args == "-e" and
(
process.args_count > 40 or
(length(process.command_line) >= 3000 and process.command_line regex """.*\(\{[\s]*\d+[\s]*,[\s]*\d+[\s]*,[\s]*\d+.*""")
) and
not (process.args : "*checkWWAssetsExistence*" and process.args : "*wwAssetsOpenDocuments*" and process.args : "*isWWAssetsInstalled*")