Blog > DCShadow Attack: How It Works and How to Stop It

DCShadow Attack: How It Works and How to Stop It

TL;DR 

A DCShadow attack lets an adversary register a rogue domain controller and inject malicious changes into Active Directory through native replication protocols, bypassing standard security logs entirely. Defending against it requires real-time replication-layer monitoring, strict control over Domain Admin privileges, and attribute-level rollback capabilities to quickly undo unauthorized changes.

A DCShadow attack abuses the way Active Directory replication actually works. An attacker registers a rogue domain controller, then injects malicious changes through AD’s native replication protocols. Group memberships, SIDHistory, and even the KRBTGT account can all be modified. The changes look legitimate because AD treats them as normal replication traffic. No standard security event logs get triggered.

This article walks through how a DCShadow attack works step by step, what detection signals actually matter, and the specific controls that stop it, or help you recover fast when prevention fails.

What Is a DCShadow Attack?

The Core Concept

A DCShadow attack is a post-exploitation technique that targets Active Directory’s replication architecture. It doesn’t exploit a bug or a misconfiguration. Instead, it abuses the way domain controllers are designed to synchronize data with each other. The attacker temporarily registers a domain-joined machine as a legitimate domain controller, pushes malicious changes into AD through native replication protocols (MS-DRSR/DRSUAPI), and then removes the registration before anyone notices.

Benjamin Delpy, the creator of Mimikatz, and Vincent Le Toux first demonstrated this technique at BlueHat IL 2018. It’s classified under MITRE ATT&CK as T1207, Rogue Domain Controller. Here’s the part that makes this especially difficult to deal with: this technique cannot be patched. Microsoft would have to fundamentally redesign AD replication to eliminate it. That means your only real option is a combination of operational controls and dedicated detection capabilities.

What Makes It Different From Other AD Attacks

The most common point of confusion is between DCShadow and DCSync. They sound similar but work in opposite directions. DCSync impersonates a domain controller to pull password hashes and secrets from AD. DCShadow impersonates a domain controller to push unauthorized changes into AD. One is about data theft, the other is about data manipulation. That distinction matters enormously when you’re building detection strategies, because the telemetry you’d use to catch one won’t necessarily help you catch the other.

Because DCShadow injects changes through legitimate replication protocols, standard SIEM logging and AD audit logs do not capture the actual modifications. The changes simply appear as routine replication traffic between domain controllers.

While both attacks abuse Active Directory replication protocols, they serve very different purposes and leave different forensic footprints. The following table highlights the key operational differences between them:

Characteristic

DCSync

DCShadow

Direction of data flow

Pulls data from AD (password hashes, secrets)

Pushes malicious changes into AD

Primary goal

Credential theft

Persistence and privilege escalation

Registers rogue DC

No

Yes: temporarily in CN=Configuration

Visibility in security event logs

Partially detectable (Event ID 4662)

Changes bypass standard audit logs entirely

Self-cleaning

No

Yes: removes all registration artifacts

What Attackers Can Modify With DCShadow

Once an attacker has a rogue DC registered, they can modify virtually any AD attribute. The most commonly targeted objects and attributes give attackers long-term, hard-to-detect access across the environment:

  • SIDHistory: silently grants cross-domain access without raising obvious flags
  • primaryGroupID: moves accounts into privileged groups without changing visible group memberships
  • adminCount and userAccountControl flags: alter privilege indicators and account behavior at the attribute level
  • Direct group membership additions: place attacker-controlled accounts into high-privilege security groups
  • AdminSDHolder objects: ensure persistent privilege escalation that survives normal cleanup attempts
  • KRBTGT accounts: enable Golden Ticket attacks for unlimited Kerberos authentication forgery
  • Group Policy Objects: allow domain-wide configuration changes that affect every joined machine

Each of these modifications carries serious implications on its own. Combined, they give an attacker near-total control over the AD environment.

Impact on Active Directory and Your Organization

A single successful DCShadow push can grant an attacker Domain Admin-equivalent access, silently and retroactively. The changes replicate across every domain controller in the forest, meaning they become the authoritative state of your directory. Rolling them back requires knowing exactly which attributes were modified, something standard audit logs won’t tell you. This is one reason why proper Active Directory account management practices matter so much: weak operational hygiene makes it even harder to spot when something has gone wrong.

For organizations subject to HIPAA, SOX, PCI-DSS, or similar frameworks, an undetected DCShadow attack also creates a compliance gap. Changes were made to privileged accounts with no corresponding audit trail. That’s not just a security problem: it’s a regulatory one that can trigger reporting obligations, fines, and loss of trust with auditors and partners alike.

How a DCShadow Attack Works: Step by Step

Knowing that DCShadow abuses native replication is one thing. Understanding the exact sequence, what the attacker needs beforehand, what commands they run, and what happens inside AD during each phase, gives you a much better foundation for building detection and response capabilities. Let’s break it down.

Prerequisites an Attacker Needs

DCShadow is purely a post-exploitation technique. The attacker has already compromised the environment significantly before they’re in a position to run it. Specifically, they need SYSTEM-level privileges on a domain-joined machine (which does not have to be an actual domain controller), along with Domain Admin or Enterprise Admin credentials. They also need access to the lsadump::dcshadow module in Mimikatz. If any one of these prerequisites is missing, the attack simply cannot proceed.

The Attack Sequence

The attack follows a tight, deliberate sequence that can be completed in seconds. Each step builds on the previous one, and the final step erases evidence of the earlier ones:

  • Step 1: Privilege elevation. 
  • Step 2: Rogue DC registration. 
  • Step 3: Attribute staging. 
  • Step 4: Replication push. 
  • Step 5: Cleanup.

What the DCShadow Attach Phase Looks Like in Practice

The “attach” phase, Step 2 in the sequence above, is the critical detection window. During this brief period, the compromised machine’s SPN set includes replication-specific identifiers, and an NTDS Settings object exists under CN=Configuration. From AD’s perspective, a new domain controller has appeared. AD environments where DNS and replication abuse techniques are studied and understood will recognize this as anomalous, but automated tooling must watch in real time to catch it.

The entire attach-push-cleanup cycle can complete in under ten seconds. If your detection strategy depends on periodic scans or scheduled audits, the rogue DC will have appeared, replicated its payload, and vanished before your next check runs.

That narrow window is exactly why real-time replication monitoring, not log-based polling, is the only reliable way to observe the attach phase as it happens. Organizations that rely on periodic snapshots or scheduled configuration audits will consistently miss this activity. If you’re managing hybrid Active Directory environments, the challenge is even greater because you need visibility across both on-premises and cloud-connected infrastructure simultaneously.

Detecting a DCShadow Attack

Knowing how a DCShadow attack works is only half the battle. The harder question is: how do you actually catch one? The answer isn’t straightforward, because this technique was specifically designed to evade the detection mechanisms most organizations already have in place. Let’s look at what fails, what works, and where to focus your monitoring effort.

Why Standard Logging Fails

Here’s the uncomfortable truth. Changes replicated via DCShadow bypass Windows Security Event Logs. When an administrator modifies an AD object through normal tools, that action gets recorded in the directory’s audit trail. But when the same change arrives via replication, AD treats it as an internal synchronization event rather than an administrative action. So nothing gets written to NTDS.dit audit trails the way you’d expect.

The cleanup phase compounds this problem. Once the attacker removes the SPNs and deletes the NTDS Settings object from the Configuration partition, the forensic evidence that a rogue DC ever existed disappears. If you weren’t watching at the exact moment it happened, your post-incident investigation will come up empty. Native Windows auditing simply wasn’t built to handle this scenario.

DCShadow doesn’t break logging: it operates in a space where logging was never designed to reach. That’s why stacking more SIEM rules on top of existing event log collection won’t solve the problem.

Network-Level Detection Signals

Since log-based detection has fundamental blind spots here, network-level monitoring becomes your most reliable detection layer. The most definitive signal is DRSUAPI RPC traffic, specifically DRSReplicaAdd and GetNCChanges calls, originating from hosts that are not registered domain controllers. If a workstation or member server is initiating replication conversations with your DCs, that’s a red flag that demands immediate investigation.

You should also watch for unexpected GC/ SPNs or the DRS GUID (E3514235-4B06-11D1-AB04-00C04FC2DCD2) appearing on non-DC machines, along with SPN-scanning activity using tools like setspn -Q, which often serves as a precursor to the attack itself. These network-based signals are far more telling than anything you’ll pull from standard event logs, and they should form the backbone of your DCShadow detection strategy.

Windows Event IDs to Monitor

Event logs aren’t useless: they just can’t tell the full story on their own. While they won’t reveal the actual attribute changes pushed during replication, certain Event IDs do carry signals worth watching. The following process will help you build a focused monitoring baseline around the events that matter most:

  1. Configure alerting on Event ID 4928: this fires when an AD replica source naming context is established. Pay close attention to the Source DRA field; if it references a hostname that isn’t a known DC, escalate immediately.
  2. Monitor Event ID 4929: this indicates a replica source naming context was removed, which corresponds to the cleanup phase of the attack.
  3. Track Event ID 5136: directory service object modifications. While noisy on its own, correlating 5136 events with 4928/4929 from unexpected sources narrows the signal considerably.
  4. Watch for Event ID 5141: directory service object deletions, particularly of objects in the Configuration partition, which signal that an attacker is cleaning up after themselves.
  5. Correlate these events in sequence: a 4928 followed quickly by 4929 and 5141, all tied to a non-DC source, is a strong composite indicator of a DCShadow attack in progress or recently completed.

Following these steps gives your SOC a realistic chance of catching the forensic echoes of the attack, though it’s critical to understand that event logs alone won’t reveal the actual attribute changes that were pushed during replication. Organizations that have experienced data breaches tied to credential misuse often discover that this kind of correlation work is what separates a detected incident from a silent compromise.

Behavioral Indicators

Beyond network traffic and event IDs, endpoint telemetry can surface additional clues. Mimikatz process execution or command-line arguments containing lsadump::dcshadow are obvious giveaways, assuming your EDR solution is deployed on the compromised host and hasn’t been tampered with. Unexpected or transient computer objects appearing briefly in the Configuration partition are another strong indicator, as are replication requests initiated by domain-joined machines that have no business talking to DCs over those protocols.

The key is treating any replication activity from a non-DC machine as suspicious by default, not as something that might have a benign explanation. Build your detection logic around the assumption that legitimate DCs are a known, finite set, and anything outside that set initiating replication traffic deserves an immediate response.

How to Defend Against DCShadow Attacks and Recover When One Succeeds

When a DCShadow attack does succeed, the speed and granularity of your recovery determines whether it’s a contained incident or a full-blown crisis.

Preventive Controls

DCShadow cannot execute without Domain Admin or Enterprise Admin credentials. That single prerequisite is your biggest defensive advantage. Restrict membership in those groups aggressively. Every account sitting in Domain Admins that doesn’t absolutely need to be there is an opportunity for an attacker. Implement tiered administration models and just-in-time access so privileged credentials exist only when actively needed, then expire automatically.

Enforce Secure Admin Workstations for all privileged operations, and use network segmentation combined with host-based firewalls to control which machines can reach DCs over replication ports. Finally, alert on any SPN modifications that add GC/ or DRS-related entries to non-DC machines. That’s a direct precursor signal, and catching it early can stop the attack before it starts.

Continuous Monitoring Requirements

Periodic auditing won’t cut it here. The entire DCShadow attack cycle (registration, replication push, cleanup) can finish in seconds. Your monitoring has to operate at the AD replication layer in real time, not rely on scheduled scans or log polling intervals. Maintain a baseline of every legitimate domain controller in your environment so that any new DC registration triggers an immediate alert. Solutions that only watch Windows event logs will catch fragments of the activity but miss the actual attribute changes pushed through replication.

If your detection depends on periodic snapshots, the rogue DC will register, replicate its payload, and disappear before your next scheduled check ever runs.

What to Do When a DCShadow Attack Succeeds

First, identify exactly which attributes were modified. You’re looking for SIDHistory additions, group membership changes, adminCount flags, and userAccountControl alterations. This requires attribute-level change history, not just object-level audit logs. Remove any computer objects in the Configuration partition that aren’t legitimate DCs.

Then assess whether KRBTGT, AdminSDHolder, or GPO modifications occurred, since each demands its own remediation path (KRBTGT key rotation, AdminSDHolder resync, GPO rollback). In severe cases where the scope of changes is unclear, full AD forest recovery may be necessary, and having a clean, continuously validated standby environment is the fastest way back.

How Cayosoft Guardian Audit & Restore Closes the Gap

This is precisely the gap that Cayosoft Guardian Audit & Restore was built to fill. Because it monitors AD changes independently of native event logs, capturing modifications even when those logs have been bypassed or tampered with, it records the actual attribute-level changes that a DCShadow attack pushes through replication. That means your team gets a complete “who, what, when, and where” trail, plus the ability to roll back specific unauthorized modifications instantly rather than restoring entire directory partitions from backup.

The table below compares how traditional recovery tools stack up against Cayosoft Guardian across the capabilities that matter most during DCShadow incident response:

Capability

Native Logs + File-Based Backup

Cayosoft Guardian Audit & Restore

Captures replicated attribute changes

No: replication bypasses audit logs

Yes: monitors independently of event logs

Granular attribute-level rollback

No: requires full object or partition restore

Yes: individual attributes restored in seconds

Real-time monitoring on suspicious changes

Limited to event log-based correlation

Continuous monitoring with automatic threat identification

Covers hybrid AD + Entra ID + M365

Separate tools required

Unified console across all environments

Deployment complexity

Multiple agents and configurations

Agentless: operational within hours

The platform also feeds enriched change data into SIEM tools such as Microsoft Sentinel, Splunk, and QRadar, giving your SOC context that native logs cannot provide. For organizations running hybrid environments, unified visibility across on-premises AD, Entra ID, and Microsoft 365 from a single agentless deployment eliminates the blind spots that DCShadow attacks exploit.

Request a demo to see how Cayosoft Guardian Audit & Restore gives your team the visibility and rollback capability to respond to DCShadow attacks before the damage compounds.

Conclusion

DCShadow remains one of the hardest Active Directory threats to detect because it turns the very infrastructure you rely on into a weapon. The attack leaves no trace in the places most teams have been trained to look. Defending against it requires a genuine shift in how you think about detection, moving away from periodic audits and event log collection toward continuous, replication-layer monitoring that captures attribute changes the moment they occur. Tight control over privileged group membership and real-time SPN alerting reduce the likelihood of the attack succeeding at all.

If you’re responsible for securing a hybrid AD environment, start by auditing your Domain Admin membership today, confirming your DC topology baseline, and testing whether your current tooling can actually detect a rogue replication request originating from a non-DC host. The answers to those three questions will show you exactly where your gaps are, and how urgently you need to close them.

FAQs

DCShadow works by temporarily registering a compromised domain-joined machine as a legitimate domain controller, then using native AD replication protocols to push malicious attribute changes into the directory. After the changes replicate to real domain controllers, the attacker removes all traces of the rogue registration, leaving no evidence in standard audit logs.

EDR tools may detect Mimikatz execution or suspicious command-line arguments on the compromised host, but they cannot observe the replication-level changes being pushed into Active Directory. Detecting the actual directory modifications requires monitoring at the AD replication layer, not at the endpoint level alone.

The attacker needs Domain Admin or Enterprise Admin credentials along with SYSTEM-level access on a domain-joined machine. This makes it a post-exploitation technique that only becomes possible after significant compromise has already occurred within the environment.

No, they are distinct techniques, though DCShadow can enable Golden Ticket attacks by modifying the KRBTGT account through rogue replication. A Golden Ticket attack forges Kerberos tickets using a compromised KRBTGT hash, while DCShadow is focused on injecting unauthorized changes into Active Directory.

Recovery time depends entirely on whether you have attribute-level change tracking in place, since without it, identifying exactly what was modified can take days or weeks. Organizations with continuous replication monitoring and granular rollback capabilities can remediate specific changes in minutes rather than restoring entire directory partitions from backup.