This hypothesis targets phishing campaigns (T1566) where adversaries use malicious URLs to compromise users, detected through anomalies in Safe Links click outcomes and distinct URL volumes in email traffic. Proactively hunting for these metrics in Azure Sentinel allows the SOC to identify emerging phishing trends or targeted attacks before they result in successful credential theft or malware execution.
let clicks = UrlClickEvents | where Timestamp > ago(30d);
union
(clicks | where ActionType in ("ClickBlocked","ClickBlockedByTenantPolicy") | summarize Count = count() | extend Details = "Malicious Clicks Blocked", Ord = 1),
(clicks | where ActionType == "ClickAllowed" | summarize Count = count() | extend Details = "Clicks Allowed Through", Ord = 2),
(clicks | summarize Count = dcount(AccountUpn) | extend Details = "Users Clicking Links", Ord = 3),
(EmailUrlInfo | where Timestamp > ago(30d) | summarize Count = dcount(Url) | extend Details = "Distinct URLs in Email", Ord = 4)
| sort by Ord asc
| project Count, Details
id: 074959c6-2e9d-4f11-b9c8-971b7387aa99
name: URL Threat Protection Summary
description: |
This query summarises URL threat protection activity (Safe Links click outcomes and distinct URLs seen in email) as a set of headline metrics for the selected period.
description-detailed: |
This query summarises URL threat protection activity in Microsoft Defender for Office 365 as headline metrics: malicious clicks blocked, clicks allowed through, distinct users clicking links (from UrlClickEvents), and distinct URLs seen in email (from EmailUrlInfo).
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
dataTypes:
- UrlClickEvents
- EmailUrlInfo
tactics:
- InitialAccess
relevantTechniques:
- T1566
query: |
let clicks = UrlClickEvents | where Timestamp > ago(30d);
union
(clicks | where ActionType in ("ClickBlocked","ClickBlockedByTenantPolicy") | summarize Count = count() | extend Details = "Malicious Clicks Blocked", Ord = 1),
(clicks | where ActionType == "ClickAllowed" | summarize Count = count() | extend Details = "Clicks Allowed Through", Ord = 2),
(clicks | summarize Count = dcount(AccountUpn) | extend Details = "Users Clicking Links", Ord = 3),
(EmailUrlInfo | where Timestamp > ago(30d) | summarize Count = dcount(Url) | extend Details = "Distinct URLs in Email", Ord = 4)
| sort by Ord asc
| project Count, Details
version: 1.0.0
| Sentinel Table | Notes |
|---|---|
EmailUrlInfo | Ensure this data connector is enabled |
UrlClickEvents | Ensure this data connector is enabled |
mailchimp.com, hubspot.net) or filter out clicks from service accounts and distribution groups (e.g., *@marketing.internal, hr-announcements@corp.com) to isolate unique human-initiated traffic.svc-url-scanner, admin-gateway) or filter by user agent strings containing PowerShell, Python-urllib, or curl if the telemetry source captures client metadata, to distinguish automated validation from user interaction.it-test-user01, qa-team@corp.com) or apply a time-based exclusion during known maintenance windows (e.g., 2024-05-15 02:00:00Z to 2024-05-15 04:00:00Z) when template testing is scheduled.