T1589.002 Google Chronicle · YARA-L

Detect Email Addresses in Google Chronicle

Adversaries may gather email addresses that can be used during targeting. Even if internal instances exist, organizations may have public-facing email infrastructure and addresses for employees. Adversaries may gather email addresses from publicly accessible sources such as social media, company websites, and leaked credential databases. Additionally, adversaries may actively enumerate valid email addresses by probing authentication services — for example, querying the Microsoft GetCredentialType API endpoint or Exchange Autodiscover to determine whether a given address is a valid account in Office 365 or on-premises Exchange environments. Gathered email addresses enable spearphishing campaigns, credential brute force attacks, business email compromise, and social engineering operations.

MITRE ATT&CK

Tactic
Reconnaissance
Technique
T1589 Gather Victim Identity Information
Sub-technique
T1589.002 Email Addresses
Canonical reference
https://attack.mitre.org/techniques/T1589/002/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule azure_ad_email_enumeration_t1589_002 {
  meta:
    author = "Detection Engineering"
    description = "Detects email address enumeration via Azure AD sign-in error codes indicating probing of non-existent or invalid accounts from a single source IP. Targets T1589.002 pre-attack reconnaissance activity."
    mitre_attack_tactic = "TA0043"
    mitre_attack_technique = "T1589.002"
    severity = "HIGH"
    confidence = "HIGH"
    rule_version = "1.0"
    false_positives = "Enterprise SSO proxies, ADFS, red team activity, bulk provisioning workflows"

  events:
    $login.metadata.event_type = "USER_LOGIN"
    $login.metadata.vendor_name = "Microsoft"
    $login.security_result.action = "BLOCK"
    $login.principal.ip = $src_ip
    $login.target.user.userid = $target_user
    re.regex($login.security_result.description, `\b(50034|50053|50055|50056)\b`)

  match:
    $src_ip over 1h

  outcome:
    $unique_users = count_distinct($target_user)
    $total_attempts = count($login)
    $sample_targets = array_distinct($target_user)

  condition:
    #login >= 10
}
high severity high confidence

Chronicle Security Operations YARA-L 2.0 rule detecting email address enumeration via Azure AD authentication failure analysis. Matches USER_LOGIN events from the Microsoft vendor where the security_result description contains Azure AD error codes 50034, 50053, 50055, or 50056. Correlates events by source IP over a 1-hour match window and fires when 10 or more matching attempts are observed. The outcome section computes distinct user count, total attempts, and a sample array of targeted accounts for alert enrichment and analyst triage. Requires Azure AD sign-in logs to be ingested into Chronicle via the Microsoft Azure AD log ingestion feed.

Data Sources

Google Chronicle UDMAzure Active Directory via Chronicle ingestion pipeline

Required Tables

UDM events (event_type: USER_LOGIN, vendor_name: Microsoft)

False Positives & Tuning

  • Enterprise Azure AD Connect or Entra ID sync services generating authentication validation bursts during scheduled directory synchronization cycles from a dedicated connector server IP
  • Cloud-based PAM solutions or password managers authenticating on behalf of a large user population from a single service IP, producing high-volume unique-account authentication patterns that exceed the threshold
  • Internal IT governance tooling performing scheduled account existence checks for license compliance or identity certification campaigns, generating predictable bursts of 50034 errors from known management IPs
Download portable Sigma rule (.yml)

Other platforms for T1589.002


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 1Azure AD Email Enumeration via GetCredentialType API (PowerShell)

    Expected signal: Sysmon Event ID 1: PowerShell.exe process with CommandLine containing 'GetCredentialType' and 'login.microsoftonline.com'. Sysmon Event ID 3: Outbound network connections from powershell.exe to login.microsoftonline.com (TCP 443). Proxy/web filter logs: HTTP POST to login.microsoftonline.com/common/GetCredentialType with PowerShell User-Agent. DeviceNetworkEvents in MDE: InitiatingProcessFileName=powershell.exe, RemoteUrl containing GetCredentialType.

  2. Test 2Azure AD Email Enumeration via AADInternals Module

    Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing 'AADInternals' and 'UserEnumerationAsOutsider'. Sysmon Event ID 3: Network connections to login.microsoftonline.com and related Microsoft AAD endpoints. PowerShell ScriptBlock Log Event ID 4104 capturing the full module invocation. Windows Security Event ID 4688: Process creation for powershell.exe with command line auditing enabled. Proxy logs: HTTP requests with AADInternals User-Agent string to Microsoft authentication endpoints.

  3. Test 3Email Enumeration via Sign-in Attempt with Non-Existent Accounts (Generates SigninLogs 50034)

    Expected signal: Azure AD SigninLogs: 10 entries with ResultType=50034 (UserAccountNotFound) for each probed address, all from the same source IP. These entries are visible in the Azure Portal under Azure AD > Sign-in logs and in Microsoft Sentinel's SigninLogs table within 5-15 minutes. Field ClientAppUsed will show 'Other clients'.

  4. Test 4OSINT Email Harvesting Simulation via Python Requests (LinkedIn/Web Scraping Pattern)

    Expected signal: Sysmon Event ID 1: python3.exe process creation with CommandLine containing 'theHarvester' User-Agent string. Sysmon Event ID 3: Network connections from python3.exe to target hosts over TCP 443/80. DeviceNetworkEvents in MDE: InitiatingProcessFileName=python3.exe, RemoteUrl matching target sites. Proxy logs: HTTP GET requests with theHarvester User-Agent string — this User-Agent string is well-known and often blocked/alerted by web proxies.

  5. Test 5Exchange Autodiscover Email Validation Probe (curl)

    Expected signal: Sysmon Event ID 1: curl.exe process creation with CommandLine containing 'autodiscover' and target email addresses. Sysmon Event ID 3: Outbound network connections from curl.exe to autodiscover.targetdomain.com over TCP 443. Exchange IIS Access Logs (W3SVC): POST requests to /autodiscover/autodiscover.xml with 401 response codes, source IP, and User-Agent 'curl/*'. Windows Security Event ID 4625 (Logon Failure): if Basic Authentication is attempted against Exchange.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections