← Back to SOC feed Coverage →

Enumeration of users & groups for lateral movement

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
backdoorhuntinglateral-movementmicrosoftofficial
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

Adversaries may enumerate users and groups in a network to identify potential targets for lateral movement, indicating reconnaissance activity. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect early signs of compromise and prevent further network infiltration.

KQL Query

DeviceProcessEvents 
| where Timestamp > ago(14d) 
| where FileName == 'net.exe' and AccountName != "" and ProcessCommandLine !contains '\\'  and ProcessCommandLine !contains '/add' 
| where (ProcessCommandLine contains ' user ' or ProcessCommandLine contains ' group ') and (ProcessCommandLine contains ' /do' or ProcessCommandLine contains ' /domain') 
| extend Target = extract("(?i)[user|group] (\"*[a-zA-Z0-9-_ ]+\"*)", 1, ProcessCommandLine) | filter Target  != '' 
| project AccountName, Target, ProcessCommandLine, DeviceName, Timestamp  
| sort by AccountName, Target

Analytic Rule Definition

id: dde6f931-559e-4e21-9409-6286de59771e
name: Enumeration of users & groups for lateral movement
description: |
  The query finds attempts to list users or groups using Net commands.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
query: |
  DeviceProcessEvents 
  | where Timestamp > ago(14d) 
  | where FileName == 'net.exe' and AccountName != "" and ProcessCommandLine !contains '\\'  and ProcessCommandLine !contains '/add' 
  | where (ProcessCommandLine contains ' user ' or ProcessCommandLine contains ' group ') and (ProcessCommandLine contains ' /do' or ProcessCommandLine contains ' /domain') 
  | extend Target = extract("(?i)[user|group] (\"*[a-zA-Z0-9-_ ]+\"*)", 1, ProcessCommandLine) | filter Target  != '' 
  | project AccountName, Target, ProcessCommandLine, DeviceName, Timestamp  
  | sort by AccountName, Target

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure 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/Enumeration of users & groups for lateral movement.yaml