← Back to SOC feed Coverage →

File Malware by Top Malware Families (Safe Attachments)

kql MEDIUM Azure-Sentinel
T1566
CloudAppEvents
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-11T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may be exfiltrating malicious files through SharePoint, OneDrive, or Teams by leveraging known malware families to compromise organizational data. SOC teams should proactively hunt for this behavior to identify potential data exfiltration attempts and mitigate the risk of sensitive information being stolen.

KQL Query

CloudAppEvents
| where ActionType == 'FileMalwareDetected' and UserAgent =~ 'MS Scanner ATP'
| project ObjectName, UserAgent, RawinfoVirusInfo = RawEventData.VirusInfo
| summarize count() by tostring(RawinfoVirusInfo) | sort by count_
| render piechart
// | render columnchart // Uncomment to change the graph type

Analytic Rule Definition

id: afd90d9e-f8f5-41c7-823a-616907392503
name: File Malware by Top Malware Families (Safe Attachments)
description: |
  This query visualises total Malware detections of files located on SharePoint, OneDrive and Teams over time summarizing the data by the various Malware families detected focusing on Defender for Office 365 detections (detonations)
description-detailed: |
  This query visualises total Malware detections of files located on SharePoint, OneDrive and Teams over time summarizing the data by the various Malware families detected focusing on Defender for Office 365 detections (detonations)
  Query is also included as part of the Defender for Office 365 solution in Sentinel: https://techcommunity.microsoft.com/blog/microsoftdefenderforoffice365blog/part-2-build-custom-email-security-reports-and-dashboards-with-workbooks-in-micr/4411303
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - CloudAppEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  CloudAppEvents
  | where ActionType == 'FileMalwareDetected' and UserAgent =~ 'MS Scanner ATP'
  | project ObjectName, UserAgent, RawinfoVirusInfo = RawEventData.VirusInfo
  | summarize count() by tostring(RawinfoVirusInfo) | sort by count_
  | render piechart
  // | render columnchart // Uncomment to change the graph type
version: 1.0.0

Required Data Sources

Sentinel TableNotes
CloudAppEventsEnsure this data connector is enabled

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/Malware/File Malware Top Families by Safe Attachments.yaml