Detecting Exchange Server Exploitation: Defender XDR and Sentinel Hunting Queries
Retrospective: this article looks back at events from March 2021, written in 2026 with the benefit of hindsight.
Exchange Server exploitation typically results in web shells and suspicious processes spawned by IIS worker processes. These are the key detections.
Signals worth watching
- The IIS worker process (
w3wp.exe) or Exchange processes (UMWorkerProcess.exe) spawningcmd.exe,powershell.exeor other unusual processes. - New
.aspxfiles in Exchange web directories (for example underinetpub\wwwroot\aspnet_clientor the ExchangeFrontEnd\HttpProxyfolders). - Suspicious requests in IIS logs to autodiscover or ECP endpoints matching published exploitation patterns.
- LSASS memory access from Exchange servers.
- Exports of mailboxes via PowerShell (
New-MailboxExportRequest) not initiated by admins.
Where the data lives
- Defender for Endpoint on Exchange servers.
- IIS logs and Exchange logs (forwarded to Sentinel).
- Windows event logs (MSExchange Management for cmdlet usage).
A starting query
DeviceProcessEvents
| where InitiatingProcessFileName in~ ("w3wp.exe", "UMWorkerProcess.exe")
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "rundll32.exe", "certutil.exe")
| project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine
File creation in web directories
DeviceFileEvents
| where FolderPath has_any (@"\inetpub\wwwroot\", @"\FrontEnd\HttpProxy\")
| where FileName endswith ".aspx" and ActionType == "FileCreated"
Response
- Isolate the server.
- Remove web shells and other persistence; consider rebuilding.
- Review mailbox exports and mail access.
- Reset credentials used on the server, and check Active Directory for new accounts or changes.
- ProxyLogon (Mar 2021): Exchange Server Zero-Days Exploited at Massive Scale Incident Teardowns
- How to Retire On-Premises Exchange or Harden the Hybrid Server You Must Keep How-To & Hardening
- CIO Brief: The Hidden Cost of Keeping Exchange On-Prem CIO Briefings