Unsigned or Untrusted Binary Execution via XPC call
Description
Detects the execution of an unsigned or untrusted binary by a shell interpreter via an XPC call. This activity can be carried out in several ways but the most common is when a Login Item gets created that is specified to execute a specific binary (in this instance an unsigned or untrusted binary). Threat actors will often utilize Login Items as a persistence mechanism to launch their payloads on system boot.
Query · eql
process where event.type == "start" and event.action == "exec" and
process.Ext.effective_parent.name == "xpcproxy" and
process.parent.name in ("sh", "zsh", "bash") and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
process.args_count <= 2 and
process.executable like~ ("/Volumes/*", "/Applications/*", "/Users/Shared/*", "/Library/Application Support/*", "/Users/*/Library/*", "/tmp/*", "/private/tmp/*", "/var/tmp/*") and
not process.name like~ "python*"