Detection rules › Kusto

Detect entra token request via specific BOF (IOC based)

Author
Robbe Van den Daele
Source
github.com/HybridBrothers/Hunting-Queries-Detection-Rules

This might be one of the silliest detections I have created. But since there is a Beacon Object File out there which can be used to directly request Entra ID access tokens from an active beacon on a device using a specific User Agent, we can easily detect this beacon file by flagging the funny user agent and / or scope identifier that is used.

MITRE ATT&CK coverage

TacticTechniques
ExecutionT1651 Cloud Administration Command
Credential AccessT1606 Forge Web Credentials

References

Rule body yaml

AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(5m)
| where UserAgent contains "ur mum" 
| where ResourceIdentity == "797f4846-ba00-4fd7-ba43-dac1f8f63013"

Stages and Predicates

Stage 1: source

AADNonInteractiveUserSignInLogs

Stage 2: where

| where TimeGenerated > ago(5m)

Stage 3: where

| where UserAgent contains "ur mum"

Stage 4: where

| where ResourceIdentity == "797f4846-ba00-4fd7-ba43-dac1f8f63013"

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ResourceIdentityeq
  • 797f4846-ba00-4fd7-ba43-dac1f8f63013 transforms: cased
UserAgentcontains
  • ur mum