Suspicious Startup Persistence via a Windows Installer
Description
Identifies when the Windows installer process msiexec.exe creates a new persistence entry via the Run key or Startup folder and set to run a suspicious commands or file type.
Query · eql
any where process.name : "msiexec.exe" and
(
(event.category == "registry" and event.action == "modification" and
registry.path : ("H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
"H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
"H*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
"H*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*") and
registry.data.strings : ("*C:\\Users*\\*\\Contacts\\*", "*cmd*/c*", "*powershell*", "*node.exe*.js*", "*rundll32*",
"*mshta.exe*", "*wscript.exe*", "*cscript.exe*", "*C:\\Users\\Public\\*") and
not registry.data.strings :
("rundll32.exe \"?:\\Program Files\\VMware\\VMware View\\Agent\\bin\\MessageFrameWork.dll\",EnvSyncW",
"rundll32.exe ?:\\PROGRA~1\\Omnissa\\Horizon\\Agent\\bin\\MESSAG~1.DLL,EnvSyncW",
"rundll32.exe \"?:\\Program Files\\Omnissa\\Horizon\\Agent\\bin\\MessageFrameWork.dll\",EnvSyncW",
"rundll32.exe DR*Svc.dll,EntryPointUserMessage",
"rundll32.exe DR*SVC.dll, EntryPointUserMessage",
"rundll32.exe P*Svc.dll, EntryPointUserMessage",
"rundll32.exe DRV*.dll,EntryPointUserMessage",
"rundll32.exe P*.dll,EntryPointUserMessage",
"C:\\Users\\Public\\RES\\RESPrinter\\FileWatcher.exe")) or
(event.category == "file" and event.action == "creation" and
file.extension in~ ("bat", "cmd", "js", "vbs", "wsh", "hta", "exe", "pif", "scr", "cpl", "jse", "vbe", "ps1") and
file.path : ("?:\\programdata\\microsoft\\windows\\start menu\\programs\\startup\\*",
"?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*"))
)