Conducting Malware Incident Response
When to Use
- EDR or antivirus detects malware execution on one or more endpoints
- A user reports suspicious system behavior indicative of malware infection
- Threat intelligence indicates a malware campaign targeting the organization's industry
- Network monitoring detects beaconing traffic consistent with known malware C2 patterns
- A file detonation in a sandbox returns a malicious verdict
Do not use for analyzing malware samples in a research context; use dedicated malware analysis procedures for reverse engineering.
Prerequisites
- EDR platform with process tree visibility and host isolation capability
- Malware sandbox environment (Cuckoo, ANY.RUN, Joe Sandbox, Hybrid Analysis)
- Access to threat intelligence platforms for malware family identification (VirusTotal, MalwareBazaar)
- Forensic imaging tools for evidence preservation (FTK Imager, KAPE)
- Clean system images or gold images for endpoint rebuild
- MITRE ATT&CK framework reference for technique mapping
Workflow
Step 1: Detect and Confirm Malware Presence
Validate the malware alert and gather initial indicators:
- Review EDR alert details: detection name, file path, hash (SHA-256), process tree
- Check if the detection is a known malware family or generic heuristic detection
- Query the file hash against VirusTotal, MalwareBazaar, and internal threat intelligence
- Examine the process execution chain to determine how the malware was delivered
Detection Summary:
File: C:\Users\jsmith\AppData\Local\Temp\update.exe
SHA-256: a1b2c3d4e5f6...
Detection: CrowdStrike: Malware/Qakbot | VirusTotal: 58/72 engines
Parent: WINWORD.EXE → cmd.exe → powershell.exe → update.exe
Delivery: Email attachment (Invoice-Nov2025.docm)
Network: HTTPS POST to 185.220.101[.]42:443 every 60s
Persistence: Scheduled Task "WindowsUpdate" → update.exe
Step 2: Scope the Infection
Determine how many systems are affected and the malware's propagation method:
- Use EDR to search for the malware hash, filename, and behavioral indicators across all endpoints
- Check for network-based spreading (SMB, WMI, PsExec, exploitation)
- Query email gateway logs for all recipients of the delivery email
- Search for C2 communications to the identified infrastructure from other internal hosts
- Check for persistence mechanisms on all identified infected hosts
Step 3: Contain Infected Systems
Execute containment per the active breach containment procedures:
- Network-isolate infected endpoints via EDR containment
- Block malware C2 infrastructure at firewall and DNS
- Block the malware hash in EDR prevention policy organization-wide
- Quarantine the delivery email from all mailboxes (if email-delivered)
- Disable compromised user accounts if credential theft is suspected
Step 4: Analyze the Malware
Perform sufficient analysis to support complete eradication:
- Submit the sample to a sandbox for dynamic analysis (behavioral report, dropped files, network IOCs)
- Identify all persistence mechanisms: registry keys, scheduled tasks, services, WMI subscriptions, startup folders
- Document all file system artifacts: dropped files, modified files, created directories
- Extract network IOCs: C2 domains, IPs, URLs, user agents, JA3/JA3S hashes
- Map observed behaviors to MITRE ATT&CK techniques
Malware Analysis Summary - Qakbot Variant
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Initial Access: T1566.001 - Spearphishing Attachment (.docm)
Execution: T1059.001 - PowerShell (encoded downloader)
Persistence: T1053.005 - Scheduled Task
Defense Evasion: T1055.012 - Process Hollowing (explorer.exe)
C2: T1071.001 - HTTPS with custom headers
Collection: T1005 - Data from Local System (browser credentials)
Exfiltration: T1041 - Exfiltration Over C2 Channel
Artifacts:
- C:\Users\*\AppData\Local\Temp\update.exe (dropper)
- C:\ProgramData\Microsoft\{GUID}\config.dll (payload)
- HKCU\Software\Microsoft\Windows\CurrentVersion\Run\{random} (backup persistence)
- Scheduled Task: "WindowsUpdate" (primary persistence)
Step 5: Eradicate the Malware
Remove all malware artifacts from every infected system:
- Terminate malicious processes and injected threads
- Delete malware files from all identified paths
- Remove persistence mechanisms (scheduled tasks, registry keys, services, WMI subscriptions)
- Clear browser credential stores if credential harvesting was confirmed
- Run a full EDR scan to verify no artifacts remain
- If eradication confidence is low, reimage the system from a known-clean gold image
Step 6: Recover and Validate
Restore systems to production and verify clean status:
- Reconnect contained systems to the network in stages
- Monitor for 72 hours for any recurrence of malware indicators
- Force password resets for all users on infected endpoints
- Verify that C2 traffic has completely ceased across the environment
- Update detection rules based on newly discovered IOCs from the investigation
- Distribute IOCs to threat intelligence sharing partners (ISAC, MISP)
Key Concepts
| Term |
Definition |
| Malware Family |
Classification of malware variants sharing code, infrastructure, or behavior patterns (e.g., Qakbot, Emotet, Cobalt Strike) |
| Process Hollowing |
Technique where malware creates a legitimate process in a suspended state, replaces its memory with malicious code, then resumes execution |
| Beacon |
Periodic network communication from malware to its C2 server, typically with a set interval and jitter for detection evasion |
| Dropper |
Initial malware component that downloads or unpacks the primary payload; often delivered via phishing |
| Persistence Mechanism |
Method used by malware to survive system reboots (registry run keys, scheduled tasks, services, WMI event subscriptions) |
| IOC (Indicator of Compromise) |
Observable artifact such as file hash, IP address, domain, or registry key that indicates malware presence |
Tools & Systems
- CrowdStrike Falcon / Microsoft Defender for Endpoint: EDR platforms for detection, containment, and threat hunting
- ANY.RUN / Joe Sandbox: Interactive malware sandboxes for dynamic behavioral analysis
- VirusTotal / MalwareBazaar: Malware intelligence platforms for sample identification and IOC enrichment
- KAPE (Kroll Artifact Parser and Extractor): Forensic triage tool for rapid artifact collection from infected endpoints
- YARA: Pattern-matching engine for creating custom malware detection rules based on observed indicators
Common Scenarios
Scenario: Emotet Loader Leading to Cobalt Strike Deployment
Context: EDR detects a macro-enabled document that spawns PowerShell, downloads an Emotet DLL, which subsequently loads a Cobalt Strike beacon. Three hosts are infected within 45 minutes.
Approach:
- Immediately isolate all three hosts and block C2 IPs at the perimeter
- Search email gateway for all recipients of the original phishing email and quarantine it
- Sweep all endpoints for the Emotet DLL hash and Cobalt Strike beacon indicators
- Analyze the Cobalt Strike beacon configuration to extract watermark, C2 profile, and staging URLs
- Check for credential harvesting (Mimikatz/LSASS dump) and lateral movement artifacts
- Eradicate all malware artifacts and reset credentials for affected users
Pitfalls:
- Focusing only on Emotet and missing the Cobalt Strike second-stage payload
- Failing to extract and block the Cobalt Strike Malleable C2 profile indicators
- Not checking for additional persistence beyond the initial detection (Emotet often installs multiple backup persistence mechanisms)
Output Format
MALWARE INCIDENT RESPONSE REPORT
=================================
Incident: INC-2025-1547
Malware Family: Qakbot (variant: Obama265)
Delivery Vector: Spearphishing attachment (Invoice-Nov2025.docm)
First Detection: 2025-11-15T14:23:17Z
Scope: 4 endpoints confirmed infected
INFECTION TIMELINE
14:18 UTC - Phishing email received by jsmith@corp.example.com
14:19 UTC - Macro executed in WINWORD.EXE
14:20 UTC - PowerShell downloads update.exe from staging server
14:21 UTC - update.exe establishes persistence (Scheduled Task)
14:23 UTC - C2 beacon initiated to 185.220.101[.]42
14:35 UTC - Lateral spread to WKSTN-087 via stolen credentials
14:42 UTC - EDR detection fires, SOC alerted
IOCs EXTRACTED
File Hashes: [SHA-256 list]
C2 Domains: [domain list]
C2 IPs: [IP list]
File Paths: [artifact paths]
ERADICATION STATUS
[x] All malware artifacts removed from 4 hosts
[x] Persistence mechanisms deleted
[x] C2 infrastructure blocked
[x] Compromised credentials reset
[x] Email quarantined from all mailboxes
RECOMMENDATIONS
1. Deploy YARA rule for Qakbot variant detection
2. Block macro execution in documents from external senders
3. Implement application whitelisting on finance workstations
1---2name: conducting-malware-incident-response3description: Responds to malware infections across enterprise endpoints by identifying the malware family, determining infection vectors, assessing spread, and executing eradication procedures. Covers the full lifecycle from detection through containment, analysis, removal, and recovery. Activates for requests involving malware response, malware eradication, trojan removal, worm containment, malware triage, or infected endpoint remediation.4license: Apache-2.05---6
7# Conducting Malware Incident Response
8
9## When to Use
10
11- EDR or antivirus detects malware execution on one or more endpoints
12- A user reports suspicious system behavior indicative of malware infection
13- Threat intelligence indicates a malware campaign targeting the organization's industry
14- Network monitoring detects beaconing traffic consistent with known malware C2 patterns
15- A file detonation in a sandbox returns a malicious verdict
16
17**Do not use** for analyzing malware samples in a research context; use dedicated malware analysis procedures for reverse engineering.
18
19## Prerequisites
20
21- EDR platform with process tree visibility and host isolation capability
22- Malware sandbox environment (Cuckoo, ANY.RUN, Joe Sandbox, Hybrid Analysis)
23- Access to threat intelligence platforms for malware family identification (VirusTotal, MalwareBazaar)
24- Forensic imaging tools for evidence preservation (FTK Imager, KAPE)
25- Clean system images or gold images for endpoint rebuild
26- MITRE ATT&CK framework reference for technique mapping
27
28## Workflow
29
30### Step 1: Detect and Confirm Malware Presence
31
32Validate the malware alert and gather initial indicators:
33
34- Review EDR alert details: detection name, file path, hash (SHA-256), process tree
35- Check if the detection is a known malware family or generic heuristic detection
36- Query the file hash against VirusTotal, MalwareBazaar, and internal threat intelligence
37- Examine the process execution chain to determine how the malware was delivered
38
39```
40Detection Summary:
41File: C:\Users\jsmith\AppData\Local\Temp\update.exe
42SHA-256: a1b2c3d4e5f6...
43Detection: CrowdStrike: Malware/Qakbot | VirusTotal: 58/72 engines
44Parent: WINWORD.EXE → cmd.exe → powershell.exe → update.exe
45Delivery: Email attachment (Invoice-Nov2025.docm)
46Network: HTTPS POST to 185.220.101[.]42:443 every 60s
47Persistence: Scheduled Task "WindowsUpdate" → update.exe
48```
49
50### Step 2: Scope the Infection
51
52Determine how many systems are affected and the malware's propagation method:
53
54- Use EDR to search for the malware hash, filename, and behavioral indicators across all endpoints
55- Check for network-based spreading (SMB, WMI, PsExec, exploitation)
56- Query email gateway logs for all recipients of the delivery email
57- Search for C2 communications to the identified infrastructure from other internal hosts
58- Check for persistence mechanisms on all identified infected hosts
59
60### Step 3: Contain Infected Systems
61
62Execute containment per the active breach containment procedures:
63
64- Network-isolate infected endpoints via EDR containment
65- Block malware C2 infrastructure at firewall and DNS
66- Block the malware hash in EDR prevention policy organization-wide
67- Quarantine the delivery email from all mailboxes (if email-delivered)
68- Disable compromised user accounts if credential theft is suspected
69
70### Step 4: Analyze the Malware
71
72Perform sufficient analysis to support complete eradication:
73
74- Submit the sample to a sandbox for dynamic analysis (behavioral report, dropped files, network IOCs)
75- Identify all persistence mechanisms: registry keys, scheduled tasks, services, WMI subscriptions, startup folders
76- Document all file system artifacts: dropped files, modified files, created directories
77- Extract network IOCs: C2 domains, IPs, URLs, user agents, JA3/JA3S hashes
78- Map observed behaviors to MITRE ATT&CK techniques
79
80```
81Malware Analysis Summary - Qakbot Variant
82━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
83Initial Access: T1566.001 - Spearphishing Attachment (.docm)
84Execution: T1059.001 - PowerShell (encoded downloader)
85Persistence: T1053.005 - Scheduled Task
86Defense Evasion: T1055.012 - Process Hollowing (explorer.exe)
87C2: T1071.001 - HTTPS with custom headers
88Collection: T1005 - Data from Local System (browser credentials)
89Exfiltration: T1041 - Exfiltration Over C2 Channel
90
91Artifacts:
92- C:\Users\*\AppData\Local\Temp\update.exe (dropper)
93- C:\ProgramData\Microsoft\{GUID}\config.dll (payload)
94- HKCU\Software\Microsoft\Windows\CurrentVersion\Run\{random} (backup persistence)
95- Scheduled Task: "WindowsUpdate" (primary persistence)
96```
97
98### Step 5: Eradicate the Malware
99
100Remove all malware artifacts from every infected system:
101
102- Terminate malicious processes and injected threads
103- Delete malware files from all identified paths
104- Remove persistence mechanisms (scheduled tasks, registry keys, services, WMI subscriptions)
105- Clear browser credential stores if credential harvesting was confirmed
106- Run a full EDR scan to verify no artifacts remain
107- If eradication confidence is low, reimage the system from a known-clean gold image
108
109### Step 6: Recover and Validate
110
111Restore systems to production and verify clean status:
112
113- Reconnect contained systems to the network in stages
114- Monitor for 72 hours for any recurrence of malware indicators
115- Force password resets for all users on infected endpoints
116- Verify that C2 traffic has completely ceased across the environment
117- Update detection rules based on newly discovered IOCs from the investigation
118- Distribute IOCs to threat intelligence sharing partners (ISAC, MISP)
119
120## Key Concepts
121
122| Term | Definition |
123|------|------------|
124| **Malware Family** | Classification of malware variants sharing code, infrastructure, or behavior patterns (e.g., Qakbot, Emotet, Cobalt Strike) |
125| **Process Hollowing** | Technique where malware creates a legitimate process in a suspended state, replaces its memory with malicious code, then resumes execution |
126| **Beacon** | Periodic network communication from malware to its C2 server, typically with a set interval and jitter for detection evasion |
127| **Dropper** | Initial malware component that downloads or unpacks the primary payload; often delivered via phishing |
128| **Persistence Mechanism** | Method used by malware to survive system reboots (registry run keys, scheduled tasks, services, WMI event subscriptions) |
129| **IOC (Indicator of Compromise)** | Observable artifact such as file hash, IP address, domain, or registry key that indicates malware presence |
130
131## Tools & Systems
132
133- **CrowdStrike Falcon / Microsoft Defender for Endpoint**: EDR platforms for detection, containment, and threat hunting
134- **ANY.RUN / Joe Sandbox**: Interactive malware sandboxes for dynamic behavioral analysis
135- **VirusTotal / MalwareBazaar**: Malware intelligence platforms for sample identification and IOC enrichment
136- **KAPE (Kroll Artifact Parser and Extractor)**: Forensic triage tool for rapid artifact collection from infected endpoints
137- **YARA**: Pattern-matching engine for creating custom malware detection rules based on observed indicators
138
139## Common Scenarios
140
141### Scenario: Emotet Loader Leading to Cobalt Strike Deployment
142
143**Context**: EDR detects a macro-enabled document that spawns PowerShell, downloads an Emotet DLL, which subsequently loads a Cobalt Strike beacon. Three hosts are infected within 45 minutes.
144
145**Approach**:
1461. Immediately isolate all three hosts and block C2 IPs at the perimeter
1472. Search email gateway for all recipients of the original phishing email and quarantine it
1483. Sweep all endpoints for the Emotet DLL hash and Cobalt Strike beacon indicators
1494. Analyze the Cobalt Strike beacon configuration to extract watermark, C2 profile, and staging URLs
1505. Check for credential harvesting (Mimikatz/LSASS dump) and lateral movement artifacts
1516. Eradicate all malware artifacts and reset credentials for affected users
152
153**Pitfalls**:
154- Focusing only on Emotet and missing the Cobalt Strike second-stage payload
155- Failing to extract and block the Cobalt Strike Malleable C2 profile indicators
156- Not checking for additional persistence beyond the initial detection (Emotet often installs multiple backup persistence mechanisms)
157
158## Output Format
159
160```
161MALWARE INCIDENT RESPONSE REPORT
162=================================
163Incident: INC-2025-1547
164Malware Family: Qakbot (variant: Obama265)
165Delivery Vector: Spearphishing attachment (Invoice-Nov2025.docm)
166First Detection: 2025-11-15T14:23:17Z
167Scope: 4 endpoints confirmed infected
168
169INFECTION TIMELINE
17014:18 UTC - Phishing email received by jsmith@corp.example.com
17114:19 UTC - Macro executed in WINWORD.EXE
17214:20 UTC - PowerShell downloads update.exe from staging server
17314:21 UTC - update.exe establishes persistence (Scheduled Task)
17414:23 UTC - C2 beacon initiated to 185.220.101[.]42
17514:35 UTC - Lateral spread to WKSTN-087 via stolen credentials
17614:42 UTC - EDR detection fires, SOC alerted
177
178IOCs EXTRACTED
179File Hashes: [SHA-256 list]
180C2 Domains: [domain list]
181C2 IPs: [IP list]
182File Paths: [artifact paths]
183
184ERADICATION STATUS
185[x] All malware artifacts removed from 4 hosts
186[x] Persistence mechanisms deleted
187[x] C2 infrastructure blocked
188[x] Compromised credentials reset
189[x] Email quarantined from all mailboxes
190
191RECOMMENDATIONS
1921. Deploy YARA rule for Qakbot variant detection
1932. Block macro execution in documents from external senders
1943. Implement application whitelisting on finance workstations
195```