Initial Access Staging via Installer Package
Description
Detects when an installer package creates a new directory structure and immediately moves an executable file into that directory. Threat actors will often include system preparation steps in their initial access installer packages implemented via pre or post install scripts with the purpose of preparing a location to drop and execute their payload from that won't raise suspicion.
Query · eql
sequence by process.entity_id with maxspan=15s
[process where event.type == "start" and process.Ext.effective_parent.name == "installer" and
process.parent.name : ("bash", "sh", "zsh", "dash", "csh", "tcsh", "ksh", "tclsh*", "fish") and process.name in ("cp", "mv")]
[file where event.action != "deletion" and file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*") and
(file.name like~ ".*" or file.path like
("/Users/Shared/*",
"/tmp/*",
"/private/tmp/*",
"/var/tmp/*",
"/Library/WebServer/*",
"/Library/Graphics/*",
"/Library/Fonts/*")) and
not file.path like
("/private/tmp/org.gpgtools/gpgmailloader_install/GPGMailLoader.signed.mailbundle/Contents/MacOS/GPGMailLoader",
"/private/tmp/PKInstallSandbox*")]