Detect DLL in CrowdStrike LogScale
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.
MITRE ATT&CK
- Technique
- T1574 Hijack Execution Flow
- Sub-technique
- T1574.001 DLL
- Canonical reference
- https://attack.mitre.org/techniques/T1574/001/
LogScale Detection Query
// T1574.001 - DLL Hijacking: Trusted Process Loading DLL from Suspicious Path
#event_simpleName=ClassifiedModuleLoad
| ImageFileName = /(?i)(\\AppData\\Local\\Temp\\|\\AppData\\Roaming\\|\\ProgramData\\|\\Users\\Public\\|\\Windows\\Temp\\)/
| not ImageFileName = /(?i)(\\Windows\\System32\\|\\Windows\\SysWOW64\\|\\Program Files\\|\\Program Files \(x86\)\\)/
| ProcessImageFileName = /(?i)(\\Windows\\System32\\|\\Windows\\SysWOW64\\|\\Program Files\\|\\Program Files \(x86\)\\)/
| (Signed="false" OR SignatureStatus!="Valid")
| groupBy([ComputerName, UserName, ProcessImageFileName, ImageFileName, SHA256HashData, Signed, SignatureStatus], function=[count(aid, as=load_count), collect(ImageFileName, as=loaded_dlls)])
| sort(load_count, order=desc)
| rename(field="load_count", as="DLL Load Count")
| rename(field="ProcessImageFileName", as="Loading Process")
| rename(field="ImageFileName", as="Suspicious DLL Path")
| rename(field="SHA256HashData", as="DLL SHA256") CrowdStrike LogScale CQL query detecting T1574.001 DLL hijacking by identifying ClassifiedModuleLoad events where a trusted process from System32, SysWOW64, or Program Files loads an unsigned or invalidly-signed DLL from a suspicious writable path. Results are grouped by host and process to surface patterns of repeated DLL loading that may indicate persistence or privilege escalation via DLL side-loading.
Data Sources
Required Tables
False Positives & Tuning
- Vulnerability scanners or penetration testing tools run from Program Files that load test DLLs from Temp directories during authorized assessments
- Legitimate software with self-update mechanisms where a trusted executable loads a freshly downloaded DLL from AppData or ProgramData before moving it to the final install location
- Visual Studio or other development IDEs loading debug or extension DLLs from user-writable paths as part of normal development workflows
Other platforms for T1574.001
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1DLL Search Order Hijacking via Phantom DLL
Expected signal: Sysmon Event ID 11 (FileCreate): Target file path containing 'dll-hijack-test\cryptsp.dll'. Sysmon Event ID 7 (ImageLoad) if the DLL is loaded. Process creation events showing calc.exe running from a non-standard path.
- Test 2DLL Side-Loading with Legitimate Signed Binary
Expected signal: Sysmon Event ID 11 (FileCreate): Legitimate executable copied to TEMP directory. Sysmon Event ID 1 (Process Create): Process launched from TEMP instead of its legitimate System32 home. File creation events in the temp directory.
- Test 3DLL Redirection via .local File
Expected signal: Sysmon Event ID 11 (FileCreate): .local file created alongside a legitimate executable copy. The presence of [executable].local causes Windows to prioritize the application's directory for all DLL searches, enabling DLL hijacking of any DLL that calc.exe imports.
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.