Hunting for Process Injection Techniques
Overview
Process injection (MITRE ATT&CK T1055) allows adversaries to execute code in the address space of another process, enabling defense evasion and privilege escalation. This skill detects injection techniques via Sysmon Event ID 8 (CreateRemoteThread), Event ID 10 (ProcessAccess with suspicious access rights), and analysis of source-target process relationships to distinguish legitimate from malicious injection.
When to Use
Trigger phrases:
"hunting for process injection techniques"
"Detect process injection techniques (T1055) including CreateRemoteThread, proces"
When investigating security incidents that require hunting for process injection techniques
When building detection rules or threat hunting queries for this domain
When SOC analysts need structured procedures for this analysis type
When validating security monitoring coverage for related attack techniques
When NOT to Use
- When you lack proper authorization for testing
- For production systems without change management
- When the task requires legal or compliance expertise beyond technical scope
Prerequisites
- Sysmon installed with Event IDs 8 and 10 enabled
- Process creation logs (Sysmon Event ID 1 or Windows 4688)
- Python 3.8+ with standard library
- JSON-formatted Sysmon event logs
Steps
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Parse Sysmon Events — Ingest Event IDs 1, 8, and 10 from JSON log files
- Detect CreateRemoteThread — Flag Event ID 8 with suspicious source-target process pairs
- Analyze ProcessAccess Rights — Identify Event ID 10 with dangerous access masks (PROCESS_VM_WRITE, PROCESS_CREATE_THREAD)
- Build Process Relationship Graph — Map source-to-target injection relationships
- Filter Known Legitimate Pairs — Exclude known benign injection patterns (AV, debuggers, system processes)
- Score Injection Severity — Apply risk scoring based on source process, target process, and access rights
- Generate Hunt Report — Produce structured report with MITRE sub-technique mapping
Expected Output
- JSON report of detected injection events with severity scores
- Process injection relationship graph
- MITRE ATT&CK sub-technique mapping (T1055.001-T1055.012)
- False positive exclusion recommendations
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Testing without rate limiting, potentially causing service degradation
- Storing sensitive test data (credentials, tokens) in plain text logs
- Using automated scanners blindly without reviewing results for false positives
Process
- Reconnaissance — Gather target information, identify attack surface, enumerate services
- Analysis/Exploitation — Execute the technique, analyze results, document findings
- Reporting — Document IOCs, write findings, provide remediation recommendations
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- Vulnerabilities reproduced with proof-of-concept and impact analysis
- False positives filtered out through manual verification
- Fix recommendations include code-level remediation guidance
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: hunting-for-process-injection-techniques3description: Use when detect process injection techniques (T1055) including CreateRemoteThread,4 process hollowing, and DLL injection via Sysmon Event IDs 8 and 10 and EDR process5 telemetry. Use when detecting process injection techniques (t1055) including createremotethread,6 process hollowing, and.7domain: cybersecurity8subdomain: threat-hunting9tags:10- process-injection11- t105512- sysmon13- createremotethread14- dll-injection15- edr16- threat-hunting17version: '1.0'18author: oyi7719license: Apache-2.020d3fend_techniques:21- Executable Denylisting22- Execution Isolation23- File Metadata Consistency Validation24- Content Format Conversion25- File Content Analysis26nist_csf:27- DE.CM-0128- DE.AE-0229- DE.AE-0730- ID.RA-0531category: cybersecurity32metadata:33 source: https://skillmd.com/skills/oyi77/hunting-for-process-injection-techniques34---353637# Hunting for Process Injection Techniques3839## Overview4041Process injection (MITRE ATT&CK T1055) allows adversaries to execute code in the address space of another process, enabling defense evasion and privilege escalation. This skill detects injection techniques via Sysmon Event ID 8 (CreateRemoteThread), Event ID 10 (ProcessAccess with suspicious access rights), and analysis of source-target process relationships to distinguish legitimate from malicious injection.424344## When to Use45**Trigger phrases:**46- "hunting for process injection techniques"47- "Detect process injection techniques (T1055) including CreateRemoteThread, proces"484950- When investigating security incidents that require hunting for process injection techniques51- When building detection rules or threat hunting queries for this domain52- When SOC analysts need structured procedures for this analysis type53- When validating security monitoring coverage for related attack techniques545556## When NOT to Use5758- When you lack proper authorization for testing59- For production systems without change management60- When the task requires legal or compliance expertise beyond technical scope616263## Prerequisites6465- Sysmon installed with Event IDs 8 and 10 enabled66- Process creation logs (Sysmon Event ID 1 or Windows 4688)67- Python 3.8+ with standard library68- JSON-formatted Sysmon event logs6970## Steps7172```python73# Example: IOC detection74import re7576IOC_PATTERNS = {77 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",78 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",79 "hash_md5": r"\b[a-f0-9]{32}\b",80 "hash_sha256": r"\b[a-f0-9]{64}\b",81}8283def extract_iocs(text: str) -> dict:84 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}85```86871. **Parse Sysmon Events** — Ingest Event IDs 1, 8, and 10 from JSON log files882. **Detect CreateRemoteThread** — Flag Event ID 8 with suspicious source-target process pairs893. **Analyze ProcessAccess Rights** — Identify Event ID 10 with dangerous access masks (PROCESS_VM_WRITE, PROCESS_CREATE_THREAD)904. **Build Process Relationship Graph** — Map source-to-target injection relationships915. **Filter Known Legitimate Pairs** — Exclude known benign injection patterns (AV, debuggers, system processes)926. **Score Injection Severity** — Apply risk scoring based on source process, target process, and access rights937. **Generate Hunt Report** — Produce structured report with MITRE sub-technique mapping9495## Expected Output9697- JSON report of detected injection events with severity scores98- Process injection relationship graph99- MITRE ATT&CK sub-technique mapping (T1055.001-T1055.012)100- False positive exclusion recommendations101## Red Flags102103- Performing actions without explicit written authorization from the asset owner104- Testing against production systems without a defined scope and rules of engagement105- Testing without rate limiting, potentially causing service degradation106- Storing sensitive test data (credentials, tokens) in plain text logs107- Using automated scanners blindly without reviewing results for false positives108109## Process1101111. **Reconnaissance** — Gather target information, identify attack surface, enumerate services1121. **Analysis/Exploitation** — Execute the technique, analyze results, document findings1131. **Reporting** — Document IOCs, write findings, provide remediation recommendations114115## Verification116117- All steps executed successfully against a test environment before production use118- Output documented with screenshots or logs demonstrating expected behavior119- Vulnerabilities reproduced with proof-of-concept and impact analysis120- False positives filtered out through manual verification121- Fix recommendations include code-level remediation guidance122123## Anti-Rationalization Table124125| Rationalization | Reality |126|---|---|127| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |128| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |129| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |