any where host.os.type == "windows" and
(process.name : "msiexec.exe" or Effective_process.name : "msiexec.exe") and
(
(event.category == "file" and event.action == "creation" and
file.path : ("?:\\Windows\\System32\\Tasks\\*",
"?:\\programdata\\microsoft\\windows\\start menu\\programs\\startup\\*",
"?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*")) or
(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\\*"))
)
Install detection rules in Elastic Security
Detect Persistence via a Windows Installer in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).