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, process hollowing, and DLL injection via Sysmon Event IDs 8 and 10 and EDR process telemetry. Use when detecting process injection techniques (t1055) including createremotethread, process hollowing, and.4license: Apache-2.05---678# Hunting for Process Injection Techniques910## Overview1112Process 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.131415## When to Use16**Trigger phrases:**17- "hunting for process injection techniques"18- "Detect process injection techniques (T1055) including CreateRemoteThread, proces"192021- When investigating security incidents that require hunting for process injection techniques22- When building detection rules or threat hunting queries for this domain23- When SOC analysts need structured procedures for this analysis type24- When validating security monitoring coverage for related attack techniques252627## When NOT to Use2829- When you lack proper authorization for testing30- For production systems without change management31- When the task requires legal or compliance expertise beyond technical scope323334## Prerequisites3536- Sysmon installed with Event IDs 8 and 10 enabled37- Process creation logs (Sysmon Event ID 1 or Windows 4688)38- Python 3.8+ with standard library39- JSON-formatted Sysmon event logs4041## Steps4243```python44# Example: IOC detection45import re4647IOC_PATTERNS = {48 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",49 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",50 "hash_md5": r"\b[a-f0-9]{32}\b",51 "hash_sha256": r"\b[a-f0-9]{64}\b",52}5354def extract_iocs(text: str) -> dict:55 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}56```57581. **Parse Sysmon Events** — Ingest Event IDs 1, 8, and 10 from JSON log files592. **Detect CreateRemoteThread** — Flag Event ID 8 with suspicious source-target process pairs603. **Analyze ProcessAccess Rights** — Identify Event ID 10 with dangerous access masks (PROCESS_VM_WRITE, PROCESS_CREATE_THREAD)614. **Build Process Relationship Graph** — Map source-to-target injection relationships625. **Filter Known Legitimate Pairs** — Exclude known benign injection patterns (AV, debuggers, system processes)636. **Score Injection Severity** — Apply risk scoring based on source process, target process, and access rights647. **Generate Hunt Report** — Produce structured report with MITRE sub-technique mapping6566## Expected Output6768- JSON report of detected injection events with severity scores69- Process injection relationship graph70- MITRE ATT&CK sub-technique mapping (T1055.001-T1055.012)71- False positive exclusion recommendations72## Red Flags7374- Performing actions without explicit written authorization from the asset owner75- Testing against production systems without a defined scope and rules of engagement76- Testing without rate limiting, potentially causing service degradation77- Storing sensitive test data (credentials, tokens) in plain text logs78- Using automated scanners blindly without reviewing results for false positives7980## Process81821. **Reconnaissance** — Gather target information, identify attack surface, enumerate services831. **Analysis/Exploitation** — Execute the technique, analyze results, document findings841. **Reporting** — Document IOCs, write findings, provide remediation recommendations8586## Verification8788- All steps executed successfully against a test environment before production use89- Output documented with screenshots or logs demonstrating expected behavior90- Vulnerabilities reproduced with proof-of-concept and impact analysis91- False positives filtered out through manual verification92- Fix recommendations include code-level remediation guidance9394## Anti-Rationalization Table9596| Rationalization | Reality |97|---|---|98| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |99| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |100| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |