Cross-source coverage

T1546.011 / ATT&CK

Event Triggered Execution: Application Shimming

14 rules across 4 sources.

From MITRE ATT&CK 19.2

Adversaries may establish persistence and/or elevate privileges by executing malicious content triggered by application shims. The Microsoft Windows Application Compatibility Infrastructure/Framework (Application Shim) was created to allow for backward compatibility of software as the operating system codebase changes over time. For example, the application shimming feature allows developers to apply fixes to applications (without rewriting code) that were created for Windows XP so that it will work with Windows 10.

Within the framework, shims are created to act as a buffer between the program (or more specifically, the Import Address Table) and the Windows OS. When a program is executed, the shim cache is referenced to determine if the program requires the use of the shim database (.sdb). If so, the shim database uses hooking to redirect the code as necessary in order to communicate with the OS.

A list of all shims currently installed by the default Windows installer (sdbinst.exe) is kept in:

  • %WINDIR%\AppPatch\sysmain.sdb and
  • hklm\software\microsoft\windows nt\currentversion\appcompatflags\installedsdb

Custom databases are stored in:

  • %WINDIR%\AppPatch\custom & %WINDIR%\AppPatch\AppPatch64\Custom and
  • hklm\software\microsoft\windows nt\currentversion\appcompatflags\custom

To keep shims secure, Windows designed them to run in user mode so they cannot modify the kernel and you must have administrator privileges to install a shim. However, certain shims can be used to Bypass User Account Control (UAC and RedirectEXE), inject DLLs into processes (InjectDLL), disable Data Execution Prevention (DisableNX) and Structure Exception Handling (DisableSEH), and intercept memory addresses (GetProcAddress).

Utilizing these shims may allow an adversary to perform several malicious acts such as elevate privileges, install backdoors, disable defenses like Windows Defender, etc. Shims can also be abused to establish persistence by continuously being invoked by affected programs.

Platforms
Windows
Telemetry
WinEventLog:SecurityWinEventLog:Sysmon

How MITRE says to detect it DET0017

Detection Strategy for Application Shimming via sdbinst.exe and Registry Artifacts (Windows)

Windows Analytic 0051

Correlated modification of AppCompat registry keys and execution of sdbinst.exe to install custom shim databases. Followed by DLL injection via shim behavior into target application processes.

  • WinEventLog:Security EventCode=4657
  • WinEventLog:Sysmon EventCode=1
  • WinEventLog:Sysmon EventCode=7
  • WinEventLog:Sysmon EventCode=11

SigmaHQ/sigma

6 rules
Detection Severity Format
Potential Persistence Via Shim Database In Uncommon Location High Sigma
Suspicious Shim Database Patching Activity High Sigma
Potential Persistence Via AppCompat RegisterAppRestart Layer Medium Sigma
Potential Persistence Via Shim Database Modification Medium Sigma
Potential Shim Database Persistence via Sdbinst.EXE Medium Sigma
Uncommon Extension Shim Database Installation Via Sdbinst.EXE Medium Sigma

Wazuh Core Ruleset

3 rules
Detection Severity Format
Possible Shimming. Application Compatibility Database launched from an encoded powershell command Critical Wazuh XML
Application Compatibility Database launched High Wazuh XML
An executable - - loaded from the Temp directory. · win.eventdata.imageLoaded = (?i)[c-z]:\\\\Windows\\\\Temp\\\\.+\.dll Medium Wazuh XML

splunk/security_content

3 rules
Detection Severity Format
Registry Keys for Creating SHIM Databases Undefined SPL
Shim Database File Creation Undefined SPL
Shim Database Installation With Suspicious Parameters Undefined SPL

elastic/detection-rules

2 rules
Detection Severity Format
Installation of Custom Shim Databases Medium Elastic TOML
Potential Application Shimming via Sdbinst Low Elastic TOML

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.