Suspicious Elevated Command Execution
Description
Detects potential malicious elevated command executions on macOS by monitoring processes spawned by authtrampoline, which handles macOS privilege escalation. It flags processes with untrusted or missing code signatures, commonly abused process names like osascript, curl, and dscl, as well as shell executions with suspicious arguments. The aim is to swiftly identify and respond to abnormal elevated activities on a macOS system.
Query · eql
process where event.type == "start" and event.action == "exec" and
process.parent.name == "authtrampoline" and
(
((process.code_signature.trusted == false or process.code_signature.exists == false) and not process.executable like~ ("/opt/homebrew/*", "/usr/local/Cellar/*")) or
(process.name like~ ("osascript", "curl", "nscurl", "dscl", ".*")) or
(process.name in ("sh", "bash", "zsh") and process.args == "-c" and
process.args like~ ("dscl*", "curl*", "nscurl*", "osascript*", "/tmp/*", "/private/tmp/*", "/var/tmp/*"))
)