Executable Installer File Permissions Weakness
Adversaries may hijack binaries used by installer processes by exploiting weak file permissions. Installers frequently extract binaries (EXEs, DLLs) to subdirectories within %TEMP% during installation, often with world-writable permissions. An adversary can overwrite these binaries before the installer executes them, gaining code execution at the installer's privilege level (often SYSTEM or elevated due to UAC elevation). This technique also applies to existing installed software where the binary or its directory has incorrect permissions allowing non-admin users to overwrite it. Mustang Panda has leveraged legitimate installer executables (e.g., Setup Factory IRSetup.exe) to deploy payloads.
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FolderPath has "\\Temp\\"
| where FileName endswith ".exe"
| where InitiatingProcessFileName in~ ("msiexec.exe", "setup.exe", "install.exe", "installer.exe", "update.exe")
or InitiatingProcessFileName contains "setup"
or InitiatingProcessFileName contains "install"
| join kind=leftouter (
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType == "FileModified"
| where FileName endswith ".exe" or FileName endswith ".dll"
| where FolderPath has "\\Temp\\"
| project DeviceId, ModifiedFile=FileName, ModifiedPath=FolderPath, ModifyTime=Timestamp, ModifyingProcess=InitiatingProcessFileName
) on DeviceId
| where ModifyTime between ((Timestamp - 5m) .. Timestamp)
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
InitiatingProcessFileName, ModifiedFile, ModifiedPath, ModifyingProcess
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate software installers that update extracted files as part of a multi-step installation process
- Self-updating applications that modify their own installer components in TEMP before execution
- Enterprise software deployment systems (SCCM, Intune) that stage and modify installers in temp locations
- Antivirus software that modifies installer binaries as part of scanning or remediation
Unlock Pro Content
Get the full detection package for T1574.005 including response playbook, investigation guide, and atomic red team tests.