DLL
Adversaries may abuse dynamic-link library (DLL) mechanisms to achieve persistence, privilege escalation, and defense evasion. Techniques include DLL search order hijacking (planting a malicious DLL earlier in the search path), DLL side-loading (placing a malicious DLL alongside a legitimate signed executable), phantom DLL hijacking (targeting references to non-existent DLLs), DLL substitution (replacing a valid DLL), and DLL redirection (using .manifest or .local files). Groups including Chimera, TONESHELL/Mustang Panda, Velvet Ant, APT41, and Aquatic Panda have extensively used these techniques to load malicious payloads under trusted process contexts.
let SuspiciousPaths = dynamic([
"\\AppData\\Local\\Temp\\",
"\\AppData\\Roaming\\",
"\\ProgramData\\",
"\\Users\\Public\\",
"\\Windows\\Temp\\"
]);
let KnownGoodLoaders = dynamic([
"C:\\Windows\\System32\\",
"C:\\Windows\\SysWOW64\\",
"C:\\Program Files\\",
"C:\\Program Files (x86)\\"
]);
DeviceImageLoadEvents
| where Timestamp > ago(24h)
| where not(FolderPath has_any (KnownGoodLoaders))
| where FolderPath has_any (SuspiciousPaths)
| join kind=inner (
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessIntegrityLevel in ("High", "System")
| project DeviceId, InitiatingProcessId=ProcessId, InitiatingProcessFileName=FileName, InitiatingProcessFolderPath=FolderPath
) on DeviceId
| where InitiatingProcessFolderPath has_any ("C:\\Program Files\\", "C:\\Windows\\System32\\")
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, SHA256,
InitiatingProcessFileName, InitiatingProcessFolderPath
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate portable applications that bundle their own DLLs in AppData (e.g., some update mechanisms for Slack, Teams, or Electron apps)
- Developer workstations where build artifacts and test DLLs are loaded from non-standard paths
- Software installers that extract DLLs to TEMP directories during installation and immediately load them
- Security or monitoring tools that load plugins from user-writable configuration directories
References (7)
- https://attack.mitre.org/techniques/T1574/001/
- https://unit42.paloaltonetworks.com/dll-hijacking-techniques/
- https://www.crowdstrike.com/en-us/blog/4-ways-adversaries-hijack-dlls/
- https://www.wietzebeukema.nl/blog/hijacking-dlls-in-windows
- https://www.hexacorn.com/blog/2013/12/08/beyond-good-ol-run-key-part-5/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1574.001/T1574.001.md
- https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
Unlock Pro Content
Get the full detection package for T1574.001 including response playbook, investigation guide, and atomic red team tests.