← Back to SOC feed Coverage →

SMB shares discovery

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

Hunt Hypothesis

Processes accessing multiple IP addresses over port 445 may indicate adversary scanning for network shares, which is a common reconnaissance technique used to identify potential lateral movement or data exfiltration opportunities. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect early signs of network discovery and potential compromise.

KQL Query

DeviceNetworkEvents
| where RemotePort == 445 and Timestamp > ago(7d) 
    // Exclude Kernel processes, as they are too noisy in this query
    and InitiatingProcessId !in (0, 4)
| summarize RemoteIPCount=dcount(RemoteIP) by DeviceName, InitiatingProcessFileName, InitiatingProcessId, InitiatingProcessCreationTime
| where RemoteIPCount > 10

Analytic Rule Definition

id: a3dc6ecb-d910-467b-844e-a3b87744c4c9
name: SMB shares discovery
description: |
  Query for processes that accessed more than 10 IP addresses over port 445 (SMB) - possibly scanning for network shares.
  To read more about Network Share Discovery, see: https://attack.mitre.org/wiki/Technique/T1135.
  Tags: #SMB, #NetworkScanning, #UniqueProcessId.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceNetworkEvents
query: |
  DeviceNetworkEvents
  | where RemotePort == 445 and Timestamp > ago(7d) 
      // Exclude Kernel processes, as they are too noisy in this query
      and InitiatingProcessId !in (0, 4)
  | summarize RemoteIPCount=dcount(RemoteIP) by DeviceName, InitiatingProcessFileName, InitiatingProcessId, InitiatingProcessCreationTime
  | where RemoteIPCount > 10

Required Data Sources

Sentinel TableNotes
DeviceNetworkEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Discovery/SMB shares discovery.yaml