Detection rules › Splunk

Windows AD Short Lived Domain Controller SPN Attribute

Status
production
Severity
medium
Group by
LogonId
Author
Dean Luxton
Source
github.com/splunk/security_content

The following analytic detects the temporary addition of a global catalog SPN or a DRS RPC SPN to an Active Directory computer object, indicative of a potential DCShadow attack. This detection leverages EventCode 5136 from the wineventlog_security data source, focusing on specific SPN attribute changes. This activity is significant as DCShadow attacks allow attackers with privileged access to register rogue Domain Controllers, enabling unauthorized changes to the AD infrastructure. If confirmed malicious, this could lead to unauthorized replication of changes, including credentials and keys, compromising the entire domain's security.

MITRE ATT&CK coverage

TacticTechniques
Defense ImpairmentT1207 Rogue Domain Controller

Event coverage

Rule body splunk

name: Windows AD Short Lived Domain Controller SPN Attribute
id: 57e27f27-369c-4df8-af08-e8c7ee8373d4
version: 14
creation_date: '2022-09-01'
modification_date: '2026-05-13'
author: Dean Luxton
status: production
type: TTP
description: The following analytic detects the temporary addition of a global catalog SPN or a DRS RPC SPN to an Active Directory computer object, indicative of a potential DCShadow attack. This detection leverages EventCode 5136 from the `wineventlog_security` data source, focusing on specific SPN attribute changes. This activity is significant as DCShadow attacks allow attackers with privileged access to register rogue Domain Controllers, enabling unauthorized changes to the AD infrastructure. If confirmed malicious, this could lead to unauthorized replication of changes, including credentials and keys, compromising the entire domain's security.
data_source:
    - Windows Event Log Security 5136
    - Windows Event Log Security 4624
search: |-
    `wineventlog_security` EventCode=5136 AttributeLDAPDisplayName=servicePrincipalName (AttributeValue="GC/*" OR AttributeValue="E3514235-4B06-11D1-AB04-00C04FC2DCD2/*")
      | stats min(_time) as _time range(_time) as duration values(OperationType) as OperationType values(user) as user values(src_ip) as src_ip values(src_nt_domain) as src_nt_domain values(src_user) as src_user values(Computer) as dest, values(ObjectDN) as ObjectDN values(action) as action values(app) as app values(authentication_method) as authentication_method values(signature) as signature values(signature_id) as signature_id values(src) as src
        BY Logon_ID
      | eval short_lived=case((duration<30),"TRUE")
      | where short_lived="TRUE" AND mvcount(OperationType)>1
      | replace "%%14674" with "Value Added", "%%14675" with "Value Deleted" in OperationType
      | rename Logon_ID as TargetLogonId
      | appendpipe [
      | map search="search `wineventlog_security` EventCode=4624 TargetLogonId=$TargetLogonId$"]
      | `windows_ad_short_lived_domain_controller_spn_attribute_filter`
how_to_implement: To successfully implement this search, you need to be ingesting eventcode `5136`. The Advanced Security Audit policy setting `Audit Directory Services Changes` within `DS Access` needs to be enabled, alongside a SACL for `everybody` to `Write All Properties` applied to the domain root and all descendant objects.
known_false_positives: No false positives have been identified at this time.
references:
    - https://www.dcshadow.com/
    - https://blog.netwrix.com/2022/09/28/dcshadow_attack/
    - https://gist.github.com/gentilkiwi/dcc132457408cf11ad2061340dcb53c2
    - https://attack.mitre.org/techniques/T1207/
    - https://blog.alsid.eu/dcshadow-explained-4510f52fc19d
drilldown_searches:
    - name: View the detection results for - "$src_user$"
      search: '%original_detection_search% | search  src_user = "$src_user$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$src_user$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$src_user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
finding:
    title: Short Lived Domain Controller SPN AD Attribute Triggered by $src_user$
    entity:
        field: src_user
        type: user
        score: 50
analytic_story:
    - Compromised Windows Host
    - Sneaky Active Directory Persistence Tricks
asset_type: Endpoint
mitre_attack_id:
    - T1207
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1207/mimikatz/windows-security-xml.log
          source: XmlWinEventLog:Security
          sourcetype: XmlWinEventLog
      test_type: unit

Stages and Predicates

Stage 1: search

`wineventlog_security` EventCode=5136 AttributeLDAPDisplayName=servicePrincipalName (AttributeValue="GC/*" OR AttributeValue="E3514235-4B06-11D1-AB04-00C04FC2DCD2/*")

Stage 2: stats

| stats min(_time) as _time range(_time) as duration values(OperationType) as OperationType values(user) as user values(src_ip) as src_ip values(src_nt_domain) as src_nt_domain values(src_user) as src_user values(Computer) as dest, values(ObjectDN) as ObjectDN values(action) as action values(app) as app values(authentication_method) as authentication_method values(signature) as signature values(signature_id) as signature_id values(src) as src
    BY Logon_ID

Stage 3: eval

| eval short_lived=case((duration<30),"TRUE")
short_lived =
else"TRUE"

Stage 4: where

| where short_lived="TRUE" AND mvcount(OperationType)>1

Stage 5: replace

| replace "%%14674" with "Value Added", "%%14675" with "Value Deleted" in OperationType

Stage 6: rename

| rename Logon_ID as TargetLogonId

Stage 7: appendpipe

| appendpipe [
  | map search="search `wineventlog_security` EventCode=4624 TargetLogonId=$TargetLogonId$"]

Stage 8: search

| `windows_ad_short_lived_domain_controller_spn_attribute_filter`

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 9 (sigma 4, splunk 3, elastic 1, kusto 1)
AttributeValueeq
  • "E3514235-4B06-11D1-AB04-00C04FC2DCD2/*"
  • "GC/*"
EventCodeeq
  • 5136 corpus 30 (splunk 24, kusto 5, elastic 1)
short_livedeq
  • "TRUE" corpus 5 (splunk 5)