T1055.001 Splunk · SPL

Detect Dynamic-link Library Injection in Splunk

Adversaries may inject dynamic-link libraries (DLLs) into processes in order to evade process-based defenses as well as possibly elevate privileges. DLL injection is commonly performed by writing the path to a DLL in the virtual address space of the target process before loading the DLL by invoking a new thread. The write can be performed with native Windows API calls such as VirtualAllocEx and WriteProcessMemory, then invoked with CreateRemoteThread (which calls the LoadLibrary API responsible for loading the DLL). Variations include reflective DLL injection (self-mapping DLL), memory module loading, and Module Stomping/DLL Hollowing where a legitimate DLL is loaded then its AddressOfEntryPoint is overwritten before execution.

MITRE ATT&CK

Tactic
Defense Evasion Privilege Escalation
Technique
T1055 Process Injection
Sub-technique
T1055.001 Dynamic-link Library Injection
Canonical reference
https://attack.mitre.org/techniques/T1055/001/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=8
| rename SourceImage as InjectorProcess, TargetImage as TargetProcess
| eval InjectorName=mvindex(split(InjectorProcess, "\\"), -1)
| eval TargetName=mvindex(split(TargetProcess, "\\"), -1)
| search NOT InjectorProcess IN ("*\\MsMpEng.exe", "*\\csrss.exe", "*\\services.exe", "*\\lsass.exe")
| join type=left TargetProcessId=TargetProcessId host [search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=7 NOT (ImageLoaded="C:\\Windows\\System32\\*" OR ImageLoaded="C:\\Windows\\SysWOW64\\*" OR ImageLoaded="C:\\Program Files*")
| rename ProcessId as TargetProcessId, ImageLoaded as InjectedDLL
| fields _time, host, TargetProcessId, InjectedDLL]
| where isnotnull(InjectedDLL)
| table _time, host, User, InjectorProcess, TargetProcess, StartModule, StartFunction, InjectedDLL
| sort - _time
high severity high confidence

Detects DLL injection by correlating Sysmon Event ID 8 (CreateRemoteThread) with Event ID 7 (ImageLoad) for DLLs loaded from non-standard paths in the target process. The join links the thread creation to the DLL load in the target, providing both the injection source and the injected DLL path for analysis.

Data Sources

Process: OS API ExecutionModule: Module LoadSysmon Event ID 7Sysmon Event ID 8

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • EDR and antivirus products performing legitimate DLL injection for process monitoring
  • Application compatibility shims loading DLLs via apphelp.dll
  • APM/instrumentation tools injecting agent DLLs into monitored applications
  • Browser extensions loading plugin DLLs
Download portable Sigma rule (.yml)

Other platforms for T1055.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 Injection via mavinject.exe (LOLBAS)

    Expected signal: Sysmon Event ID 1: Process Create for mavinject.exe with CommandLine containing /INJECTRUNNING. Sysmon Event ID 8: CreateRemoteThread from mavinject.exe targeting notepad.exe. Sysmon Event ID 7: ImageLoad of amsi.dll in notepad.exe process.

  2. Test 2Reflective DLL Injection via PowerSploit Invoke-DllInjection

    Expected signal: Sysmon Event ID 1: PowerShell process creation. Sysmon Event ID 3: Network connection to raw.githubusercontent.com. Sysmon Event ID 8: CreateRemoteThread from PowerShell to notepad.exe. PowerShell ScriptBlock Log Event ID 4104 with Invoke-DllInjection content.

  3. Test 3CreateRemoteThread DLL Injection via C# Executable

    Expected signal: Sysmon Event ID 1: Process Create for csc.exe (C# compiler) spawned by PowerShell. Sysmon Event ID 1: injector_test.exe execution. Sysmon Event ID 11: File Create for injector_test.exe in TEMP. If full injection is performed: Sysmon Event ID 8 for CreateRemoteThread.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections