Malware Attack Investigation Runbook

SOC & DFIR Operations Guide

Environment: Windows AD | Microsoft 365 | Defender XDR | Sentinel | Entra ID | Palo Alto Prisma Access


Overview & Scope

This runbook provides standardised procedures for investigating malware-based attacks across the hybrid enterprise environment. It covers detection, triage, investigation, containment, eradication, and recovery workflows using Microsoft Defender XDR, Sentinel, and Palo Alto Prisma Access.

Malware Categories

Category
Description
Common Examples

Ransomware

Encrypts files, demands payment

LockBit, BlackCat, Cl0p, Play

Trojans

Disguised malicious software

Emotet, TrickBot, QakBot

RATs

Remote Access Trojans for persistent access

Cobalt Strike, AsyncRAT, RemcosRAT

Infostealers

Credential and data theft

RedLine, Raccoon, Vidar, Lumma

Loaders/Droppers

Initial access, downloads additional payloads

IcedID, BumbleBee, Gootloader

Rootkits

Deep system persistence, evasion

BlackLotus, various bootkits

Fileless Malware

Memory-resident, LOLBins abuse

PowerShell-based, WMI persistence

Worms

Self-propagating network threats

Various SMB/network worms

Cryptominers

Unauthorized cryptocurrency mining

XMRig variants

Wipers

Data destruction

HermeticWiper, CaddyWiper

Common Attack Vectors

Vector
Description
Primary Detection

Phishing Emails

Malicious attachments/links

MDO, EmailEvents

Drive-by Downloads

Compromised websites

MDE, Prisma URL filtering

Supply Chain

Compromised software updates

MDE, application allow-listing

Removable Media

USB-based infection

MDE, DeviceEvents

Exploitation

Vulnerability exploitation

MDE, DeviceEvents

Malvertising

Malicious advertisements

Prisma Access, MDE

Social Engineering

User manipulation

MDO, user reporting


Detection Sources & Data Mapping

Log Sources Matrix

Platform
Log Table
Key Data

Defender for Endpoint

DeviceEvents

Process creation, file operations, registry

Defender for Endpoint

DeviceProcessEvents

Process execution, command lines

Defender for Endpoint

DeviceNetworkEvents

Network connections, DNS queries

Defender for Endpoint

DeviceFileEvents

File creation, modification, deletion

Defender for Endpoint

DeviceRegistryEvents

Registry modifications

Defender for Endpoint

DeviceImageLoadEvents

DLL loads, driver loads

Defender for Endpoint

DeviceLogonEvents

Authentication events

Defender for Endpoint

AlertInfo, AlertEvidence

Correlated alerts and evidence

Defender for Office

EmailEvents, EmailAttachmentInfo

Email metadata, attachments

Defender for Office

EmailUrlInfo, UrlClickEvents

URLs in emails, click tracking

Sentinel

SecurityAlert

Aggregated alerts from all sources

Sentinel

ThreatIntelligenceIndicator

IOC matches

Prisma Access

PaloAltoPrismaAccess

Network threats, URL categories

Critical MDE Alert Categories

Alert Category
Description
Severity

Malware

Known malware detected

High-Critical

Ransomware

Ransomware behavior detected

Critical

Suspicious activity

Anomalous behavior patterns

Medium-High

Unwanted software

PUPs, adware, tools

Low-Medium

Exploit

Exploitation attempt detected

High-Critical

Persistence

Persistence mechanism detected

Medium-High

Lateral movement

Movement between systems

High

Command and control

C2 communication detected

High-Critical

Exfiltration

Data theft indicators

Critical

Defense evasion

Security tool tampering

High


Investigation Workflows

Malware Alert Triage

Objective: Quickly assess alert validity, determine scope, and prioritise response.

Step 1: Initial Alert Assessment

  1. Review alert in Defender XDR incident queue

  2. Check alert severity, category, and detection source

  3. Identify affected device(s) and user(s)

  4. Review MITRE ATT&CK techniques mapped to alert

  5. Check if alert is part of larger incident (auto-correlated)

Step 2: Validate Detection

  1. Review the specific file/process that triggered alert

  2. Check file hash against VirusTotal and internal threat intel

  3. Review file metadata: signer, compilation time, path

  4. Examine parent-child process relationships

  5. Determine if activity is expected (false positive check)

Step 3: Scope Assessment

  1. Search for same IOCs across all endpoints

  2. Check if other devices have similar alerts

  3. Review user's recent email for delivery vector

  4. Check network logs for related C2 traffic

  5. Identify patient zero and initial access timeline

Step 4: Risk Classification

Risk Level
Criteria
Action

🔴 Critical

Ransomware, active C2, domain admin compromise

Immediate isolation

🟠 High

Confirmed malware, lateral movement, data staging

Isolate within 30 min

🟡 Medium

Suspicious activity, potential malware

Investigate within 4 hours

🟢 Low

PUP, adware, likely false positive

Next business day


Ransomware Investigation

Objective: Contain ransomware spread, identify scope, preserve evidence, and enable recovery.

Immediate Actions (First 15 Minutes)

  1. Isolate affected devices via MDE device isolation

  2. Disable compromised accounts if credentials suspected stolen

  3. Block known IOCs at network perimeter (Prisma Access)

  4. Alert incident response team and leadership

  5. Preserve volatile evidence if possible

Step 1: Identify Ransomware Variant

  1. Review ransom note filename and content

  2. Check encrypted file extension

  3. Submit sample to threat intel platforms

  4. Identify known decryptors if available

  5. Document ransomware family and known TTPs

Step 2: Determine Patient Zero

  1. Query earliest file encryption events across environment

  2. Identify initial infected device by timestamp

  3. Review device timeline for initial access vector

  4. Check email logs for phishing delivery

  5. Examine network logs for exploitation attempts

Step 3: Map Lateral Movement

  1. Query authentication events from patient zero

  2. Identify all accessed systems and shares

  3. Check for credential harvesting tools (Mimikatz, etc.)

  4. Review network connections to other endpoints

  5. Document full scope of compromise

Step 4: Identify Data Exfiltration

  1. Check for large data transfers before encryption

  2. Review cloud storage uploads (OneDrive, SharePoint)

  3. Examine network traffic to unknown external IPs

  4. Check for staging directories

  5. Identify potentially exfiltrated data types

Step 5: Containment & Eradication

  1. Extend isolation to all affected devices

  2. Block all identified C2 infrastructure

  3. Reset credentials for affected users

  4. Remove persistence mechanisms

  5. Scan and clean all affected systems


Fileless Malware Investigation

Objective: Detect and investigate memory-resident and LOLBin-based malware.

Detection Indicators

  • PowerShell with encoded commands (-enc, -e, -encodedcommand)

  • WMI/CIM for execution or persistence

  • Unusual parent-child process relationships

  • LOLBAS tool abuse (certutil, mshta, regsvr32, rundll32)

  • .NET assembly loading in memory

  • Reflective DLL injection

  • Process hollowing indicators

Investigation Steps

  1. Review process command lines for obfuscation

  2. Decode Base64/encoded PowerShell commands

  3. Analyse script block logging events

  4. Check for WMI subscriptions and persistence

  5. Review scheduled tasks for suspicious entries

  6. Examine registry run keys and startup locations

  7. Analyse memory dumps if available

Key LOLBins to Monitor

Binary
Malicious Use
Detection

powershell.exe

Script execution, download cradles

Encoded commands, web requests

cmd.exe

Command execution

Unusual parent, obfuscation

mshta.exe

HTA execution, proxy execution

Network connections, child processes

certutil.exe

Download files, decode payloads

-urlcache, -decode flags

regsvr32.exe

Proxy execution, COM objects

/s /u /i: parameters

rundll32.exe

DLL execution, proxy

Unusual DLLs, network activity

wmic.exe

WMI queries, remote execution

/node:, process calls

msiexec.exe

MSI installation from URL

/q /i http://

bitsadmin.exe

File downloads

/transfer, /download

cscript/wscript

Script execution

Unusual scripts, network calls


Email-Based Malware Investigation

Objective: Investigate malware delivered via email, identify all recipients, and remediate.

Step 1: Identify Malicious Email

  1. Query EmailEvents for the malicious message

  2. Extract sender, subject, recipient(s), and timestamps

  3. Identify attachment details or malicious URLs

  4. Check if email passed or was caught by MDO

  5. Determine delivery status to all recipients

Step 2: Recipient Analysis

  1. List all recipients of the malicious email

  2. Identify who opened/clicked the email

  3. Check UrlClickEvents for link interactions

  4. Review endpoint alerts for recipients

  5. Prioritise users who interacted with content

Step 3: Email Artifact Analysis

  1. Extract and analyse attachment hashes

  2. Submit to sandbox for detonation

  3. Review URL reputation and redirects

  4. Check for known phishing kit indicators

  5. Document all IOCs from email

Step 4: Remediation

  1. Purge malicious email from all mailboxes

  2. Block sender domain/address

  3. Add URL/hash to block lists

  4. Notify users who received email

  5. Reset credentials if any user interacted


KQL Query Cheat Sheet

Device Process Analysis

Suspicious Process Execution

Process Tree Analysis

Encoded PowerShell Detection


Malware Detection Queries

New/Rare Executables

Suspicious File Drops

Ransomware Behaviour Detection


Network & C2 Detection

Suspicious Outbound Connections

Beaconing Detection

DNS Anomaly Detection


Persistence Detection

Registry Persistence

Scheduled Task Creation

Service Installation

WMI Persistence


Email Malware Queries

Malicious Attachment Hunt

URL Click Analysis

Emails with Password-Protected Attachments


Threat Hunting Queries

Hunt for Cobalt Strike Indicators

Hunt for Mimikatz Activity

Living Off the Land Detection


Response Actions & Remediation

Immediate Containment Actions

Scenario
Action
Method

Active Malware

Isolate device

MDE → Device page → Isolate device

Ransomware

Network isolation

Isolate + disable network shares

C2 Communication

Block C2 IPs/domains

Prisma Access + MDE custom indicators

Compromised Account

Disable account

Entra ID + on-prem AD

Malicious Email

Purge from mailboxes

MDO → Threat Explorer → Soft/Hard delete

Malicious File

Block by hash

MDE → Indicators → Add file hash

MDE Live Response Commands

Evidence Collection

Remediation Commands

Network Containment (Prisma Access)

Action
Location
Details

Block malicious URL

URL Filtering → Custom Categories

Add URL to block category

Block C2 IP

Security Policy → External Dynamic Lists

Add IP to block list

Block file hash

Threat Prevention → Antivirus

Add to custom signature

Isolate user traffic

GlobalProtect → HIP Profiles

Quarantine non-compliant

Post-Incident Remediation Checklist

Eradication

  • [ ] Remove all malware files from affected systems

  • [ ] Delete persistence mechanisms (registry, scheduled tasks, services)

  • [ ] Remove malicious accounts created by attacker

  • [ ] Clear cached credentials on affected systems

  • [ ] Reset passwords for compromised accounts

  • [ ] Revoke all sessions for affected users

  • [ ] Block all identified IOCs at all layers

Recovery

  • [ ] Restore systems from clean backups if needed

  • [ ] Rebuild compromised systems if necessary

  • [ ] Verify integrity of restored data

  • [ ] Re-enable disabled accounts after password reset

  • [ ] Remove device isolation in phases

  • [ ] Monitor recovered systems closely for 72 hours

Hardening

  • [ ] Patch exploited vulnerabilities

  • [ ] Review and tighten application control policies

  • [ ] Enable ASR rules relevant to attack technique

  • [ ] Update email filtering rules

  • [ ] Review firewall rules and network segmentation

  • [ ] Conduct user awareness training if phishing-based


Quick Reference Cards

Malware Analysis Checklist

Step
Action
Tools

1

Collect file hash (SHA256)

MDE, PowerShell

2

Check reputation

VirusTotal, MDE TI

3

Analyze strings

FLOSS, strings

4

Sandbox detonation

MDE Deep Analysis, Any.Run, Joe Sandbox

5

Review network IOCs

Sandbox report, Wireshark

6

Extract config

Malware-specific tools

7

Document TTPs

MITRE ATT&CK mapping

File Hash Quick Check

Common Malware File Locations

Location
Typical Use

%TEMP%

Initial payload drops

%APPDATA%

User-level persistence

%LOCALAPPDATA%

User-level persistence

%PROGRAMDATA%

System-wide persistence

C:\Users\Public

Shared access drops

%WINDIR%\Temp

System temp drops

%WINDIR%\Tasks

Scheduled task abuse

Recycle Bin ($Recycle.Bin)

Hidden storage

Attack Stage Indicators

Stage
Indicators
Data Source

Delivery

Phishing email, malicious download

EmailEvents, DeviceNetworkEvents

Exploitation

Vulnerability trigger, macro execution

DeviceEvents, DeviceProcessEvents

Installation

File drops, registry changes

DeviceFileEvents, DeviceRegistryEvents

C2

Beaconing, DNS queries

DeviceNetworkEvents

Actions

Data staging, lateral movement

DeviceFileEvents, DeviceLogonEvents

Exfiltration

Large transfers, cloud uploads

DeviceNetworkEvents, CloudAppEvents


Escalation Matrix

Severity Classification

Severity
Criteria
Response Time

🔴 Critical

Active ransomware, confirmed C2, data exfiltration in progress, wiper malware

Immediate - 15 min

🟠 High

Confirmed malware execution, lateral movement, credential theft tools

30 min - 1 hour

🟡 Medium

Suspicious execution blocked, potential malware, single endpoint

4 hours

🟢 Low

PUP detected, adware, blocked download attempt

Next business day

Escalation Triggers

Condition
Escalation Level

>5 endpoints with same malware

Tier 2 SOC

Any ransomware detection

Tier 2 SOC + DFIR

Domain controller affected

DFIR + Identity Team + Leadership

Confirmed data exfiltration

DFIR + Legal + Leadership

Supply chain compromise suspected

DFIR + Leadership + External IR

Critical business system affected

DFIR + Business Owner + Leadership

Communication Templates

Initial Notification (Internal)


MITRE ATT&CK Mapping

Initial Access

Technique
ID
Detection
KQL Table

Phishing: Attachment

T1566.001

Malicious attachment detected

EmailAttachmentInfo

Phishing: Link

T1566.002

Malicious URL clicked

UrlClickEvents

Drive-by Compromise

T1189

Browser exploitation

DeviceProcessEvents

Supply Chain

T1195

Compromised software

DeviceFileEvents

External Remote Services

T1133

VPN/RDP compromise

DeviceLogonEvents

Execution

Technique
ID
Detection
KQL Table

PowerShell

T1059.001

Encoded commands, download cradles

DeviceProcessEvents

Command Shell

T1059.003

Suspicious cmd.exe usage

DeviceProcessEvents

Windows Script Host

T1059.005

VBS/JS execution

DeviceProcessEvents

Mshta

T1218.005

HTA execution

DeviceProcessEvents

Regsvr32

T1218.010

Proxy execution

DeviceProcessEvents

Rundll32

T1218.011

DLL side-loading

DeviceProcessEvents

Persistence

Technique
ID
Detection
KQL Table

Registry Run Keys

T1547.001

Run key modification

DeviceRegistryEvents

Scheduled Task

T1053.005

Task creation

DeviceEvents

Services

T1543.003

Service installation

DeviceEvents

WMI Subscription

T1546.003

WMI filter/consumer

DeviceEvents

Boot/Logon Scripts

T1037

Startup script

DeviceRegistryEvents

Defense Evasion

Technique
ID
Detection
KQL Table

Process Injection

T1055

Remote thread creation

DeviceEvents

Masquerading

T1036

Renamed executables

DeviceProcessEvents

Obfuscated Files

T1027

Encoded payloads

DeviceProcessEvents

Disable Security Tools

T1562

AV/EDR tampering

DeviceEvents

Indicator Removal

T1070

Log clearing

DeviceEvents

Credential Access

Technique
ID
Detection
KQL Table

LSASS Dump

T1003.001

LSASS access

DeviceEvents

SAM Dump

T1003.002

Registry SAM access

DeviceRegistryEvents

Credential Dumping

T1003

Mimikatz execution

DeviceProcessEvents

Keylogging

T1056.001

Keylogger installation

DeviceEvents

Command & Control

Technique
ID
Detection
KQL Table

HTTP/HTTPS

T1071.001

Web traffic to C2

DeviceNetworkEvents

DNS

T1071.004

DNS tunneling

DeviceNetworkEvents

Non-Standard Port

T1571

Unusual ports

DeviceNetworkEvents

Encrypted Channel

T1573

SSL/TLS to C2

DeviceNetworkEvents

Exfiltration

Technique
ID
Detection
KQL Table

Exfil Over C2

T1041

Large uploads to C2

DeviceNetworkEvents

Exfil Over Web

T1567

Cloud storage uploads

CloudAppEvents

Automated Exfil

T1020

Scheduled transfers

DeviceNetworkEvents


Appendix: Useful Commands

PowerShell Investigation

MDE Advanced Hunting in PowerShell

Network Analysis

Memory Analysis Prep

Evidence Collection Script


⚠️ Important: This runbook should be tested regularly through tabletop exercises and updated after each significant incident to incorporate lessons learned and emerging malware techniques.

Last updated