Reflective Binary Load
Description
Detects reflective code loading on macOS through creation of "NSCreateObjectFileImageFromMemory-*" temporary files by suspicious processes. This technique allows malware to execute in-memory Mach-O binaries while evading disk-based detection.
Query · eql
file where event.type != "deletion" and
file.name : "NSCreateObjectFileImageFromMemory-*" and
process.name != null and
process.executable != null and
((process.code_signature.trusted == false or process.code_signature.exists == false) or
process.name like~ ("osascript", "bash", "sh", "zsh", "node")) and
not (process.executable like "/private/tmp/*" and process.name == "osx-x86_64") and
not (process.code_signature.exists == true and process.code_signature.trusted == true and process.code_signature.team_id == "EBNT3ZX97E") and
not process.executable like~ "/private/tmp/PKInstallSandbox.*" and
not process.code_signature.signing_id == "com.steinberg.cubase13" and
not Effective_process.executable in ("/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Applications/iZotope Product Portal.app/Contents/MacOS/Product Portal",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/Library/Kandji/Kandji Agent.app/Contents/Helpers/Kandji Library Manager.app/Contents/MacOS/kandji-library-manager",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon") and
not Effective_process.executable like "/usr/local/rippling/*"