Even though Microsoft provided a PowerShell command in April 2025 to disable the SMTP DirectSend feature in Exchange Online, we are still seeing attackers successfully reach the inbox for organizations that do not have their DMARC DNS Record set to Reject or Quarantine. According to public DNS, 30% of the Fortune 500 are vulnerable. Small to Medium orgs are even more likely to be exposed.
It is recommended to perform threat hunting to identify these emails.
Here is KQL we used to successfully detect DirectSend Phishing in Microsoft Defender XDR or Microsoft Sentinel (
security.microsoft.com)
EmailEvents
|where Timestamp > ago(30d)
| where EmailDirection == “Inbound”
| extend LeftPartSender = substring(SenderFromAddress, 0, indexof(SenderFromAddress, “@”))
| extend LeftPartRecipient = substring(RecipientEmailAddress, 0, indexof(RecipientEmailAddress, “@”))
| where LeftPartSender == LeftPartRecipient
| where isempty(Connectors) // not coming in on a connector
| where DeliveryLocation == “Inbox/folder”
| where parse_json(AuthenticationDetails) contains “fail”
| project Timestamp, RecipientEmailAddress, SenderFromAddress, Subject, NetworkMessageId, EmailDirection, Connectors, SenderIPv4
Threat hunting on the EmailEvents table requires the Microsoft Defender for Office P2 license. Otherwise, follow the MSFT reference links below for syntax on Historical Message Trace.
One of the easiest ways to detect DirectSend is when the sender and recipient are identical (which is typically unusual). We have observed cases where using an exact match of sender and recipient domain name does not detect all results. In some cases the sender domain is a MOERA domain (alias@tenant.mail.onmicrosoft.com) and they use a different alias on the same mailbox for the recipient address (such as the primary SMTP alias). We suspect this was done to evade the exact == comparison, so we updated the query above to look for the alias matching instead of domain matching (this resulted in finding additional results).
If you get too many results, try adding this where clause before the last project statement to reduce results:
| where Subject has_any (
'Pay Raise',
'Strategic Organizational Restructuring',
'Bonus Disbursement',
'Bonus Distribution',
'Merit-Based Pay',
'Compensation Bonus',
'Compensation Review',
'Wage Increase',
'Wages Increase',
'Incentive')
References:
thecloudtechnologist.com/202…
techcommunity.microsoft.com/…
techcommunity.microsoft.com/…
If you don't have a valid use of DirectSend you can disable it with this Exchange Online PowerShell cmdlet:
Set-OrganizationConfig -RejectDirectSend
$true