Detect Dynamic-link Library Injection in IBM QRadar
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
- Technique
- T1055 Process Injection
- Sub-technique
- T1055.001 Dynamic-link Library Injection
- Canonical reference
- https://attack.mitre.org/techniques/T1055/001/
QRadar Detection Query
SELECT
DATEFORMAT(devicetime, 'yyyy-MM-dd HH:mm:ss') AS EventTime,
hostname,
username,
"Source Image" AS InjectorProcess,
"Target Image" AS TargetProcess,
"Start Module" AS StartModule,
"Start Function" AS StartFunction,
QIDNAME(qid) AS EventName
FROM events
WHERE
LOGSOURCETYPEID(devicetype) = 25
AND (eventid = 8 OR LOWER(QIDNAME(qid)) LIKE '%createremotethread%')
AND "Source Image" NOT ILIKE '%\\MsMpEng.exe'
AND "Source Image" NOT ILIKE '%\\csrss.exe'
AND "Source Image" NOT ILIKE '%\\services.exe'
AND "Source Image" NOT ILIKE '%\\lsass.exe'
AND (
LOWER("Source Image") LIKE '%\\rundll32.exe'
OR LOWER("Source Image") LIKE '%\\regsvr32.exe'
OR LOWER("Source Image") LIKE '%\\mshta.exe'
OR LOWER("Source Image") LIKE '%\\wscript.exe'
OR LOWER("Source Image") LIKE '%\\cscript.exe'
OR LOWER("Source Image") LIKE '%\\powershell.exe'
OR LOWER("Source Image") LIKE '%\\cmd.exe'
)
LAST 24 HOURS
ORDER BY devicetime DESC Queries QRadar SIEM for Sysmon Event ID 8 (CreateRemoteThread) sourced from high-risk injector processes while excluding known-benign system processes. Requires Sysmon DSM extension with custom property mappings for Source Image, Target Image, Start Module, and Start Function fields to be configured in QRadar.
Data Sources
Required Tables
False Positives & Tuning
- QRadar environments without Sysmon DSM custom property extensions will not parse Source Image or Target Image fields correctly, producing no results or noisy unparsed output
- Legitimate .NET and Java runtimes use CreateRemoteThread-equivalent mechanisms during JIT compilation cross-process operations and remote debugging attachment
- Process injection by trusted security products (CrowdStrike, Carbon Black, SentinelOne) for in-process hooking and real-time threat monitoring will match injector process patterns
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.
- 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.
- 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.
- 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.
References (7)
- https://attack.mitre.org/techniques/T1055/001/
- https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-process
- https://www.endgame.com/blog/technical-blog/hunting-memory
- https://blog.f-secure.com/hiding-malicious-code-with-module-stomping/
- https://www.ired.team/offensive-security/code-injection-process-injection/modulestomping-dll-hollowing-shellcode-injection
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1055.001/T1055.001.md
- https://lolbas-project.github.io/lolbas/Binaries/Mavinject/
Unlock Pro Content
Get the full detection package for T1055.001 including response playbook, investigation guide, and atomic red team tests.