← Back to SOC feed Coverage →

RID Hijacking

kql MEDIUM Azure-Sentinel
T1078
SecurityEvent
backdoorhuntingmicrosoftofficial
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-06-04T11:00:00Z · Confidence: medium

Hunt Hypothesis

Non-administrator accounts with RIDs ending in *-500 may indicate RID hijacking, where an attacker impersonates a legitimate admin account to gain elevated privileges. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential lateral movement and privilege escalation attempts by adversaries.

KQL Query

// Enter a reference list of default local administrators for your Windows systems
let LocalAdminsList = dynamic (["administrator","admin"]);
SecurityEvent
| where EventID in (4624,4625) and TargetUserSid endswith "-500" and TargetUserName !in (LocalAdminsList)
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated) by Computer, TargetUserName, TargetUserSid, TargetLogonId, IpAddress, LogonTypeName

Analytic Rule Definition

id: fcdeec10-6948-11ec-90d6-0242ac120003
name: RID Hijacking
description: |
   'This query detects all authentication attempts of non administrator accounts that their RID is ending in *-500.
   Ref: https://stealthbits.com/blog/rid-hijacking-when-guests-become-admins/'
requiredDataConnectors:
  - connectorId: SecurityEvents
    dataTypes:
      - SecurityEvent
tactics:
  - PrivilegeEscalation
relevantTechniques:
  - T1078
query: |
  // Enter a reference list of default local administrators for your Windows systems
  let LocalAdminsList = dynamic (["administrator","admin"]);
  SecurityEvent
  | where EventID in (4624,4625) and TargetUserSid endswith "-500" and TargetUserName !in (LocalAdminsList)
  | summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated) by Computer, TargetUserName, TargetUserSid, TargetLogonId, IpAddress, LogonTypeName

Required Data Sources

Sentinel TableNotes
SecurityEventEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/SecurityEvent/RIDHijacking.yaml