T1069.002 Microsoft Sentinel · KQL

Detect Domain Groups in Microsoft Sentinel

Adversaries may attempt to find domain-level groups and permission settings. The knowledge of domain-level permission groups can help adversaries determine which groups exist and which users belong to a particular group. Adversaries may use this information to determine which users have elevated permissions, such as domain administrators. Commands such as net group /domain, dscacheutil -q group on macOS, and ldapsearch on Linux can list domain-level groups. Tools such as BloodHound, AdFind, and AD Explorer are also commonly used for this purpose by threat actors including OilRig, FIN7, Volt Typhoon, LAPSUS$, and ToddyCat.

MITRE ATT&CK

Tactic
Discovery
Technique
T1069 Permission Groups Discovery
Sub-technique
T1069.002 Domain Groups
Canonical reference
https://attack.mitre.org/techniques/T1069/002/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let DomainGroupCommands = dynamic([
  "net group", "net localgroup /domain",
  "Get-ADGroup", "Get-ADGroupMember",
  "dsquery group", "dsget group",
  "adfind", "AdFind",
  "ldapsearch",
  "dscacheutil",
  "Get-DomainGroup", "Get-NetGroup",
  "PowerView",
  "System.DirectoryServices",
  "DirectorySearcher",
  "samAccountType",
  "objectClass=group"
]);
let SuspiciousTools = dynamic([
  "adfind.exe", "AdFind.exe",
  "SharpHound.exe", "bloodhound.exe",
  "ADExplorer.exe", "adexplorer64.exe",
  "ldapsearch"
]);
let NetGroupEvents = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "net.exe" or FileName =~ "net1.exe"
| where ProcessCommandLine has "group" and (
    ProcessCommandLine has "/domain" or
    ProcessCommandLine has "domain admins" or
    ProcessCommandLine has "enterprise admins" or
    ProcessCommandLine has "domain controllers" or
    ProcessCommandLine has "schema admins" or
    ProcessCommandLine has "group policy creator"
  )
| extend DetectionSource = "net group /domain";
let PowerShellADEvents = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any ("Get-ADGroup", "Get-ADGroupMember", "Get-DomainGroup", "Get-NetGroup", "DirectorySearcher", "objectClass=group", "samAccountType")
| extend DetectionSource = "PowerShell AD Group Enumeration";
let ToolBasedEvents = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (SuspiciousTools)
| extend DetectionSource = "Known AD Enumeration Tool";
let DSQueryEvents = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("dsquery.exe", "dsget.exe")
| where ProcessCommandLine has "group"
| extend DetectionSource = "dsquery/dsget group enumeration";
union NetGroupEvents, PowerShellADEvents, ToolBasedEvents, DSQueryEvents
| extend IsElevatedContext = AccountName in~ ("Administrator", "SYSTEM") or InitiatingProcessFileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe")
| extend TargetingPrivilegedGroups = ProcessCommandLine has_any ("domain admins", "enterprise admins", "schema admins", "administrators", "domain controllers")
| project Timestamp, DeviceName, AccountName, AccountDomain, FileName,
         ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine,
         InitiatingProcessAccountName, DetectionSource, IsElevatedContext, TargetingPrivilegedGroups
| sort by Timestamp desc
medium severity high confidence

Detects domain group enumeration activity using multiple vectors: net.exe/net1.exe with /domain switches targeting privileged groups, PowerShell Active Directory cmdlets and LDAP queries, known AD enumeration tools (AdFind, BloodHound, ADExplorer), and dsquery/dsget commands. The query unions results from all detection sources and flags elevated execution contexts and queries specifically targeting privileged domain groups such as Domain Admins and Enterprise Admins.

Data Sources

Process: Process CreationCommand: Command ExecutionMicrosoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives & Tuning

  • IT administrators running legitimate Active Directory audits or health checks using net group or PowerShell AD cmdlets
  • Helpdesk staff using AD management tools to look up group memberships when resolving user access issues
  • Monitoring and SIEM agents (e.g., Microsoft Defender for Identity, CrowdStrike Falcon) performing scheduled AD enumeration as part of their normal operation
  • Automated scripts used during onboarding or offboarding processes that check group membership to provision or deprovision access
  • Vulnerability scanners and compliance tools (e.g., Tenable, Qualys) that enumerate AD groups as part of their assessment scope
Download portable Sigma rule (.yml)

Other platforms for T1069.002


Testing Methodology

Validate this detection against 4 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 1Net Group Domain Admin Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=net.exe or net1.exe, CommandLine containing 'group' and '/domain'. Security Event ID 4688 (if command line auditing is enabled). On the domain controller, Security Event ID 4661 may appear if SACL auditing is configured on Domain Admins group object.

  2. Test 2PowerShell Active Directory Module Group Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-ADGroup' and 'Get-ADGroupMember'. Sysmon Event ID 3: LDAP network connections (port 389 or 3268) from powershell.exe to domain controller IP. PowerShell ScriptBlock Log Event ID 4104 with the full command. Sysmon Event ID 11: File creation event for groups_out.txt in %TEMP%.

  3. Test 3AdFind Domain Group Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=AdFind.exe, CommandLine containing '-f' and 'objectClass=group'. Sysmon Event ID 3: Network connections from AdFind.exe to domain controller on LDAP port 389 or Global Catalog port 3268. Sysmon Event ID 11: Output files created in %TEMP%. Prefetch file created at C:\Windows\Prefetch\ADFIND.EXE-*.pf.

  4. Test 4dsquery Group Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=dsquery.exe and Image=dsget.exe, CommandLine containing 'group'. Security Event ID 4688 if command line auditing is enabled. Sysmon Event ID 3: LDAP connections (port 389) from dsquery.exe to domain controller.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections