← Back to SOC feed Coverage →

Account brute force (1)

kql MEDIUM Azure-Sentinel
DeviceLogonEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-23T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may be attempting to brute force their way into a system by cycling through multiple accounts from a single public IP address, leveraging repeated failed login attempts to identify valid credentials. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect potential credential compromise and prevent unauthorized access before it escalates.

KQL Query

// Query #2: Look for machines failing to log-on to multiple machines or using multiple accounts
// Note - RemoteDeviceName is not available in all remote logon attempts
DeviceLogonEvents
| where isnotempty(RemoteDeviceName)
| extend Account=strcat(AccountDomain, "\\", AccountName)
| summarize 
    Successful=countif(ActionType == "LogonSuccess"),
    Failed = countif(ActionType == "LogonFailed"),
    FailedAccountsCount = dcountif(Account, ActionType == "LogonFailed"),
    SuccessfulAccountsCount = dcountif(Account, ActionType == "LogonSuccess"),
    FailedComputerCount = dcountif(DeviceName, ActionType == "LogonFailed"),
    SuccessfulComputerCount = dcountif(DeviceName, ActionType == "LogonSuccess")
    by RemoteDeviceName
| where
    Successful > 0 and
    ((FailedComputerCount > 100 and FailedComputerCount > SuccessfulComputerCount) or
        (FailedAccountsCount > 100 and FailedAccountsCount > SuccessfulAccountsCount))

Analytic Rule Definition

id: 89cc68d2-1330-40ce-aaca-5c76fc4f52b3
name: Account brute force (1)
description: |
  Query #1: Look for public IP addresses that failed to logon to a computer multiple times, using multiple accounts, and eventually succeeded.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceLogonEvents
query: |
  // Query #2: Look for machines failing to log-on to multiple machines or using multiple accounts
  // Note - RemoteDeviceName is not available in all remote logon attempts
  DeviceLogonEvents
  | where isnotempty(RemoteDeviceName)
  | extend Account=strcat(AccountDomain, "\\", AccountName)
  | summarize 
      Successful=countif(ActionType == "LogonSuccess"),
      Failed = countif(ActionType == "LogonFailed"),
      FailedAccountsCount = dcountif(Account, ActionType == "LogonFailed"),
      SuccessfulAccountsCount = dcountif(Account, ActionType == "LogonSuccess"),
      FailedComputerCount = dcountif(DeviceName, ActionType == "LogonFailed"),
      SuccessfulComputerCount = dcountif(DeviceName, ActionType == "LogonSuccess")
      by RemoteDeviceName
  | where
      Successful > 0 and
      ((FailedComputerCount > 100 and FailedComputerCount > SuccessfulComputerCount) or
          (FailedAccountsCount > 100 and FailedAccountsCount > SuccessfulAccountsCount))

Required Data Sources

Sentinel TableNotes
DeviceLogonEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Lateral Movement/Account brute force (1).yaml