T1590.004 Microsoft Sentinel · KQL

Detect Network Topology in Microsoft Sentinel

Adversaries may gather information about the victim's network topology that can be used during targeting. This includes physical and logical arrangement of external-facing and internal network environments, network devices such as gateways and routers, and routing infrastructure. Threat actors like Volt Typhoon and Salt Typhoon have conducted extensive network topology reconnaissance to identify critical infrastructure paths, upstream/downstream network segments, and inter-network connectivity before executing intrusion campaigns. Detection focuses on two surfaces: (1) network discovery tool execution on managed endpoints indicating an insider or post-compromise enumeration phase, and (2) external scanning patterns visible in perimeter logs indicating pre-compromise reconnaissance by external actors.

MITRE ATT&CK

Tactic
Reconnaissance
Technique
T1590 Gather Victim Network Information
Sub-technique
T1590.004 Network Topology
Canonical reference
https://attack.mitre.org/techniques/T1590/004/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let NetworkDiscoveryTools = dynamic([
  "nmap", "masscan", "zmap", "unicornscan",
  "netdiscover", "angry ip scanner", "advanced ip scanner",
  "lansweeper", "angry", "nbtscan", "arp-scan"
]);
let NetworkTopoCmds = dynamic([
  "tracert", "traceroute", "pathping", "tracepath",
  "route print", "netstat -r", "ip route",
  "arp -a", "arp -n", "Get-NetRoute", "Get-NetNeighbor",
  "snmpwalk", "snmpget", "snmpenum",
  "nmap -sn", "nmap --traceroute", "nmap -O",
  "show ip route", "show cdp neighbors", "show lldp"
]);
let SuspiciousNetworkPorts = dynamic([161, 162, 179, 520, 521, 646, 2049, 8291]);
// Branch 1: Endpoint-based network discovery tool execution
let EndpointDiscovery = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (NetworkDiscoveryTools)
      or ProcessCommandLine has_any (NetworkTopoCmds)
      or (FileName =~ "nmap.exe" or FileName =~ "masscan.exe" or FileName =~ "zmap.exe")
| extend DetectionBranch = "EndpointDiscoveryTool"
| extend RiskIndicator = case(
    ProcessCommandLine has_any ("snmpwalk", "snmpget", "snmpenum"), "SNMP_Enumeration",
    ProcessCommandLine has_any ("nmap -O", "nmap --os-detection"), "OS_Fingerprinting",
    ProcessCommandLine has_any ("tracert", "traceroute", "pathping", "tracepath"), "Route_Tracing",
    ProcessCommandLine has_any ("nmap -sn", "netdiscover", "arp -a", "arp-scan"), "Host_Discovery",
    ProcessCommandLine has_any ("Get-NetRoute", "route print", "ip route", "netstat -r"), "Routing_Table_Enum",
    "General_Network_Discovery"
  )
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         DetectionBranch, RiskIndicator;
// Branch 2: SNMP and network protocol scanning via network events
let SNMPScanning = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemotePort in (SuspiciousNetworkPorts)
| where RemoteIPType == "Public" or RemoteIP !startswith "127."
| summarize TargetCount=dcount(RemoteIP), Ports=make_set(RemotePort), FirstSeen=min(Timestamp), LastSeen=max(Timestamp)
    by DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine
| where TargetCount > 5
| extend DetectionBranch = "BroadcastProtocolScanning"
| extend RiskIndicator = "Multi_Host_Protocol_Scan"
| extend Timestamp = FirstSeen
| project Timestamp, DeviceName, AccountName="", FileName=InitiatingProcessFileName,
         ProcessCommandLine=InitiatingProcessCommandLine, InitiatingProcessFileName="",
         InitiatingProcessCommandLine="", DetectionBranch, RiskIndicator;
union EndpointDiscovery, SNMPScanning
| sort by Timestamp desc
medium severity medium confidence

Detects network topology reconnaissance activity via two branches. Branch 1 identifies execution of known network discovery tools (nmap, masscan, traceroute, snmpwalk, arp-scan) and PowerShell routing/neighbor cmdlets on managed endpoints using DeviceProcessEvents. Branch 2 detects broad scanning of network management protocol ports (SNMP UDP/161, BGP TCP/179, RIP UDP/520) against multiple hosts using DeviceNetworkEvents. Risk indicators categorize the enumeration type for analyst prioritization.

Data Sources

Process: Process CreationNetwork Traffic: Network Connection CreationMicrosoft Defender for Endpoint

Required Tables

DeviceProcessEventsDeviceNetworkEvents

False Positives & Tuning

  • Network engineers running nmap or traceroute for legitimate troubleshooting or change management activities
  • IT asset management systems (Lansweeper, SolarWinds, Nessus) performing scheduled network discovery scans
  • SNMP-based monitoring tools (PRTG, Zabbix, Nagios) polling network devices on UDP/161
  • BGP route monitoring scripts querying routing tables for network health dashboards
  • Penetration testing engagements with authorized scanners operating from managed endpoints
Download portable Sigma rule (.yml)

Other platforms for T1590.004


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Network Topology Discovery via Traceroute and Route Table Enumeration

    Expected signal: Sysmon Event ID 1: Process Create events for route.exe, tracert.exe, arp.exe, netstat.exe with their respective command lines. Sysmon Event ID 11: File Create event for route_output.txt in %TEMP%. Sysmon Event ID 3: Network connections from tracert.exe to 8.8.8.8 and intermediate hops. Security Event ID 4688 (if process auditing enabled) for each spawned process.

  2. Test 2SNMP Network Device Topology Enumeration

    Expected signal: Auditd/Sysmon-for-Linux process execution event for snmpwalk with command line containing OIDs .1.3.6.1.2.1.4.22 (ARP table) and .1.3.6.1.2.1.4.24 (routing table). Network connection event (UDP/161) to target host. File creation event for /tmp/snmp_arp_output.txt. Syslog entries from snmpd if local daemon receives the query.

  3. Test 3PowerShell Network Neighbor and Route Enumeration

    Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Get-NetRoute', 'Get-NetNeighbor', 'Get-NetIPAddress', 'ConvertTo-Json'. PowerShell ScriptBlock Log Event ID 4104 with full script content. Sysmon Event ID 11: File Create event for network_topology.json in %TEMP%.

  4. Test 4Nmap Host Discovery and OS Detection Scan

    Expected signal: Sysmon Event ID 1: Process Create for nmap.exe with CommandLine containing '-sn', '-O', '--osscan-guess', '-oX'. Multiple Sysmon Event ID 3 network connection events for ICMP and TCP probes across the /24 range. Sysmon Event ID 11: File Create events for nmap_discovery.xml and nmap_osdetect.xml in %TEMP%.

  5. Test 5BGP and Routing Protocol Reconnaissance via Netstat

    Expected signal: Auditd/Sysmon-for-Linux process execution events for netstat, ss, ip with command lines containing routing protocol ports (179 BGP, 520 RIP, 646 LDP). File creation events for /tmp/routing_protocols.txt, /tmp/routing_table_full.txt, /tmp/arp_cache.txt. If Sysmon for Linux installed: Event ID 1 (Process Create) for each command.

Unlock Pro Content

Get the full detection package for T1590.004 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections