Query Details
id: a1f00002-0002-4002-9002-adfs00000002
name: HUNT-02 ADFS Password Spray Suspects (14d)
description: |
14-day rollup of single-IP password spray candidates (bad-password +
user-not-found error families) hitting ADFS. Useful for retro-hunting
campaigns that fell under RULE-02/03 thresholds.
severity: Medium
requiredDataConnectors:
- connectorId: AzureActiveDirectory
dataTypes:
- ADFSSignInLogs
tactics:
- CredentialAccess
relevantTechniques:
- T1110.003
query: |
let SprayErrors = dynamic(["50126", "50034", "50053", "396083"]);
ADFSSignInLogs
| invoke ExcludeAllowlistedIPs()
| where TimeGenerated > ago(14d)
| where ResultType in (SprayErrors)
| summarize
Attempts = count(),
UniqueUsers = dcount(UserPrincipalName),
Users = make_set(UserPrincipalName, 25),
ResultTypes = make_set(ResultType, 10),
Countries = make_set(Location, 10),
FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated),
DistinctDays = dcount(startofday(TimeGenerated))
by IPAddress
| where UniqueUsers >= 5
| extend SustainedCampaign = DistinctDays >= 3
| order by UniqueUsers desc, Attempts desc
This query is designed to identify potential password spray attacks targeting Active Directory Federation Services (ADFS) over a 14-day period. Here's a breakdown of what it does in simple terms:
Purpose: The query aims to detect IP addresses that might be attempting password spray attacks, which involve trying multiple passwords against many accounts to gain unauthorized access.
Data Source: It uses logs from ADFS sign-ins, specifically looking at error codes that indicate failed login attempts due to incorrect passwords or non-existent users.
Process:
Analysis:
Criteria for Concern:
Output:
This query helps security teams identify and investigate potential password spray attacks, allowing them to take action to protect their systems.

David Alonso
Released: May 13, 2026
Tables
Keywords
Operators