AppInit DLLs
Adversaries may establish persistence and/or elevate privileges by executing malicious content triggered by AppInit DLLs loaded into processes. Dynamic-link libraries (DLLs) that are specified in the AppInit_DLLs value in the Registry keys HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows or HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows are loaded by user32.dll into every process that loads user32.dll. In practice, this is nearly every desktop process (GUI applications). This Registry-based injection mechanism has been used by multiple APT groups and crimeware families including Flame, FinFisher, and others.
let AppInitKeys = dynamic([
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows",
"SOFTWARE\\Wow6432Node\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
]);
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has_any (AppInitKeys)
| where RegistryValueName in~ ("AppInit_DLLs", "LoadAppInit_DLLs", "RequireSignedAppInit_DLLs")
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| extend IsDllLoad = RegistryValueName =~ "LoadAppInit_DLLs"
| extend DllPath = RegistryValueData
| extend RequiresSigned = RegistryValueName =~ "RequireSignedAppInit_DLLs"
| extend SigningDisabled = RequiresSigned and RegistryValueData == "0"
| extend DllEnabled = IsDllLoad and RegistryValueData == "1"
| extend SuspiciousDllPath = RegistryValueName =~ "AppInit_DLLs"
and RegistryValueData != ""
and not(RegistryValueData has_any ("C:\\Windows\\system32\\", "C:\\Windows\\SysWOW64\\"))
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey,
RegistryValueName, RegistryValueData, SuspiciousDllPath, DllEnabled, SigningDisabled,
InitiatingProcessFileName, InitiatingProcessCommandLine
| where SuspiciousDllPath or DllEnabled or SigningDisabled
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate security products (some older AV engines, DLP tools) that use AppInit_DLLs to inject monitoring code into all user processes
- Application virtualization platforms that use AppInit_DLLs for application isolation and shim injection
- Some older enterprise software that requires system-wide DLL injection for licensing or functionality
- Research and debugging tools that explicitly document their use of AppInit_DLLs (rare in production environments)
References (5)
- https://attack.mitre.org/techniques/T1546/010/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1546.010/T1546.010.md
- https://support.microsoft.com/en-us/topic/description-of-the-appinit-dlls-feature-in-windows-7-and-windows-server-2008-r2-aabbf40f-3e10-eadd-6260-79df3d753b5f
- https://www.mandiant.com/resources/blog/likely-iranian-threat-actor-conducts-politically-motivated-disruptive-activity-against-israel
- https://pentestlab.blog/2019/12/12/persistence-appinit-dlls/
Unlock Pro Content
Get the full detection package for T1546.010 including response playbook, investigation guide, and atomic red team tests.