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