T1087 Google Chronicle · YARA-L

Detect Account Discovery in Google Chronicle

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.

MITRE ATT&CK

Tactic
Discovery
Technique
T1087 Account Discovery
Canonical reference
https://attack.mitre.org/techniques/T1087/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule t1087_account_discovery {
  meta:
    author = "Argus Detection Platform"
    description = "Detects account discovery activity via Windows process enumeration tools and PowerShell AD cmdlets"
    mitre_attack_tactic = "Discovery"
    mitre_attack_technique = "T1087"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1087/"
    severity = "MEDIUM"
    confidence = "HIGH"
    version = "1.0"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    (
      (
        re.regex($e.target.process.file.full_path, `(?i)(\\net\.exe|\\net1\.exe)$`) and
        re.regex($e.target.process.command_line, `(?i)net(1)?\s+(user|localgroup|group)`)
      ) or
      (
        re.regex($e.target.process.file.full_path, `(?i)\\wmic\.exe$`) and
        re.regex($e.target.process.command_line, `(?i)(useraccount|\sgroup\s)`)
      ) or
      re.regex($e.target.process.file.full_path, `(?i)(\\dsquery\.exe|\\nltest\.exe)$`) or
      (
        re.regex($e.target.process.file.full_path, `(?i)\\whoami\.exe$`) and
        re.regex($e.target.process.command_line, `(?i)/(groups|all|priv)`)
      ) or
      (
        re.regex($e.target.process.file.full_path, `(?i)(\\powershell\.exe|\\pwsh\.exe)$`) and
        re.regex($e.target.process.command_line, `(?i)(Get-LocalUser|Get-LocalGroup|Get-ADUser|Get-ADGroupMember|Get-ADObject|Get-ADPrincipalGroupMembership|DirectorySearcher|DirectoryEntry|\[adsi\])`)
      )
    )

  condition:
    $e
}
medium severity high confidence

Chronicle YARA-L 2.0 rule detecting account discovery via Windows process enumeration. Matches PROCESS_LAUNCH UDM events where net.exe, wmic.exe, dsquery.exe, nltest.exe, whoami.exe, or PowerShell with Active Directory cmdlets are invoked with arguments consistent with MITRE ATT&CK T1087 account enumeration behavior.

Data Sources

Google Chronicle UDM - PROCESS_LAUNCH eventsWindows Event Logs forwarded via Chronicle forwarderSysmon Event ID 1 via Chronicle forwarder

Required Tables

UDM Events (event_type = PROCESS_LAUNCH)

False Positives & Tuning

  • Authorized IT operations teams executing scheduled AD inventory scripts or user reconciliation tasks using dsquery.exe or PowerShell AD cmdlets
  • Active Directory monitoring and management platforms (e.g., RSAT, ManageEngine AD Manager) that enumerate users and groups as part of normal health checks
  • Privileged access workstations (PAWs) used by domain administrators for routine AD administration, generating frequent AD enumeration activity
Download portable Sigma rule (.yml)

Other platforms for T1087


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 1Local Account Enumeration via Net User

    Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\net.exe and CommandLine='net user'. Net1.exe may also appear as a child process. Security Event ID 4688 (if command line auditing enabled) with the same detail. No network connections expected — local SAM database query only.

  2. Test 2Domain Account and Group Enumeration via Net

    Expected signal: Sysmon Event ID 1: Three sequential Process Create events for net.exe with CommandLines 'net user /domain', 'net group Domain Admins /domain', 'net group Enterprise Admins /domain'. Sysmon Event ID 3: Network connections to domain controller IP on port 445 (SMB/SAMR protocol for domain queries). Security Event IDs 4661/4662 on the domain controller for directory object access.

  3. Test 3Active Directory Enumeration via PowerShell Get-ADUser

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe and CommandLine containing 'Get-ADUser' and '-Filter *'. Sysmon Event ID 3: LDAP connection (port 389 or 3268 for global catalog) from powershell.exe to domain controller IP. PowerShell ScriptBlock Logging Event ID 4104 with full script content. Domain Controller Security Event IDs 4661/4662 for directory service access.

  4. Test 4WMI-Based Local Account Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\wbem\WMIC.exe and CommandLine='wmic useraccount list brief'. Possible WMI provider process creation (WmiPrvSE.exe). No network connections for local query. Security Event ID 4688 with command line if auditing enabled.

  5. Test 5dsquery Domain User Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\dsquery.exe and CommandLine='dsquery user -limit 0'. Sysmon Event ID 3: LDAP connection from dsquery.exe to domain controller on port 389 or 3268. Security Event IDs 4661/4662 on domain controller for directory access.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections