Microsoft Office File Execution via Script Interpreter
Description
Identifies the execution of an executable file written or modified by Microsoft Office processes and via a Windows Shell process.
Query · eql
sequence by user.id with maxspan=1m
[file where event.action != "deletion" and
(file.extension : ("exe", "com", "pif", "scr") or
// Match Windows PE files by header data (MZ)
file.Ext.header_bytes : "4d5a*") and
process.name : ("WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "MSACCESS.EXE")] by file.path
[process where event.action == "start" and
process.parent.name : ("powershell.exe", "pwsh.exe", "cmd.exe", "cscript.exe", "wscript.exe") and
not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe")] by process.executable