Query Details
// https://www.bleepingcomputer.com/news/security/microsoft-365-direct-send-abused-to-send-phishing-as-internal-users/ DeviceEvents | where Timestamp > ago(1h) | where ActionType == "DnsQueryResponse" | extend QueryName = tolower(tostring(parse_json(AdditionalFields)["DnsQueryString"])) | where QueryName endswith "-com.mail.protection.outlook.com"
This query is designed to analyze device events in order to identify potential phishing activities involving Microsoft 365. Here's a simple breakdown of what it does:
Data Source: It looks at DeviceEvents, which are records of various actions and events that occur on devices.
Time Filter: It only considers events that happened within the last hour (Timestamp > ago(1h)).
Action Type: It specifically focuses on events where the action type is DnsQueryResponse. This means it is interested in responses to DNS queries, which are requests made to translate domain names into IP addresses.
Extracting DNS Query: It extracts the DNS query string from additional fields in the event data, converts it to lowercase, and assigns it to a new field called QueryName.
Domain Filter: Finally, it filters these DNS queries to find those that end with -com.mail.protection.outlook.com. This pattern is associated with Microsoft's email protection service, which could be used in phishing attempts.
In summary, this query is looking for DNS query responses related to Microsoft's email protection service within the last hour, which could indicate potential phishing activities using Microsoft 365.

Steven Lim
Released: June 26, 2025
Tables
Keywords
Operators