T1087.001

Local Account

Adversaries may attempt to get a listing of local system accounts to aid in follow-on behavior such as privilege escalation, lateral movement, or credential access. On Windows, commands such as net user and net localgroup are commonly used. On Linux and macOS, commands such as id, groups, cat /etc/passwd, and dscl . list /Users enumerate local accounts. On ESXi, esxcli system account list retrieves local accounts. This information helps adversaries understand the account landscape, identify high-value targets like local administrators, and plan further attack steps.

Microsoft Sentinel / Defender
kusto
let AccountEnumCommands = dynamic([
  "net user", "net localgroup", "net accounts",
  "Get-LocalUser", "Get-LocalGroup", "Get-LocalGroupMember",
  "query user", "query session",
  "wmic useraccount", "wmic path win32_useraccount",
  "dsquery user", "lusrmgr"
]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where (
    (FileName =~ "net.exe" or FileName =~ "net1.exe") and
    (ProcessCommandLine has "user" or ProcessCommandLine has "localgroup" or ProcessCommandLine has "accounts")
  ) or
  (
    FileName =~ "powershell.exe" and
    ProcessCommandLine has_any ("Get-LocalUser", "Get-LocalGroup", "Get-LocalGroupMember", "Get-WmiObject Win32_UserAccount", "Get-CimInstance Win32_UserAccount")
  ) or
  (
    FileName =~ "wmic.exe" and
    (ProcessCommandLine has "useraccount" or ProcessCommandLine has "win32_useraccount")
  ) or
  (
    FileName =~ "query.exe" and
    (ProcessCommandLine has "user" or ProcessCommandLine has "session")
  )
| extend EnumerationMethod = case(
    FileName =~ "net.exe" or FileName =~ "net1.exe", "net.exe/net1.exe",
    FileName =~ "powershell.exe", "PowerShell Cmdlet",
    FileName =~ "wmic.exe", "WMIC",
    FileName =~ "query.exe", "query.exe",
    "Other"
  )
| extend IsSuspiciousParent = InitiatingProcessFileName in~ (
    "cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe",
    "mshta.exe", "rundll32.exe", "regsvr32.exe", "svchost.exe"
  )
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         EnumerationMethod, IsSuspiciousParent
| sort by Timestamp desc
medium severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • IT administrators running net user or net localgroup for routine account auditing and inventory
  • Security monitoring tools and vulnerability scanners (Tenable, Qualys, CrowdStrike) that enumerate accounts during assessments
  • Software installation and configuration management tools (SCCM, Ansible, Puppet) that validate account configurations
  • Helpdesk personnel running query user to check active sessions before performing maintenance
  • User provisioning automation scripts that verify account existence before creating or modifying accounts

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections