Shell Script Execution from abnormal Volume Mount Path
Description
Detects the suspicious execution of a shell script from a volume mount path and outside of the standard macOS binary execution path (/Volumes/name.app/Contents/MacOS/binary). This activity is highly abnormal and should indicate potentially malicious activity. Threat actors have used shell scripts like this in order to download additional tools/payloads and prepare the system for post-infection actions by establishing persistence, altering file attributes and creating necessary directories.
Query · eql
process where event.type == "start" and event.action == "exec" and
process.name like~ ("bash", "sh", "zsh", "tclsh*") and
process.args like~ "/Volumes/*/Contents/*" and
process.args_count <= 3 and
process.parent.executable like~ "/Volumes/*" and not
process.args like~ ("/Volumes/*/Contents/MacOS/*", "/Volumes/*/Contents/Eclipse/*") and not
process.Ext.effective_parent.executable like~ "/Volumes/*"