← Back to SOC feed Coverage →

Malicious Teams messages by URL detection methods

kql MEDIUM Azure-Sentinel
T1562
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-11T23:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may use malicious URLs embedded in Teams messages to deliver payloads or exfiltrate data, leveraging the trusted communication channel of Microsoft Teams. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify and mitigate potential command and control or data exfiltration activities early.

KQL Query

//This query helps reviewing malicious Teams message detections by URL detection methods
MessageEvents
| where isnotempty(DetectionMethods)
| extend MDO_detection = parse_json(DetectionMethods)
| summarize TotalMessageCount = count(),
           Phish_detection = countif(isnotempty(MDO_detection.Phish)),
           Malware_detection = countif(isnotempty(MDO_detection.Malware)),
           URL_malicious_reputation = countif(MDO_detection.Phish == @'["URL malicious reputation"]' or MDO_detection.Malware == @'["URL malicious reputation"]'),
           URL_detonation_reputation = countif(MDO_detection.Phish == @'["URL detonation reputation"]' or MDO_detection.Malware == @'["URL detonation reputation"]')
           by bin(Timestamp, 1d)
| project Timestamp, Phish_detection, Malware_detection,URL_malicious_reputation,URL_detonation_reputation
| render timechart

Analytic Rule Definition

id: 97c8d961-add7-4b58-80ef-75cc40d9d919
name:  Malicious Teams messages by URL detection methods
description: |
  This query helps reviewing malicious Teams message detections by URL detection methods 
description-detailed: |
  This query helps reviewing malicious Teams message detections by URL detection methods 
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - MessageEvents
tactics:
  - DefenseEvasion
relevantTechniques:
  - T1562
query: |
 //This query helps reviewing malicious Teams message detections by URL detection methods
 MessageEvents
 | where isnotempty(DetectionMethods)
 | extend MDO_detection = parse_json(DetectionMethods)
 | summarize TotalMessageCount = count(),
            Phish_detection = countif(isnotempty(MDO_detection.Phish)),
            Malware_detection = countif(isnotempty(MDO_detection.Malware)),
            URL_malicious_reputation = countif(MDO_detection.Phish == @'["URL malicious reputation"]' or MDO_detection.Malware == @'["URL malicious reputation"]'),
            URL_detonation_reputation = countif(MDO_detection.Phish == @'["URL detonation reputation"]' or MDO_detection.Malware == @'["URL detonation reputation"]')
            by bin(Timestamp, 1d)
 | project Timestamp, Phish_detection, Malware_detection,URL_malicious_reputation,URL_detonation_reputation
 | render timechart
version: 1.0.0

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Email and Collaboration Queries/Microsoft Teams protection/Malicious Teams messages by URL detection methods.yaml