Detection rules › Kusto Query Language

Service Principal Name (SPN) Assigned to User Account

Author
Vasileios Paschalidis
Source
upstream

'This query identifies whether an Active Directory user object was assigned a service principal name which could indicate that an adversary is preparing for performing Kerberoasting. This query checks for event id 5136, that the Object Class field is "user" and the LDAP Display Name is "servicePrincipalName". Ref: https://thevivi.net/assets/docs/2019/theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf'

MITRE ATT&CK coverage

TacticTechniques
Privilege EscalationT1134 Access Token Manipulation
Defense EvasionT1134 Access Token Manipulation

Event coverage

ProviderEvent IDTitle
Security-Auditing5136A directory service object was modified.

Stages and Predicates

Stage 1: source

SecurityEvent

Stage 2: where

EventID eq "5136"

Stage 3: parse

Stage 4: parse

Stage 5: where

and
  AttributeLDAPDisplayName eq "servicePrincipalName"
  ObjectClass eq "user"

Stage 6: parse

Stage 7: parse

Stage 8: summarize

Stage 9: extend

Stage 10: extend

Stage 11: project-away

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
AttributeLDAPDisplayNameeq
  • servicePrincipalName corpus 6 (splunk 3, sigma 2, elastic 1)
EventIDeq
  • 5136 corpus 22 (splunk 22)
ObjectClasseq
  • user corpus 4 (splunk 2, sigma 1, elastic 1)