T1027.007 Elastic Security · Elastic

Detect Dynamic API Resolution in Elastic Security

Adversaries may obfuscate then dynamically resolve API functions called by their malware in order to conceal malicious functionalities and impair defensive analysis. API functions called by malware leave static artifacts such as strings in payload files and in the Import Address Table (IAT). To avoid static analysis, adversaries use dynamic API resolution: hashes of function names are stored in malware in lieu of literal strings, and malware uses GetProcAddress() and LoadLibrary() to manually reproduce the linking process. Threat actors including Mustang Panda, Lazarus Group, Latrodectus, Bazar, Brute Ratel C4, TONESHELL, PlugX, Raccoon Stealer, AvosLocker, and CHIMNEYSWEEP use this technique.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1027 Obfuscated Files or Information
Sub-technique
T1027.007 Dynamic API Resolution
Canonical reference
https://attack.mitre.org/techniques/T1027/007/

Elastic Detection Query

Elastic Security (Elastic)
eql
library where
  dll.name in~ ("kernel32.dll", "ntdll.dll", "kernelbase.dll") and
  not process.executable like~ "C:\\Windows\\*" and
  not process.executable like~ "C:\\Program Files\\*" and
  not process.executable like~ "C:\\Program Files (x86)\\*" and
  process.executable != null and
  not process.name in~ ("svchost.exe", "lsass.exe", "services.exe", "explorer.exe", "MsMpEng.exe", "SenseIR.exe", "csrss.exe")
high severity medium confidence

Detects dynamic API resolution (T1027.007) by identifying library load events where core Windows DLLs (kernel32.dll, ntdll.dll, kernelbase.dll) are loaded by processes residing outside standard system directories. Malware implementing hash-based API resolution calls LoadLibrary and GetProcAddress manually rather than relying on static imports, causing these DLL loads to appear from unexpected process paths such as temp directories, user home folders, or dropped locations.

Data Sources

Elastic Endpoint Security (DLL load telemetry)Windows Sysmon via Elastic Agent (Event ID 7)

Required Tables

logs-endpoint.events.library-*logs-windows.sysmon_operational-*

False Positives & Tuning

  • Portable applications (e.g., portable browsers, standalone utilities) run from user home directories or removable media that legitimately load kernel32.dll or ntdll.dll at startup
  • Security tooling and debuggers (e.g., x64dbg, WinDbg, IDA Pro, Frida) installed or launched outside standard directories that instrument DLL loading for analysis purposes
  • Software installers or self-extracting archives that temporarily stage and execute binaries from %TEMP% before copying to their final installation path, causing transient loads from non-standard locations
  • Enterprise custom applications deployed by IT operations to non-standard directories (e.g., D:\Apps\) that legitimately import from the Windows DLL ecosystem at runtime
Download portable Sigma rule (.yml)

Other platforms for T1027.007


Testing Methodology

Validate this detection against 4 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 1Demonstrate GetProcAddress Dynamic API Resolution in PowerShell

    Expected signal: Sysmon Event ID 1: PowerShell process creation with Add-Type and DllImport. PowerShell ScriptBlock Log Event ID 4104: the P/Invoke declarations and GetProcAddress call. Sysmon Event ID 7: user32.dll loaded by powershell.exe.

  2. Test 2API Hash Resolution Simulation

    Expected signal: PowerShell ScriptBlock Log Event ID 4104: the hash function implementation and the list of API names being hashed. The output shows API-to-hash mappings as adversarial malware would store them.

  3. Test 3Inspect Binary IAT for Dynamic Resolution Indicators

    Expected signal: Sysmon Event ID 1: dumpbin.exe execution with /imports argument on calc.exe. The findstr filter shows LoadLibrary and GetProcAddress imports if present.

  4. Test 4Create Minimal-Import Executable for Testing

    Expected signal: Sysmon Event ID 1: csc.exe compilation (T1027.004 indicator). Sysmon Event ID 1: dynapi.exe execution from Temp. Sysmon Event ID 7: kernel32.dll and user32.dll loaded by dynapi.exe. The dynapi.exe IAT will contain only LoadLibrary and GetProcAddress.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections