Msiexec Execution via a Windows Script Interpreter
Description
Identifies when a Windows script attempts to execute commands using the Windows Installer service via Component Object Model.
Query · eql
sequence with maxspan=1m
[process where event.action == "start" and not user.id : "S-1-5-18" and
process.name : ("wscript.exe", "cscript.exe", "mshta.exe", "powershell.exe", "mshta.exe", "cmstp.exe", "msxsl.exe") and
not (process.name : "powershell.exe" and
process.parent.executable : ("?:\\Program Files (x86)\\Microsoft Intune Management Extension\\agentexecutor.exe",
"?:\\Program Files (x86)\\ScreenConnect Client*\\ScreenConnect.WindowsBackstageShell.exe",
"?:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\dctask64.exe",
"C:\\Program Files (x86)\\FastTrack Software\\Admin By Request\\AdminByRequest.exe",
"C:\\Program Files\\Oracle Cloud Agent\\plugins\\unifiedmonitoring\\unifiedmonitoring.exe"))
] by process.entity_id
[process where event.action == "start" and process.parent.name : "msiexec.exe" and
not (process.name : "regsvr32.exe" and user.id : "S-1-5-18") and
not (process.name : "cmd.exe" and
process.command_line : "cmd /C if exist \"%appdata%/Messenger\" rmdir \"%appdata%/Messenger\" /s /q & if exist \"%appdata%/chatgenie\" rmdir \"%appdata%/chatgenie\" /s /q") and
not (process.executable : "?:\\Windows\\Sys*\\msiexec.exe" and
process.args : "/Z" and process.args : ("C:\\Program Files (x86)\\*.dll", "C:\\Program Files\\*.dll"))
] by process.Ext.effective_parent.entity_id