Detection of Potential Application Shimming via Sdbinst
Attackers can abuse the Windows Application Shim infrastructure via sdbinst.exe to achieve persistence and arbitrary code execution by installing malicious compatibility databases.
The Windows Application Shim infrastructure is designed to provide backward compatibility for legacy software as the operating system evolves. This mechanism allows developers to apply patches to applications without modifying the original source code. Adversaries exploit this functionality for persistence and privilege escalation by using the native sdbinst.exe utility to install malicious compatibility databases (.sdb files).
When a shim database is installed, the Windows Shim Engine intercepts calls made by target applications, allowing for the injection of malicious DLLs or the modification of application behavior. By using sdbinst.exe, attackers can force legitimate, high-privilege system processes to load malicious code whenever the target application starts. Because shims operate at the OS level, this technique is highly stealthy and can persist across reboots. Defenders should monitor for sdbinst.exe executions that deviate from established administrative baselines or expected software update patterns.
Attack Chain
- Attacker crafts a malicious Application Compatibility Database (
.sdbfile) containing hooks to redirect execution. - Attacker gains elevated (Administrator or SYSTEM) privileges on the target Windows host.
- Attacker executes
sdbinst.exewith command-line arguments to install the malicious.sdbfile. - The Windows Shim Engine registers the database, associating the malicious shim with a legitimate target application.
- The target application is executed by a user or system process.
- The Shim Engine intercepting the application process runtime loads the attacker-defined shim.
- Malicious code contained within the shim executes within the context of the target application.
- Persistence is established; the malicious code runs automatically every time the target application is invoked.
Impact
Successful exploitation allows for stealthy persistence and arbitrary code execution within the context of legitimate processes. This technique can be used to bypass security controls, maintain long-term access, or escalate privileges if a shim is applied to a process running with higher integrity than the attacker's initial entry point.
Recommendation
Detection engineering teams should implement monitoring for suspicious sdbinst.exe activity:
- Deploy the Sigma rules below to identify non-standard usage of the
sdbinst.exeutility. - Establish a baseline for legitimate
sdbinst.exeusage, including enterprise software installers and standard OS maintenance tasks. - Enable process creation logging (Sysmon Event ID 1) to capture the command-line arguments used during
sdbinst.exeexecution. - Regularly audit the System for unauthorized or unexpected
.sdbfiles, particularly those in non-standard application paths.
Immediate actions
Deploy the Sigma rule to detect suspicious sdbinst.exe executions.
Threat Hunt
Identify all sdbinst.exe execution events in the past 90 days.
Data: Process creation logs
Mitigations
Restrict user ability to install custom shim databases via group policy or endpoint security controls.
T1546.011
Detection coverage 1
Detect Potential Application Shimming via Sdbinst
lowDetects potentially malicious use of sdbinst.exe to install application compatibility databases, excluding known legitimate paths and arguments.
Detection queries are available on the platform. Get full rules →