← Back to SOC feed Coverage →

File Malware Detections Over Time (SharePoint, OneDrive and Teams)

kql MEDIUM Azure-Sentinel
T1566T1080
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-03T11:00:00Z · Confidence: medium

Hunt Hypothesis

This hypothesis targets adversaries leveraging phishing (T1566) to deliver malicious files that are subsequently executed or analyzed via cloud-based security controls (T1080) within Microsoft 365 services. Proactively hunting for sustained or anomalous spikes in malware detections across SharePoint, OneDrive, and Teams allows the SOC to identify persistent footholds or lateral movement attempts that may have been missed by real-time alerts, ensuring rapid containment before the threat propagates further through the organization’s collaborative platforms.

KQL Query

let TimeStart = startofday(ago(30d));
let TimeEnd = startofday(now());
FileMaliciousContentInfo
| where Timestamp >= TimeStart
| where isnotempty(ThreatTypes)
| make-series FileMalwareDetections = count() default = 0 on Timestamp from TimeStart to TimeEnd step 1d
| render timechart

Analytic Rule Definition

id: 1e361131-c7eb-4f7a-982f-a23d5d6a3490
name: File Malware Detections Over Time (SharePoint, OneDrive and Teams)
description: |
  This query shows the daily volume of file malware detections in SharePoint, OneDrive and Teams over the last 30 days, using the FileMaliciousContentInfo table.
description-detailed: |
  Microsoft Defender for Office 365 and the built-in SharePoint Online antivirus scan files uploaded to SharePoint, OneDrive and Teams. This query charts the daily count of files detected as malicious, so spikes and trends in collaboration-platform malware can be spotted and investigated.
  This query is part of the Microsoft Defender for Office 365 Detections and Insights workbook in Microsoft Sentinel: https://techcommunity.microsoft.com/blog/microsoftdefenderforoffice365blog/part-3-build-custom-email-security-reports-with-power-bi-and-workbooks-in-micros/4490127
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - FileMaliciousContentInfo
tactics:
  - InitialAccess
  - LateralMovement
relevantTechniques:
  - T1566
  - T1080
query: |
  let TimeStart = startofday(ago(30d));
  let TimeEnd = startofday(now());
  FileMaliciousContentInfo
  | where Timestamp >= TimeStart
  | where isnotempty(ThreatTypes)
  | make-series FileMalwareDetections = count() default = 0 on Timestamp from TimeStart to TimeEnd step 1d
  | 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/Malware/File Malware Detections Over Time.yaml