← Back to SOC feed Coverage →

First-Contact External Teams Senders

kql MEDIUM Azure-Sentinel
T1566
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-09-03T23:00:00Z · Confidence: medium

Hunt Hypothesis

This hypothesis targets T1566 (Phishing) by identifying external Microsoft Teams users who are initiating contact for the first time, a common precursor to social engineering attacks or compromised account usage. Proactively hunting for these first-contact senders allows the SOC to validate new external identities and assess their legitimacy before they can establish a foothold or deliver malicious payloads within the collaboration environment.

KQL Query

//This query lists external Microsoft Teams senders by the date they were first seen over the last 30 days, surfacing recent first-contact senders.
MessageEvents
| where Timestamp > ago(30d)
| summarize FirstTimestamp = min(Timestamp), arg_max(Timestamp, *) by TeamsMessageId
| where IsExternalThread == true
| summarize FirstSeen = min(FirstTimestamp), Messages = count(), ThreatMessages = countif(isnotempty(ThreatTypes)) by SenderEmailAddress
| top 20 by FirstSeen desc
| project ['Sender']=SenderEmailAddress, ['First Seen']=FirstSeen, ['Messages']=Messages, ['Threat Messages']=ThreatMessages

Analytic Rule Definition

id: 667772be-deff-4c7e-9da6-ada1780cc45c
name: First-Contact External Teams Senders
description: |
  This query lists external Microsoft Teams senders by the date they were first seen, surfacing recent first-contact senders.
description-detailed: |
  This query lists external Microsoft Teams senders by the date they were first seen over the last 30 days, surfacing recent first-contact senders, using Advanced hunting in Microsoft Defender XDR. First contact from an unknown external sender is a common precursor to social-engineering.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - MessageEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  //This query lists external Microsoft Teams senders by the date they were first seen over the last 30 days, surfacing recent first-contact senders.
  MessageEvents
  | where Timestamp > ago(30d)
  | summarize FirstTimestamp = min(Timestamp), arg_max(Timestamp, *) by TeamsMessageId
  | where IsExternalThread == true
  | summarize FirstSeen = min(FirstTimestamp), Messages = count(), ThreatMessages = countif(isnotempty(ThreatTypes)) by SenderEmailAddress
  | top 20 by FirstSeen desc
  | project ['Sender']=SenderEmailAddress, ['First Seen']=FirstSeen, ['Messages']=Messages, ['Threat Messages']=ThreatMessages
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/First-Contact External Teams Senders.yaml