Detecting Process Injection Techniques
Overview
Cybersecurity skill for detecting process injection techniques. Follows industry best practices and security standards.
When to Use
Trigger phrases:
"detecting process injection techniques"
"Detects and analyzes process injection techniques used by malware including clas"
EDR alerts on suspicious API call sequences (VirtualAllocEx + WriteProcessMemory + CreateRemoteThread)
A legitimate process (explorer.exe, svchost.exe) exhibits unexpected network connections or file operations
Memory forensics reveals executable code in memory regions that should not contain it
Investigating living-off-the-land attacks where malware hides inside trusted processes
Building detection logic for specific injection techniques in EDR or SIEM rules
Do not use for standard DLL loading analysis; injection implies unauthorized code placement in a process without that process's cooperation.
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
- Volatility 3 for memory forensics analysis of injection artifacts
- Sysmon configured with Event IDs 8 (CreateRemoteThread) and 10 (ProcessAccess)
- API Monitor or x64dbg for observing injection API calls in real-time
- Process Hacker or Process Explorer for inspecting process memory regions
- Understanding of Windows memory management (VirtualAlloc, VAD, page protections)
- Isolated analysis environment for safe malware execution and monitoring
Workflow
# 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()}
- Define Detection Scope — Identify the specific process injection techniques techniques or indicators to hunt. Map to MITRE ATT&CK tactics/techniques where applicable.
- Collect Baseline Data — Gather historical logs and establish normal behavior patterns for process injection techniques.
- Build Detection Queries — Write detection rules, Sigma rules, or SIEM queries targeting process injection techniques indicators.
- Execute Hunts — Run queries against the collected data, starting with broad filters and narrowing down.
- Triage Results — Investigate alerts, filter false positives, and validate findings against known-good behavior.
- Document Findings — Record confirmed detections, IOCs, and affected systems. Update detection rules based on findings.
Tools
- SIEM Platform — Central log aggregation and query execution
- Sigma Rules — Vendor-agnostic detection rule format
- MITRE ATT&CK Navigator — Technique mapping and coverage analysis
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
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: detecting-process-injection-techniques3description: Use when detects and analyzes process injection techniques used by malware4 including classic DLL injection, process hollowing, APC injection, thread hijacking,5 and reflective loading. Uses memory forensics, API monitoring, and behavioral analysis6 to identify injection artifacts. Activates for requests involving process injection7 detection, code injection analysis, hollowed process investigation, or in-memory8 threat detection. . Use when working with detecting process injection techniques.9domain: cybersecurity10tags:11- malware12- process-injection13- detection14- memory-forensics15- defense-evasion16subdomain: malware-analysis17version: 1.0.018author: oyi7719license: Apache-2.020d3fend_techniques:21- Executable Denylisting22- Execution Isolation23- File Metadata Consistency Validation24- Content Format Conversion25- File Content Analysis26nist_csf:27- DE.AE-0228- RS.AN-0329- ID.RA-0130- DE.CM-0131category: cybersecurity32metadata:33 source: https://skillmd.com/skills/oyi77/detecting-process-injection-techniques34---3536# Detecting Process Injection Techniques3738## Overview3940Cybersecurity skill for detecting process injection techniques. Follows industry best practices and security standards.4142## When to Use43**Trigger phrases:**44- "detecting process injection techniques"45- "Detects and analyzes process injection techniques used by malware including clas"464748- EDR alerts on suspicious API call sequences (VirtualAllocEx + WriteProcessMemory + CreateRemoteThread)49- A legitimate process (explorer.exe, svchost.exe) exhibits unexpected network connections or file operations50- Memory forensics reveals executable code in memory regions that should not contain it51- Investigating living-off-the-land attacks where malware hides inside trusted processes52- Building detection logic for specific injection techniques in EDR or SIEM rules5354**Do not use** for standard DLL loading analysis; injection implies unauthorized code placement in a process without that process's cooperation.555657## When NOT to Use5859- When you lack proper authorization for testing60- For production systems without change management61- When the task requires legal or compliance expertise beyond technical scope626364## Prerequisites6566- Volatility 3 for memory forensics analysis of injection artifacts67- Sysmon configured with Event IDs 8 (CreateRemoteThread) and 10 (ProcessAccess)68- API Monitor or x64dbg for observing injection API calls in real-time69- Process Hacker or Process Explorer for inspecting process memory regions70- Understanding of Windows memory management (VirtualAlloc, VAD, page protections)71- Isolated analysis environment for safe malware execution and monitoring7273## Workflow7475```python76# Example: IOC detection77import re7879IOC_PATTERNS = {80 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",81 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",82 "hash_md5": r"\b[a-f0-9]{32}\b",83 "hash_sha256": r"\b[a-f0-9]{64}\b",84}8586def extract_iocs(text: str) -> dict:87 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}88```89901. **Define Detection Scope** — Identify the specific process injection techniques techniques or indicators to hunt. Map to MITRE ATT&CK tactics/techniques where applicable.912. **Collect Baseline Data** — Gather historical logs and establish normal behavior patterns for process injection techniques.923. **Build Detection Queries** — Write detection rules, Sigma rules, or SIEM queries targeting process injection techniques indicators.934. **Execute Hunts** — Run queries against the collected data, starting with broad filters and narrowing down.945. **Triage Results** — Investigate alerts, filter false positives, and validate findings against known-good behavior.956. **Document Findings** — Record confirmed detections, IOCs, and affected systems. Update detection rules based on findings.9697## Tools9899- **SIEM Platform** — Central log aggregation and query execution100- **Sigma Rules** — Vendor-agnostic detection rule format101- **MITRE ATT&CK Navigator** — Technique mapping and coverage analysis102103104## Process1051061. **Reconnaissance** — Gather target information, identify attack surface, enumerate services1071. **Analysis/Exploitation** — Execute the technique, analyze results, document findings1081. **Reporting** — Document IOCs, write findings, provide remediation recommendations109110## Verification111112- [ ] All process injection techniques procedures executed completely and documented113- [ ] Findings validated against multiple data sources114- [ ] False positives identified and filtered115- [ ] Results documented with evidence and timestamps116- [ ] Recommendations provided with risk-based prioritization117118## Anti-Rationalization Table119120| Rationalization | Reality |121|---|---|122| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |123| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |124| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |