MDO (Office)
Introduction
Identify Email Attachments Send From Compromised Mailbox
// Define search parameters
let CompromisedMailbox = "user1@exampledomain.com"; // Specify the compromised mailbox
let SearchWindow = 48h; // Set the search window for analysis
// Query to analyze emails sent from the compromised mailbox with attachments
EmailEvents
| where Timestamp >= ago(SearchWindow) // Filter for events within the search window
| where SenderFromAddress == CompromisedMailbox // Focus on the compromised mailbox
| where AttachmentCount > 0 // Include only emails with attachments
| join kind=leftouter EmailAttachmentInfo on NetworkMessageId // Join with attachment info using NetworkMessageId
| project
Timestamp, // Email timestamp
NetworkMessageId, // Unique identifier for the email
SenderFromAddress, // Sender's email address
RecipientEmailAddress, // Recipient's email address
Subject, // Email subject
ThreatTypes, // Identified threats (if any)
SHA256 // Hash of the attachment
| join kind=leftouter DeviceFileEvents on SHA256 // Join with file events using attachment hash
| summarize
EmailRecipients = make_set(RecipientEmailAddress), // Aggregate unique email recipients
EmailSubjects = make_set(Subject), // Aggregate unique email subjects
DevicesWithFile = make_set(DeviceName) // Aggregate devices interacting with the attachment
by SHA256, NetworkMessageId // Group by attachment hash and email ID
| extend
TotalRecipients = array_length(EmailRecipients), // Count unique email recipients
DevicesWithFileInteraction = array_length(DevicesWithFile) // Count unique devices interacting with the file
//| order by Tim desc // Sort by the most recent email eventIdentifying Executable File Attachments Sent to Users
Search for Malware File Detected In Office 365
Identify Potential Phishing Campaign
Identifying Emails Categorised as Suspicious Delivered to Users
Identify User UrlClick Events
Reference
Last updated