← Back to SOC feed Coverage →

Discover hosts doing possible network scans

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

Hosts exhibiting high-volume network queries to specific RemoteIPs, RemotePorts, and Process names may indicate automated network scanning activity. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential reconnaissance efforts by adversaries before they escalate to data exfiltration or lateral movement.

KQL Query

let remotePortCountThreshold = 10; // Please change the min value, for a host reaching out to remote ports on a remote IP, that you consider to be threshold for a suspicious behavior 
DeviceNetworkEvents
| where Timestamp > ago(1d) and RemoteIP startswith "172.16" or RemoteIP startswith "192.168" 
| summarize
    by DeviceName, RemoteIP, RemotePort, InitiatingProcessFileName
| summarize RemotePortCount=dcount(RemotePort) by DeviceName, RemoteIP, InitiatingProcessFileName
| where RemotePortCount > remotePortCountThreshold

Analytic Rule Definition

id: 525f2ae5-5d11-4404-a0c5-bbd402c57c3f
name: Discover hosts doing possible network scans
description: |
  Looking for high volume queries against a given RemoteIP, per DeviceName, RemotePort and Process.
  Please change the Timestamp window according your preference/objective, as also the subnet ranges that you want to analyze against.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceNetworkEvents
query: |
  let remotePortCountThreshold = 10; // Please change the min value, for a host reaching out to remote ports on a remote IP, that you consider to be threshold for a suspicious behavior 
  DeviceNetworkEvents
  | where Timestamp > ago(1d) and RemoteIP startswith "172.16" or RemoteIP startswith "192.168" 
  | summarize
      by DeviceName, RemoteIP, RemotePort, InitiatingProcessFileName
  | summarize RemotePortCount=dcount(RemotePort) by DeviceName, RemoteIP, InitiatingProcessFileName
  | where RemotePortCount > remotePortCountThreshold

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/Discover hosts doing possible network scans.yaml