1. Resources
  2. Detection rules
  3. DCShadow

DCShadow detection rules

An attacker with domain admin rights registers a machine as a temporary domain controller and pushes forged changes through replication. Detected by DC-only replication SPNs and nTDSDSA objects appearing outside a DC promotion.

Platform
Active Directory
Severity
Critical
Log source
Windows Security event log
Last updated
MITRE ATT&CK technique
T1207Rogue Domain Controller
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Domain Admin or equivalent rights, and a domain-joined computer under the attacker's control to act as the rogue domain controller.
Impact
The attacker can write any attribute of any object while bypassing change auditing, which is used to plant stealthy, durable backdoors after a domain compromise.
Response
Isolate the computer that carried the replication SPN, disable the account that registered it, and reverse every forged change that the review of replication metadata finds.
Mitigation
Restrict Domain Admin, Enterprise Admin and replication rights to a small, monitored Tier 0 set, and allow DRS replication traffic to domain controllers only from other domain controllers.
Event IDs
5137514147425136
Threat groups
None listed in MITRE ATT&CK for this technique

How the attack works

Domain controllers exchange changes with the Directory Replication Service (DRS) remote protocol. In a DCShadow attack the attacker makes an ordinary computer look like a domain controller for a few seconds: it creates a server and an nTDSDSA (NTDS Settings) object in the Configuration partition and adds the replication SPNs that every domain controller carries, E3514235-4B06-11D1-AB04-00C04FC2DCD2/<DSA GUID>/<domain> (the DRS RPC interface) and GC/<host>/<forest>.

Real domain controllers then pull the attacker's changes as normal replication. Because the changes arrive through replication instead of LDAP writes, they do not produce the usual 5136 events on the receiving domain controllers. The attacker removes the objects afterwards. The SPN writes are ordinary directory changes and are logged on the domain controller that processed them (4742, and 5136 where a SACL audits them), and tooling often leaves the DRS SPN behind on the computer account. Microsoft documents 5137 and 5141 for the creation and deletion of directory objects that a SACL covers; whether the objects registered by a rogue domain controller raise them has to be validated in a lab.

What an attacker needs

  • Domain Admin or equivalent rights: create server and nTDSDSA objects in the Configuration partition, write SPNs on the rogue computer's account and hold the replication rights on the domain object. These rights can be delegated, which is why misplaced replication rights matter.
  • A domain-joined computer under the attacker's control to act as the rogue domain controller.

Impact

The attacker can write any attribute of any object (for example sIDHistory, primaryGroupID, group membership or the krbtgt password) while bypassing the change auditing that defenders rely on. It is used to plant stealthy, durable backdoors after a domain compromise.

Detection rules

NTDS Settings (nTDSDSA) Object Created or Deleted

Detects the creation or deletion of an nTDSDSA (NTDS Settings) object, the Configuration-partition object that defines a domain controller. DCShadow creates one for the rogue domain controller and deletes it once the forged changes have replicated. Requires Audit Directory Service Changes and a SACL that audits child-object creation and deletion under CN=Sites,CN=Configuration. Microsoft documents 5137 and 5141 for objects created and deleted under such a SACL, but not whether the object registered by a rogue domain controller raises them: validate this in a lab before alerting on it.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: NTDS Settings (nTDSDSA) Object Created or Deleted
id: 0456b5cd-ed41-42e5-8352-817a1e2ee19b
status: experimental
description: >-
  Detects the creation or deletion of an nTDSDSA (NTDS Settings) object, the
  Configuration-partition object that defines a domain controller. DCShadow
  creates one for the rogue domain controller and deletes it once the forged
  changes have replicated. Requires Audit Directory Service Changes and a SACL
  that audits child-object creation and deletion under CN=Sites,CN=Configuration.
  Microsoft documents 5137 and 5141 for objects created and deleted under such
  a SACL, but not whether the object registered by a rogue domain controller
  raises them: validate this in a lab before alerting on it.
references:
  - https://attack.mitre.org/techniques/T1207/
  - https://learn.microsoft.com/en-us/windows/win32/adschema/c-ntdsdsa
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5137
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5141
author: Forestall
date: 2026-11-10
tags:
  - attack.defense-impairment
  - attack.t1207
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID:
      - 5137
      - 5141
    ObjectClass: nTDSDSA
  condition: selection
falsepositives:
  - Domain controller promotion, demotion and metadata cleanup. These are rare, planned events; match them to change records rather than excluding them.
level: high

False positives

  • Domain controller promotion, demotion and metadata cleanup. These are rare, planned events; match them to change records rather than excluding them.

Directory Replication SPN Added to a Computer Account

Detects the directory replication service SPN (E3514235-4B06-11D1-AB04-00C04FC2DCD2/<DSA GUID>/<domain>) written to a computer account. Only domain controllers carry this SPN; DCShadow adds it to the attacker's machine so that real domain controllers accept it as a replication partner, and tooling often leaves it behind. Uses 4742 (Audit Computer Account Management) or 5136 (Audit Directory Service Changes with a SACL that audits writes to servicePrincipalName).

LevelHighStatusExperimentalLog sourceWindows Security event log
title: Directory Replication SPN Added to a Computer Account
id: 78722a67-0125-4fb6-9a17-3f2c573ff034
status: experimental
description: >-
  Detects the directory replication service SPN
  (E3514235-4B06-11D1-AB04-00C04FC2DCD2/<DSA GUID>/<domain>) written to a
  computer account. Only domain controllers carry this SPN; DCShadow adds it to
  the attacker's machine so that real domain controllers accept it as a
  replication partner, and tooling often leaves it behind. Uses 4742 (Audit
  Computer Account Management) or 5136 (Audit Directory Service Changes with a
  SACL that audits writes to servicePrincipalName).
references:
  - https://attack.mitre.org/techniques/T1207/
  - https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/how-to-configure-spn
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4742
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5136
author: Forestall
date: 2026-11-10
tags:
  - attack.defense-impairment
  - attack.t1207
logsource:
  product: windows
  service: security
detection:
  selection_computer_changed:
    EventID: 4742
    ServicePrincipalNames|contains: 'E3514235-4B06-11D1-AB04-00C04FC2DCD2/'
  selection_spn_written:
    EventID: 5136
    AttributeLDAPDisplayName: servicePrincipalName
    AttributeValue|startswith: 'E3514235-4B06-11D1-AB04-00C04FC2DCD2/'
    OperationType:
      - '%%14674'
      - 'Value Added'
  condition: 1 of selection_*
falsepositives:
  - Promotion of a new domain controller, and SPN changes on existing domain controllers (event 4742 lists the full new SPN set). Exclude the domain controller computer accounts by TargetUserName (4742) or ObjectDN (5136) and keep the rule for every other computer.
level: high

False positives

  • Promotion of a new domain controller, and SPN changes on existing domain controllers (event 4742 lists the full new SPN set). Exclude the domain controller computer accounts by TargetUserName (4742) or ObjectDN (5136) and keep the rule for every other computer.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Domain controller registration that is removed again within minutes

Detection hypothesisSequence of eventsCompares with an earlier value

A real domain controller keeps its server object, its nTDSDSA object and its replication SPN for as long as it serves, and demotion happens months or years later. A rogue domain controller is registered for the few minutes the forged changes need to replicate and is removed straight after. A creation followed by a removal of the same object or SPN within a short window is that pattern.

  1. A server or nTDSDSA object is created under CN=Sites,CN=Configuration (event 5137, ObjectClass server or nTDSDSA). Keep ObjectGUID, ObjectDN, SubjectUserName and the time.
  2. Or the replication SPN starting with E3514235-4B06-11D1-AB04-00C04FC2DCD2/ is written to a computer account: event 5136 on servicePrincipalName with OperationType Value Added, or event 4742 whose ServicePrincipalNames contains it.
  3. Within 60 minutes, a starting value, the same object is deleted (event 5141 with the same ObjectGUID), or the same SPN value is removed from the same ObjectDN (event 5136 with OperationType Value Deleted).
  4. For the SPN, a later event 4742 for the same TargetSid that no longer lists it in ServicePrincipalNames shows the removal as well.
  5. Report each pair that has no domain controller promotion or demotion on record, with the account in SubjectUserName of both events.

Events5137514151364742

LimitsA failed promotion that is rolled back, and metadata cleanup after a failed domain controller, produce the same pair. The 5137 and 5141 events need a SACL that audits child creation and deletion under CN=Sites, and Microsoft does not document whether a rogue registration raises them. Tooling that leaves the SPN behind is caught by the SPN rule instead. The window is a starting point.

Replication partner that is not one of your domain controllers

Detection hypothesisNeeds your own listsSequence of events

Real domain controllers pull the rogue domain controller's changes as normal inbound replication, so the domain controller that receives them records a replication source. Microsoft recommends watching the source of events 4928 and 4929 because a new replication source must be authorized. A source whose NTDS Settings object or DNS record belongs to no domain controller you know of is the rogue one.

  1. On every domain controller, enable Audit Detailed Directory Service Replication and collect event 4928 (a replica source naming context was established) and event 4929 (removed).
  2. Read SourceDRA (the distinguished name of the source's NTDS Settings object) and SourceAddr (the source's DSA GUID record under _msdcs), together with NamingContext and Computer.
  3. Compare them with the list of your domain controllers' NTDS Settings objects and their objectGUID values. Refresh the list when a domain controller is added or removed.
  4. Report every source that is not on the list, and every source that is established and removed again on the same domain controller within an hour, a starting value.

Events49284929

LimitsMicrosoft describes this subcategory as very high volume and meant for troubleshooting, and does not document which of these events a rogue domain controller produces: validate in a lab. A new domain controller appears here before it is on the list. Event 4929 can show no SourceDRA (a dash), so match on SourceAddr as well.

Triage

  • Identify the computer account that received the SPN (TargetUserName in 4742, ObjectDN in 5136) and confirm whether it is a domain controller that is being promoted under a change record.
  • Check who made the change (SubjectUserName, SubjectLogonId) and correlate with 4624 for the source host.
  • Where your domain controllers produce them (validate this in a lab), look for 5137 and 5141 events for server and nTDSDSA objects under CN=Sites,CN=Configuration within minutes of each other; a create-and-delete pair outside a promotion is the DCShadow pattern.
  • If unexplained, treat the domain as compromised and review recent changes to privileged objects (sIDHistory, group membership, ACLs) using replication metadata rather than event logs.

Response

Once the attack is confirmed:

  1. Isolate the computer that carried the replication SPN and disable the account that registered it. That account holds rights equal to Domain Admin, so treat its compromise as a domain compromise.
  2. Remove what the registration left behind. Delete the replication SPNs from the computer account and any server and nTDSDSA objects that do not belong to a real domain controller.
  3. Reverse every forged change that the review of replication metadata finds. Remove added sIDHistory values, restore primaryGroupID and group memberships, and reset any account whose credentials were written. If the krbtgt password was among them, follow the reset procedure described for Golden Ticket.
  4. Confirm that only real domain controllers carry the replication SPN and an nTDSDSA object, and that replication rights on the domain object are held by the expected principals only.

Mitigation

  • Restrict Domain Admin, Enterprise Admin and replication rights to a small, monitored Tier 0 set; review who holds replication rights on the domain object.
  • Remove leftover E3514235-4B06-11D1-AB04-00C04FC2DCD2/... SPNs from any computer that is not a domain controller.
  • Allow DRS replication traffic to domain controllers only from other domain controllers (host firewall or network segmentation).
  • Enable "Audit Directory Service Changes" and a SACL that audits child-object creation and deletion on CN=Sites,CN=Configuration so that server and nTDSDSA objects created or deleted under it can be logged.

Frequently asked questions

Why do the receiving domain controllers log no 5136 events for the forged changes?

The changes arrive through replication, not as LDAP writes, and replicated changes do not produce the usual 5136 events on the domain controllers that receive them. Only the registration of the rogue domain controller is an ordinary directory change. That is why the rules watch the replication SPN and the nTDSDSA object and not the forged attributes.

Is the nTDSDSA rule known to fire during a real attack?

Not from documentation. Microsoft documents events 5137 and 5141 for objects created and deleted under a SACL, but not whether the objects a rogue domain controller registers raise them. Validate the rule in a lab before relying on it. The rule for the replication SPN rests on ordinary account and directory change events.

What legitimate activity adds the replication SPN to a computer account?

Promotion of a new domain controller, and any SPN change on an existing one, because event 4742 lists the full new SPN set. Exclude the computer accounts of your domain controllers and keep the rule for every other computer. Only domain controllers carry this SPN.

Does a confirmed DCShadow alert mean the domain is already compromised?

It means that an account with Domain Admin or equivalent rights is in the attacker's hands, because registering a rogue domain controller takes those rights. The technique is used after a compromise to plant changes that bypass change auditing. A confirmed alert should start a domain-level response, not only a clean-up of the SPN.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.