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.
//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
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
userType is “Guest” and whose createdDateTime falls within the last 24–48 hours, or correlate with recent “User Invited” audit logs in Microsoft Graph.displayName matches known bot naming conventions (e.g., *Bot, *Service, *Integration).userPrincipalName contains domain suffixes associated with known contractor pools (e.g., @contractor.com, @tempstaff.org) or those with a jobTitle field containing “Contractor” or “Consultant” in Azure AD.messageCount is low (e.g.,