Detecting T1055 Process Injection with Sysmon
When to Use
- When hunting for defense evasion techniques that hide malicious code inside legitimate processes
- After EDR alerts for suspicious cross-process memory access or remote thread creation
- When investigating malware that injects into svchost.exe, explorer.exe, or other system processes
- During purple team exercises testing detection of process injection variants
- When validating Sysmon configuration coverage for injection detection
Prerequisites
- Sysmon deployed with comprehensive configuration capturing Events 1, 7, 8, 10, 25
- Event ID 8 (CreateRemoteThread) enabled for remote thread detection
- Event ID 10 (ProcessAccess) configured with appropriate access mask filters
- Event ID 7 (ImageLoaded) for DLL injection detection
- Event ID 25 (ProcessTampering) for process hollowing on Sysmon 13+
- SIEM platform for correlation and alerting
Workflow
- Monitor CreateRemoteThread (Event 8): Detect when one process creates a thread in another process's address space. This is the primary indicator of classic DLL injection and shellcode injection.
- Analyze ProcessAccess (Event 10): Track cross-process handle requests with PROCESS_VM_WRITE (0x0020), PROCESS_VM_OPERATION (0x0008), and PROCESS_CREATE_THREAD (0x0002) access rights. Legitimate processes rarely need these on other processes.
- Detect Anomalous DLL Loading (Event 7): Identify DLLs loaded from unusual paths (user temp directories, download folders) into system processes.
- Hunt Process Hollowing (Event 25): Sysmon 13+ generates ProcessTampering events when the executable image in memory diverges from what was mapped from disk -- a hallmark of process hollowing (T1055.012).
- Correlate with Process Creation: Link injection events to the originating process creation (Event 1) to build the full attack chain from initial execution to injection.
- Filter Known-Good Cross-Process Activity: Exclude legitimate software that performs cross-process operations (debuggers, AV products, accessibility tools, RMM agents).
- Map to ATT&CK Sub-Techniques: Classify detected injection as classic injection (T1055.001), PE injection (T1055.002), thread execution hijacking (T1055.003), APC injection (T1055.004), thread local storage (T1055.005), process hollowing (T1055.012), or process doppelganging (T1055.013).
Key Concepts
| Concept |
Description |
| T1055.001 |
Dynamic-link Library Injection |
| T1055.002 |
Portable Executable Injection |
| T1055.003 |
Thread Execution Hijacking |
| T1055.004 |
Asynchronous Procedure Call (APC) Injection |
| T1055.005 |
Thread Local Storage |
| T1055.012 |
Process Hollowing |
| T1055.013 |
Process Doppelganging |
| T1055.015 |
ListPlanting |
| Sysmon Event 8 |
CreateRemoteThread detected |
| Sysmon Event 10 |
ProcessAccess with memory write permissions |
| Sysmon Event 25 |
ProcessTampering (image mismatch) |
| Access Mask 0x1FFFFF |
PROCESS_ALL_ACCESS -- full cross-process control |
Tools & Systems
| Tool |
Purpose |
| Sysmon |
Primary telemetry source for injection detection |
| Process Hacker |
Manual investigation of process memory regions |
| PE-sieve |
Scan running processes for hollowed/injected code |
| Moneta |
Detect anomalous memory regions in processes |
| Splunk / Elastic |
SIEM correlation of Sysmon events |
| Volatility |
Memory forensics for injection artifacts |
| Hollows Hunter |
Automated scan for hollowed processes |
Detection Queries
Splunk -- Remote Thread Creation
index=sysmon EventCode=8
| where SourceImage!=TargetImage
| where NOT match(SourceImage, "(?i)(csrss|lsass|services|svchost|MsMpEng|SecurityHealthService|vmtoolsd)\.exe$")
| eval suspicious=if(match(TargetImage, "(?i)(svchost|explorer|lsass|winlogon|csrss|services)\.exe$"), "high_value_target", "normal_target")
| where suspicious="high_value_target"
| table _time Computer SourceImage SourceProcessId TargetImage TargetProcessId StartFunction NewThreadId
Splunk -- Suspicious ProcessAccess Patterns
index=sysmon EventCode=10
| where SourceImage!=TargetImage
| where match(GrantedAccess, "(0x1FFFFF|0x1F3FFF|0x143A|0x0040)")
| where match(TargetImage, "(?i)(lsass|svchost|explorer|winlogon)\.exe$")
| where NOT match(SourceImage, "(?i)(MsMpEng|csrss|services|svchost|taskmgr|procexp)\.exe$")
| table _time Computer SourceImage TargetImage GrantedAccess CallTrace
KQL -- Process Injection via Remote Thread
DeviceEvents
| where Timestamp > ago(7d)
| where ActionType == "CreateRemoteThreadApiCall"
| where InitiatingProcessFileName !in~ ("csrss.exe", "lsass.exe", "services.exe", "svchost.exe")
| where FileName in~ ("svchost.exe", "explorer.exe", "lsass.exe", "winlogon.exe")
| project Timestamp, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
FileName, ProcessCommandLine
Sigma Rule -- Process Injection Detection
title: Process Injection via CreateRemoteThread into System Process
status: stable
logsource:
product: windows
category: create_remote_thread
detection:
selection:
TargetImage|endswith:
- '\svchost.exe'
- '\explorer.exe'
- '\lsass.exe'
- '\winlogon.exe'
filter_legitimate:
SourceImage|endswith:
- '\csrss.exe'
- '\lsass.exe'
- '\services.exe'
- '\MsMpEng.exe'
condition: selection and not filter_legitimate
level: high
tags:
- attack.defense_evasion
- attack.t1055
Common Scenarios
- Classic DLL Injection: Malware uses VirtualAllocEx + WriteProcessMemory + CreateRemoteThread to load a malicious DLL into a target process. Detected via Sysmon Event 8.
- Process Hollowing (RunPE): Attacker creates a suspended process, unmaps its image, writes malicious PE, and resumes execution. Detected via Sysmon Event 25.
- APC Injection: Malware queues an Asynchronous Procedure Call to threads of a target process using QueueUserAPC. Harder to detect, requires Event 10 monitoring.
- Reflective DLL Injection: DLL is loaded directly from memory without touching disk, bypassing ImageLoaded detection. Requires memory-level analysis.
- Process Doppelganging: Leverages NTFS transactions to replace a legitimate process image. Detected via process integrity checking.
Output Format
Hunt ID: TH-INJECT-[DATE]-[SEQ]
Host: [Hostname]
Source Process: [Injecting process path]
Source PID: [Process ID]
Target Process: [Target process path]
Target PID: [Process ID]
Injection Type: [DLL/Shellcode/Hollowing/APC]
Sysmon Events: [Event IDs triggered]
Access Mask: [Granted access value]
Risk Level: [Critical/High/Medium/Low]
ATT&CK Sub-Technique: [T1055.xxx]
1---
2name: detecting-t1055-process-injection-with-sysmon
3description: Detect process injection techniques (T1055) including classic DLL injection,
4 process hollowing, and APC injection by analyzing Sysmon events for cross-process
5 memory operations, remote thread creation, and anomalous DLL loading patterns.
6domain: cybersecurity
7subdomain: threat-hunting
8tags:
9- threat-hunting
10- process-injection
11- sysmon
12- mitre-t1055
13- defense-evasion
14- dll-injection
15- process-hollowing
16version: '1.0'
17author: mahipal
18license: Apache-2.0
19d3fend_techniques:
20- Executable Denylisting
21- Execution Isolation
22- File Metadata Consistency Validation
23- Content Format Conversion
24- File Content Analysis
25nist_csf:
26- DE.CM-01
27- DE.AE-02
28- DE.AE-07
29- ID.RA-05
30mitre_attack:
31- T1055.001
32- T1055.002
33- T1055.003
34- T1055.012
35source: https://github.com/mukul975/Anthropic-Cybersecurity-Skills
36source_commit: 04450304b12645cb2b974ab96d28c0664758a88d
37metadata:
38 source: https://skillmd.com/skills/yanacuti1121/detecting-t1055-process-injection-with-sysmon
39---
40
41# Detecting T1055 Process Injection with Sysmon
42
43## When to Use
44
45- When hunting for defense evasion techniques that hide malicious code inside legitimate processes
46- After EDR alerts for suspicious cross-process memory access or remote thread creation
47- When investigating malware that injects into svchost.exe, explorer.exe, or other system processes
48- During purple team exercises testing detection of process injection variants
49- When validating Sysmon configuration coverage for injection detection
50
51## Prerequisites
52
53- Sysmon deployed with comprehensive configuration capturing Events 1, 7, 8, 10, 25
54- Event ID 8 (CreateRemoteThread) enabled for remote thread detection
55- Event ID 10 (ProcessAccess) configured with appropriate access mask filters
56- Event ID 7 (ImageLoaded) for DLL injection detection
57- Event ID 25 (ProcessTampering) for process hollowing on Sysmon 13+
58- SIEM platform for correlation and alerting
59
60## Workflow
61
621. **Monitor CreateRemoteThread (Event 8)**: Detect when one process creates a thread in another process's address space. This is the primary indicator of classic DLL injection and shellcode injection.
632. **Analyze ProcessAccess (Event 10)**: Track cross-process handle requests with PROCESS_VM_WRITE (0x0020), PROCESS_VM_OPERATION (0x0008), and PROCESS_CREATE_THREAD (0x0002) access rights. Legitimate processes rarely need these on other processes.
643. **Detect Anomalous DLL Loading (Event 7)**: Identify DLLs loaded from unusual paths (user temp directories, download folders) into system processes.
654. **Hunt Process Hollowing (Event 25)**: Sysmon 13+ generates ProcessTampering events when the executable image in memory diverges from what was mapped from disk -- a hallmark of process hollowing (T1055.012).
665. **Correlate with Process Creation**: Link injection events to the originating process creation (Event 1) to build the full attack chain from initial execution to injection.
676. **Filter Known-Good Cross-Process Activity**: Exclude legitimate software that performs cross-process operations (debuggers, AV products, accessibility tools, RMM agents).
687. **Map to ATT&CK Sub-Techniques**: Classify detected injection as classic injection (T1055.001), PE injection (T1055.002), thread execution hijacking (T1055.003), APC injection (T1055.004), thread local storage (T1055.005), process hollowing (T1055.012), or process doppelganging (T1055.013).
69
70## Key Concepts
71
72| Concept | Description |
73|---------|-------------|
74| T1055.001 | Dynamic-link Library Injection |
75| T1055.002 | Portable Executable Injection |
76| T1055.003 | Thread Execution Hijacking |
77| T1055.004 | Asynchronous Procedure Call (APC) Injection |
78| T1055.005 | Thread Local Storage |
79| T1055.012 | Process Hollowing |
80| T1055.013 | Process Doppelganging |
81| T1055.015 | ListPlanting |
82| Sysmon Event 8 | CreateRemoteThread detected |
83| Sysmon Event 10 | ProcessAccess with memory write permissions |
84| Sysmon Event 25 | ProcessTampering (image mismatch) |
85| Access Mask 0x1FFFFF | PROCESS_ALL_ACCESS -- full cross-process control |
86
87## Tools & Systems
88
89| Tool | Purpose |
90|------|---------|
91| Sysmon | Primary telemetry source for injection detection |
92| Process Hacker | Manual investigation of process memory regions |
93| PE-sieve | Scan running processes for hollowed/injected code |
94| Moneta | Detect anomalous memory regions in processes |
95| Splunk / Elastic | SIEM correlation of Sysmon events |
96| Volatility | Memory forensics for injection artifacts |
97| Hollows Hunter | Automated scan for hollowed processes |
98
99## Detection Queries
100
101### Splunk -- Remote Thread Creation
102```spl
103index=sysmon EventCode=8
104| where SourceImage!=TargetImage
105| where NOT match(SourceImage, "(?i)(csrss|lsass|services|svchost|MsMpEng|SecurityHealthService|vmtoolsd)\.exe$")
106| eval suspicious=if(match(TargetImage, "(?i)(svchost|explorer|lsass|winlogon|csrss|services)\.exe$"), "high_value_target", "normal_target")
107| where suspicious="high_value_target"
108| table _time Computer SourceImage SourceProcessId TargetImage TargetProcessId StartFunction NewThreadId
109```
110
111### Splunk -- Suspicious ProcessAccess Patterns
112```spl
113index=sysmon EventCode=10
114| where SourceImage!=TargetImage
115| where match(GrantedAccess, "(0x1FFFFF|0x1F3FFF|0x143A|0x0040)")
116| where match(TargetImage, "(?i)(lsass|svchost|explorer|winlogon)\.exe$")
117| where NOT match(SourceImage, "(?i)(MsMpEng|csrss|services|svchost|taskmgr|procexp)\.exe$")
118| table _time Computer SourceImage TargetImage GrantedAccess CallTrace
119```
120
121### KQL -- Process Injection via Remote Thread
122```kql
123DeviceEvents
124| where Timestamp > ago(7d)
125| where ActionType == "CreateRemoteThreadApiCall"
126| where InitiatingProcessFileName !in~ ("csrss.exe", "lsass.exe", "services.exe", "svchost.exe")
127| where FileName in~ ("svchost.exe", "explorer.exe", "lsass.exe", "winlogon.exe")
128| project Timestamp, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
129 FileName, ProcessCommandLine
130```
131
132### Sigma Rule -- Process Injection Detection
133```yaml
134title: Process Injection via CreateRemoteThread into System Process
135status: stable
136logsource:
137 product: windows
138 category: create_remote_thread
139detection:
140 selection:
141 TargetImage|endswith:
142 - '\svchost.exe'
143 - '\explorer.exe'
144 - '\lsass.exe'
145 - '\winlogon.exe'
146 filter_legitimate:
147 SourceImage|endswith:
148 - '\csrss.exe'
149 - '\lsass.exe'
150 - '\services.exe'
151 - '\MsMpEng.exe'
152 condition: selection and not filter_legitimate
153level: high
154tags:
155 - attack.defense_evasion
156 - attack.t1055
157```
158
159## Common Scenarios
160
1611. **Classic DLL Injection**: Malware uses VirtualAllocEx + WriteProcessMemory + CreateRemoteThread to load a malicious DLL into a target process. Detected via Sysmon Event 8.
1622. **Process Hollowing (RunPE)**: Attacker creates a suspended process, unmaps its image, writes malicious PE, and resumes execution. Detected via Sysmon Event 25.
1633. **APC Injection**: Malware queues an Asynchronous Procedure Call to threads of a target process using QueueUserAPC. Harder to detect, requires Event 10 monitoring.
1644. **Reflective DLL Injection**: DLL is loaded directly from memory without touching disk, bypassing ImageLoaded detection. Requires memory-level analysis.
1655. **Process Doppelganging**: Leverages NTFS transactions to replace a legitimate process image. Detected via process integrity checking.
166
167## Output Format
168
169```
170Hunt ID: TH-INJECT-[DATE]-[SEQ]
171Host: [Hostname]
172Source Process: [Injecting process path]
173Source PID: [Process ID]
174Target Process: [Target process path]
175Target PID: [Process ID]
176Injection Type: [DLL/Shellcode/Hollowing/APC]
177Sysmon Events: [Event IDs triggered]
178Access Mask: [Granted access value]
179Risk Level: [Critical/High/Medium/Low]
180ATT&CK Sub-Technique: [T1055.xxx]
181```