RUNBOOK // Phishing Triage, Scoping & Tenant-Wide Purge
COMMON INCIDENT
MDO / DEFENDER FOR OFFICE 365
Phishing remains the #1 initial access vector for credential theft, malware droppers, and business email compromise. This runbook details the rapid end-to-end triage procedure from user report to tenant-wide purge.
🛑 Step 1: Initial Email Analysis & Header Verification
Section titled “🛑 Step 1: Initial Email Analysis & Header Verification”Save the reported email as .eml or inspect headers in the Defender for Office 365 Explorer / Microsoft Message Header Analyzer:
Critical Header Inspection Points:
Section titled “Critical Header Inspection Points:”- SPF (Sender Policy Framework):
Received-SPF: passvs.fail/softfail.- Checks if sending server IP is authorized in sender domain DNS.
- DKIM (DomainKeys Identified Mail):
dkim=pass (signature verified)vs.fail.- Validates cryptographic body signature against sender’s public key.
- DMARC (Domain-based Message Authentication):
- Must achieve Alignment (SPF or DKIM domain must match the visible
From:header domain).
- Must achieve Alignment (SPF or DKIM domain must match the visible
- Mismatched Return-Path:
- Check if
Return-Path(envelope sender) differs from the friendlyFrom:address.
- Check if
- Display Name Spoofing:
- Attacker uses an executive’s name (e.g., “CEO Name”) with a free Gmail/Outlook address (
ceo.company@gmail.com).
- Attacker uses an executive’s name (e.g., “CEO Name”) with a free Gmail/Outlook address (
🔎 Step 2: Tenant-Wide Blast Radius Scoping (KQL)
Section titled “🔎 Step 2: Tenant-Wide Blast Radius Scoping (KQL)”Determine how many other users received this campaign across the organization.
1. KQL Query: Find All Inbound Messages in This Campaign
Section titled “1. KQL Query: Find All Inbound Messages in This Campaign”Query EmailEvents using the sender address, subject line, or sender IP:
let Lookback = 7d;let SuspectSubject = "Urgent: Review Shared Document";let SenderDomain = "malicious-notification.com";EmailEvents| where Timestamp > ago(Lookback)| where Subject has SuspectSubject or SenderFromDomain =~ SenderDomain or SenderIPv4 == "185.220.101.5"| project Timestamp, NetworkMessageId, InternetMessageId, RecipientEmailAddress, SenderFromAddress, Subject, DeliveryAction, DeliveryLocation| sort by Timestamp desc2. KQL Query: Did Any User Click the Malicious Link?
Section titled “2. KQL Query: Did Any User Click the Malicious Link?”Query EmailUrlInfo and join with UrlClickEvents to see clicks and SafeLinks verdict:
let Lookback = 3d;let SuspectUrl = "hxxps://verify-account-update[.]com";UrlClickEvents| where Timestamp > ago(Lookback)| where Url has "verify-account-update" or Url == SuspectUrl| project Timestamp, AccountUpn, ActionType, ClickVerdict, Url, IPAddress, Workload| sort by Timestamp descClickVerdict == 'Allowed'or'Blocked': If allowed, user actively reached the landing page. Proceed to credential compromise checklist immediately.
🧹 Step 3: Tenant-Wide Inbox Purge (Compliance Search & MDO)
Section titled “🧹 Step 3: Tenant-Wide Inbox Purge (Compliance Search & MDO)”Remove the phishing email from all recipient inboxes across Microsoft 365:
Method A: Automated PowerShell Compliance Search & Hard-Delete
Section titled “Method A: Automated PowerShell Compliance Search & Hard-Delete”# Connect to Exchange Online & Security Compliance Center# Connect-IPPSSession
$searchName = "PhishPurge_" + (Get-Date -Format "yyyyMMdd_HHmm")$subjectQuery = "Urgent: Review Shared Document"$senderQuery = "notifications@malicious-notification.com"
# 1. Create and start compliance search across all mailboxesNew-ComplianceSearch -Name $searchName -ExchangeLocation All -ContentMatchQuery "subject:`"$subjectQuery`" AND from:`"$senderQuery`""Start-ComplianceSearch -Identity $searchName
Write-Host "Waiting for search to finish indexing..." -ForegroundColor Yellowwhile ((Get-ComplianceSearch -Identity $searchName).Status -ne "Completed") { Start-Sleep -Seconds 5}
$results = Get-ComplianceSearch -Identity $searchNameWrite-Host "Found $($results.Items) items across $($results.SuccessResults) mailboxes." -ForegroundColor Green
# 2. Hard-Delete (Permanently removes from all user mailboxes & Recoverable Items)New-ComplianceSearchAction -SearchName $searchName -Purge -PurgeType HardDelete -Confirm:$falseWrite-Host "[+] Hard Delete action submitted." -ForegroundColor CyanMethod B: Microsoft Defender Portal (GUI Explorer)
Section titled “Method B: Microsoft Defender Portal (GUI Explorer)”- Navigate to Microsoft Defender Portal (
security.microsoft.com) $\rightarrow$ Email & collaboration $\rightarrow$ Explorer. - Filter by
SenderorSubjectorNetworkMessageId. - Select all affected messages $\rightarrow$ Click Take actions.
- Choose Move to Deleted Items or Hard delete.
- Log action name and reason for audit trail.
⚡ Step 4: Clicked-User Credential Containment
Section titled “⚡ Step 4: Clicked-User Credential Containment”If any user clicked and reached the destination page:
- Immediate Session Invalidation:
Terminal window Revoke-MgUserSignInSession -UserId "victim.user@company.com" - Force Password Reset:
Terminal window Update-MgUser -UserId "victim.user@company.com" -PasswordProfile @{ ForceChangePasswordNextSignIn = $true; Password = "TempPassword!2026" } - Audit Inbox Rules for Stealth Forwarders:
Terminal window Get-InboxRule -Mailbox "victim.user@company.com" | Select-Object Name, ForwardTo, RedirectTo, MoveToFolder - Block Malicious URL & Domain at Gateway:
- Add URL to Tenant Allow/Block List under Microsoft Defender Settings.
- Add destination IP/domain to perimeter firewall / Secure Web Gateway blocklist.