Account Discovery
Adversaries may attempt to get a listing of valid accounts, usernames, or email addresses on a system or within a compromised environment. This information can help adversaries determine which accounts exist, which can aid in follow-on behavior such as brute-forcing, spear-phishing attacks, or account takeovers. Adversaries may use several methods to enumerate accounts, including abuse of existing tools, built-in commands, and potential misconfigurations that leak account names and roles or permissions in the targeted environment. On Windows, common discovery methods include net user, net localgroup, wmic useraccount list, Get-LocalUser, and Get-ADUser. On Linux and macOS, adversaries may read /etc/passwd, use getent, id, last, and who commands. In cloud environments, CLIs such as aws iam list-users, az ad user list, and gcloud iam service-accounts list are commonly abused. Observed threat actors leveraging this technique include Aquatic Panda, Scattered Spider, FIN13, and malware families such as Woody RAT, Havoc, TONESHELL, and ShimRatReporter.
let AccountDiscoveryProcesses = dynamic([
"net.exe", "net1.exe", "wmic.exe", "dsquery.exe", "nltest.exe", "whoami.exe"
]);
let AccountDiscoveryCmdPatterns = dynamic([
"net user", "net localgroup", "net group",
"wmic useraccount", "wmic group",
"dsquery user", "dsquery group",
"Get-LocalUser", "Get-LocalGroup", "Get-ADUser", "Get-ADGroupMember",
"nltest /dclist", "nltest /domain_trusts",
"whoami /groups", "whoami /all",
"query user", "quser"
]);
let PSAccountDiscovery = dynamic([
"Get-LocalUser", "Get-LocalGroup", "Get-ADUser",
"Get-ADGroupMember", "Get-ADObject", "Get-ADPrincipalGroupMembership",
"[adsi]", "DirectorySearcher", "DirectoryEntry"
]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where (
(FileName in~ (AccountDiscoveryProcesses) and ProcessCommandLine has_any (AccountDiscoveryCmdPatterns))
or (FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has_any (PSAccountDiscovery))
or (ProcessCommandLine has "whoami" and ProcessCommandLine has_any ("/groups", "/all", "/priv"))
)
| extend IsEncodedPS = (FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has_any ("-enc", "-EncodedCommand"))
| extend NetUserDomain = (ProcessCommandLine has "net user" and ProcessCommandLine has "/domain")
| extend LocalGroupEnum = (ProcessCommandLine has_any ("net localgroup", "Get-LocalGroup", "wmic group"))
| extend PrivilegedGroupEnum = (ProcessCommandLine has_any ("administrators", "domain admins", "enterprise admins", "schema admins"))
| extend WMICEnum = (FileName =~ "wmic.exe" and ProcessCommandLine has_any ("useraccount", "group"))
| extend DSQueryEnum = (FileName =~ "dsquery.exe")
| project Timestamp, DeviceName, AccountName, AccountDomain,
FileName, ProcessCommandLine, ProcessId,
InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId,
IsEncodedPS, NetUserDomain, LocalGroupEnum, PrivilegedGroupEnum, WMICEnum, DSQueryEnum
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- IT administrators running net user or Get-ADUser as part of routine account auditing and helpdesk workflows
- Endpoint management agents (SCCM, Intune, Tanium) that enumerate local accounts during inventory collection
- Security scanning tools (Nessus, Qualys, CrowdStrike Spotlight) performing authenticated enumeration for vulnerability assessment
- HR and IAM automation scripts that synchronize user lists between directories (e.g., Azure AD Connect, Okta provisioning)
- Monitoring and SIEM agents that collect account information for baseline and compliance reporting
- Developer tools and CI/CD pipelines that resolve user identities during build or deployment processes
References (11)
- https://attack.mitre.org/techniques/T1087/
- https://docs.aws.amazon.com/cli/latest/reference/iam/list-users.html
- https://cloud.google.com/sdk/gcloud/reference/iam/service-accounts/list
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/net-user
- https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc732952(v=ws.11)
- https://www.elastic.co/security-labs/embracing-offensive-tooling-building-detections-against-koadic-using-eql
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1087/T1087.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/process_creation
- https://www.crowdstrike.com/blog/2022-falcon-overwatch-report/
- https://www.mandiant.com/resources/blog/fin13-cybercriminal-mexico
Unlock Pro Content
Get the full detection package for T1087 including response playbook, investigation guide, and atomic red team tests.