T1574.001 Microsoft Sentinel · KQL

Detect DLL in Microsoft Sentinel

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

Tactic
Persistence Privilege Escalation Defense Evasion
Technique
T1574 Hijack Execution Flow
Sub-technique
T1574.001 DLL
Canonical reference
https://attack.mitre.org/techniques/T1574/001/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
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
high severity medium confidence

Detects DLL hijacking and side-loading by correlating image load events from suspicious writable directories with high-privilege process contexts. Focuses on cases where a trusted executable (from Program Files or System32) loads a DLL from a user-writable location (Temp, AppData, ProgramData, Public). Uses DeviceImageLoadEvents joined to DeviceProcessEvents to identify the trust context of the loading process.

Data Sources

Module: Module LoadFile: File CreationMicrosoft Defender for Endpoint

Required Tables

DeviceImageLoadEventsDeviceProcessEvents

False Positives & Tuning

  • 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
Download portable Sigma rule (.yml)

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.

  1. 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.

  2. 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.

  3. 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.

Unlock Pro Content

Get the full detection package for T1574.001 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections