1. Resources
  2. Identity Threats
  3. Active Directory

DCShadow

Also known as: Rogue domain controller, DCShadow attack, lsadump::dcshadow, Rogue DC replication push

An attacker with domain admin rights registers a workstation as a temporary domain controller and pushes directory changes through replication, bypassing the logging that normal modifications produce.

Platform
Active Directory
Impact
Critical
Last updated
Attack difficulty
High
Detection difficulty
High
Privileges required: Tier 0 or tenant admin
Domain Admin or Enterprise Admin rights (or a delegated set of replication and Sites container rights), and SYSTEM on a domain-joined computer.
What the attacker gains
Arbitrary changes to any directory object, such as SID history, primary group or AdminSDHolder permissions, written without the usual change events.
Threat groups
AgriusAPT3APT5Aquatic PandaBlackByteChimeraCinnamon TempestHAFNIUMIndrik SpiderLazarus GroupMagic HoundNaikonNIMBUS MANTICOREOilRigand 11 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1207, T1134.005, T1098, T1078.002.

How it works

Domain controllers keep each other consistent through the Directory Replication Service (DRS) protocol. A domain controller trusts what a replication partner sends: the receiving side applies the changes as replicated data and does not run them through the checks and the auditing that a client's LDAP write goes through.

A machine counts as a replication partner when the directory says it is one. That takes three things:

  • a server object under CN=Servers,CN=<site>,CN=Sites,CN=Configuration,<forest DN> and an nTDSDSA object (CN=NTDS Settings) below it;
  • two service principal names on the machine's computer account: the DRS interface SPN, E3514235-4B06-11D1-AB04-00C04FC2DCD2/<DSA GUID>/<domain>, and a global catalog SPN, GC/<host>/<forest>;
  • an RPC server on the machine that answers the replication calls.

DCShadow, published by Benjamin Delpy and Vincent Le Toux in 2018 and implemented in Mimikatz as lsadump::dcshadow, does all of this for a few seconds:

  1. It creates the server and nTDSDSA objects and adds the SPNs to the computer account of the attacker's host.
  2. It starts a minimal DRS RPC server that holds the changes the attacker wants to make.
  3. It asks a real domain controller to replicate from the new partner. The real domain controller connects to the attacker's host, pulls the staged changes and commits them.
  4. It deletes the server and nTDSDSA objects and removes the SPNs.

The domain controller then replicates the change to the rest of the domain like any other.

DCShadow needs rights that already mean control of the domain, so it is not an escalation. Attackers use it to make their persistence changes quietly, and to write values that the normal interfaces refuse.

What gets pushed

  • SID history. Adding the SID of Domain Admins or Enterprise Admins to an ordinary account's sIDHistory. LDAP does not allow a direct write of this attribute; replication does. See SID history injection.
  • Primary group. Setting primaryGroupID to 512 makes Domain Admins the account's primary group, a membership that does not show in the group's member attribute.
  • AdminSDHolder permissions. Writing the template's nTSecurityDescriptor plants an AdminSDHolder backdoor without the 5136 event on that object.
  • Anything else: password hashes, userAccountControl, SPNs, delegation attributes, descriptions.

Prerequisites

  • Rights to register a domain controller and trigger replication. By default that is Domain Admins or Enterprise Admins. The published delegated set is: on the domain object, the extended rights DS-Install-Replica, DS-Replication-Manage-Topology and DS-Replication-Synchronize; on the Sites container in the Configuration partition, CreateChild and DeleteChild; WriteProperty on the computer object that will be registered; and WriteProperty on the target object.
  • SYSTEM on a domain-joined computer. The process that runs the RPC server must hold the machine's identity, because the real domain controller authenticates to the machine account's SPNs.
  • Network reachability in both directions. The attacker's host reaches the domain controller to register and trigger, and the domain controller must reach the attacker's host over RPC to pull the changes.

An attacker who wants to return later without Domain Admin can grant the delegated set to an ordinary account in advance. Nishang's Set-DCShadowPermissions does this for one rogue host and one target object:

Set-DCShadowPermissions -FakeDC WS01 -SAMAccountName svc-sql -Username alice -Verbose

That grant is itself a series of ACL changes on the domain object, the Sites container and two other objects.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

Two Mimikatz instances run on the same host, WS01: one as SYSTEM to act as the domain controller, one as the privileged account to trigger the push.

1. Start the first instance as SYSTEM

mimikatz # !+
mimikatz # !processtoken

!+ loads the Mimikatz kernel driver (mimidrv) and !processtoken uses it to give the Mimikatz process a SYSTEM token. Impersonating SYSTEM on a thread (token::elevate) is not enough, because the RPC server runs with the process token. Starting Mimikatz from a SYSTEM shell works as well.

2. Stage the change

In the SYSTEM instance, name the object, the attribute and the new value. A harmless change shows the mechanism:

mimikatz # lsadump::dcshadow /object:svc-sql /attribute:description /value:DCShadowTest

Mimikatz starts the RPC server and waits. The persistence variants use the same command with a different attribute:

mimikatz # lsadump::dcshadow /object:alice /attribute:sidHistory /value:S-1-5-21-0-0-0-512
mimikatz # lsadump::dcshadow /object:alice /attribute:primaryGroupID /value:512

Replace the SID with the domain's real SID followed by the RID of the group.

3. Push

In the second instance, running as the Domain Admin or the delegated account:

mimikatz # lsadump::dcshadow /push

This registers the rogue domain controller, triggers replication on the real one, and removes the registration again. The first instance prints the replication calls it served.

4. Verify from an independent client

Get-ADUser -Identity alice -Properties sIDHistory, primaryGroupID, description |
  Select-Object SamAccountName, sIDHistory, primaryGroupID, description

Get-ADReplicationAttributeMetadata -Object (Get-ADUser alice).DistinguishedName -Server DC01 |
  Where-Object AttributeName -in 'sIDHistory', 'primaryGroupID', 'description' |
  Select-Object AttributeName, Version, LastOriginatingChangeTime, LastOriginatingChangeDirectoryServerIdentity

A SID history value or a new primary group shows in the account's token only at its next logon.

Impact

The attacker can write any value to any object in the domain, including values that the directory would reject from an LDAP client. The usual goals are durable, hard-to-attribute privileges: an unremarkable account that carries the Domain Admins SID in its history, a template ACE that restores itself every hour, a changed password hash for a service account.

Because the changes come in as replication, the audit trail that incident responders rely on is missing. There is no event that says "this account changed that attribute", so after a compromise the defenders cannot easily list what was altered. That is the technique's real value, and it is why ATT&CK lists it under the defense impairment tactic.

A mistake has a cost too. Pushing a malformed value, or touching replication topology objects, can damage replication for the whole forest.

OPSEC and artifacts

  • Short registration window. The server and nTDSDSA objects exist for seconds. With Directory Service Changes auditing and SACLs on the Configuration partition, their creation is event 5137 and their deletion event 5141, one pair per push, naming the account that pushed. A run that fails midway leaves the objects behind.
  • SPNs on a non-DC. The computer account of the rogue host receives the DRS GUID SPN and a GC/ SPN. Event 4742 records the computer account change, and a 5136 records the servicePrincipalName values when the object is audited. Operators cannot avoid this step: without the SPNs the real domain controller cannot authenticate to the rogue one.
  • Replication rights in use. Event 4662 on the domain object shows the control access rights for replication being exercised by an account or from a host that is not a domain controller. Events 4928 and 4929 (Detailed Directory Service Replication) record a replica source being established and removed.
  • No change event for the payload. The pushed attribute produces no 5136, 4738 or 4765 on the target. What remains is replication metadata: the attribute's version number increases and its originating server is a DSA GUID that belongs to no current domain controller.
  • Traffic direction. The domain controller opens an RPC connection to a workstation and makes DRS calls to it. Domain controllers normally replicate only with each other.
  • On the rogue host. Loading mimidrv installs a kernel driver service (System event 7045, Security 4697), and the Mimikatz process itself is visible to endpoint tooling. Operators who start from a SYSTEM shell skip the driver.
  • Pre-granted permissions. The delegated variant avoids using Domain Admin at push time, but the ACL changes that grant it are recorded if the objects are audited, and the non-default ACEs stay in the directory.

Detection

DCShadow hides the change, not the setup. Detection focuses on the things only a domain controller should do.

  • Domain controller objects created and deleted in quick succession. A 5137 and a 5141 for a server or nTDSDSA object in the Configuration partition within seconds of each other, outside a domain controller promotion. The DCShadow detection rules cover this lifecycle and the SPN change.
  • Replication SPNs on a computer that is not a domain controller. Any servicePrincipalName beginning with E3514235-4B06-11D1-AB04-00C04FC2DCD2/, or a GC/ SPN, on a computer outside the domain controller inventory.
  • Replication from an unexpected source. Events 4928 and 4929 naming a source that is not a known domain controller, and network detection of DRS RPC calls from a domain controller to a non-DC address.
  • The results. A sIDHistory value or a privileged primaryGroupID on an account, found by inventory because no change event exists. See the SID history injection rules and the primary group ID changed rules, and compare AdminSDHolder against its baseline (AdminSDHolder modification rules).
  • Replication metadata. Attributes whose originating directory server is not a current domain controller.
// Server or NTDS Settings objects created or deleted in the Configuration partition
SecurityEvent
| where EventID in (5137, 5141)
| where EventData has "CN=Sites,CN=Configuration"
| where EventData has "nTDSDSA" or EventData has "server"
| project TimeGenerated, EventID, Computer, Account, EventData
| order by TimeGenerated asc

These events need Directory Service Changes auditing and a SACL that covers child object creation and deletion under the Sites container.

Mitigation

  • Protect the rights that make it possible. DCShadow starts from Domain Admin, so everything that keeps Tier 0 credentials off ordinary machines applies: dedicated administrative accounts, privileged access workstations, no domain admin logons on member systems. The Active Directory hardening guide describes the model.
  • Review delegated replication and topology rights. List who holds DS-Install-Replica, DS-Replication-Manage-Topology and DS-Replication-Synchronize on the domain object, and CreateChild or DeleteChild under the Sites container. Only domain controllers and Tier 0 administrators should. This also closes DCSync paths.
  • Restrict RPC from domain controllers. Host firewalls on workstations and servers, and network segmentation, should stop a domain controller from reaching RPC endpoints on machines that are not domain controllers. The pull cannot happen without that connection.
  • Audit the setup steps. Enable Directory Service Changes, Directory Service Access, Detailed Directory Service Replication and Computer Account Management on domain controllers, with SACLs on the Sites container and the domain object. The Active Directory audit policy guide has the settings.
  • Keep a domain controller inventory and alert on replication SPNs, server objects and replication partners that are not on it.
  • Baseline what DCShadow targets. Scheduled checks of sIDHistory, primaryGroupID, AdminSDHolder's ACL and replication metadata find changes that produced no event.
  • Plan recovery. After a confirmed DCShadow push, assume more changes exist than the ones found. Compare the directory with a known-good backup, and be ready to follow forest recovery procedures.

Detection rules for this attack

Log events to collect

FAQ

What is the difference between DCShadow and DCSync?

DCSync reads: it asks a domain controller to replicate secrets such as password hashes to the attacker. DCShadow writes: the attacker's machine poses as a domain controller and a real one replicates changes from it. Both use the directory replication protocol and both need rights that amount to control of the domain.

What privileges does DCShadow need?

Registering a domain controller requires Domain Admin or Enterprise Admin rights by default, plus SYSTEM on the machine that plays the rogue controller. A narrower delegated set has been published: replication rights on the domain, create and delete rights under the Sites container, and write access to the computer and target objects. It is a persistence and evasion technique, not a way to gain the domain.

Why is DCShadow hard to detect?

The change arrives through replication, so the domain controller applies it without writing the 5136 or account management event that an LDAP modification would produce, and no event names the attacker as the author. What remains visible is the setup: server and nTDSDSA objects created and deleted within seconds, replication SPNs on a computer that is not a domain controller, and replication traffic from a domain controller to a workstation.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.