DCSync Attack Explained: Dumping Domain Hashes Without Touching the DC

DCSync is the attack that turns "I have the right permissions" into "I have every password hash in the domain". It doesn't run code on a domain controller, doesn't touch NTDS.dit on disk, and to the network it looks a lot like normal DC-to-DC replication. This post covers how it works, who can do it, how to run it in a lab, and what the detection looks like.

Lab only. Run this against your own lab or with written authorization.

How domain controllers replicate

Domain controllers keep each other in sync with the Directory Replication Service Remote Protocol (MS-DRSR). When one DC needs changes from another, it calls DRSGetNCChanges and asks for the objects that changed, including secret attributes like unicodePwd (the NT hash) and the Kerberos keys.

The DC answering that call doesn't check "is the caller another DC?". It checks whether the caller holds the right extended rights on the domain object. If you hold them, you can impersonate a DC and ask for any account's secrets. That's DCSync.

The rights that matter

  • DS-Replication-Get-Changes (GUID 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2)
  • DS-Replication-Get-Changes-All (GUID 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2), which is the one that allows replicating secrets
  • DS-Replication-Get-Changes-In-Filtered-Set (GUID 89e95b76-444d-4c62-991a-0facbeda640c), which some tools also request

By default these are held by Domain Admins, Enterprise Admins, Administrators and the domain controller computer accounts. The interesting findings are the accounts that hold them and shouldn't: an old Azure AD Connect account, a backup service account, or a user someone granted rights to "temporarily". BloodHound shows these as DCSync, GetChanges and GetChangesAll edges. See BloodHound for beginners for how to find them.

Running DCSync with secretsdump

From Linux, Impacket's secretsdump.py performs DCSync when you point it at a DC with an account that holds the rights. Ask for one account first, usually krbtgt or a domain admin, instead of dumping everything:

secretsdump.py corp.local/svc_sync:'Password1'@10.10.10.10 -just-dc-user krbtgt

With an NT hash instead of a password:

secretsdump.py -hashes :<NT_HASH> corp.local/svc_sync@10.10.10.10 -just-dc-user administrator

-just-dc dumps every account through DRSUAPI. On a real engagement, dumping the whole domain is a scope and data-handling question to settle with the client before you do it, not after.

Running DCSync with Mimikatz

lsadump::dcsync /domain:corp.local /user:corp\krbtgt

Mimikatz needs to run as an account with the replication rights. It doesn't need to run on the DC.

What you do with the hashes

  • The Administrator NT hash lets you authenticate with pass-the-hash. More on that in Pass-the-Hash vs Pass-the-Ticket vs Overpass-the-Hash.
  • The krbtgt keys let you forge Golden Tickets, which is why a DCSync finding usually means a full domain compromise and a double krbtgt reset during remediation.
  • Password hashes for the whole domain let you measure password reuse and weak passwords, if that's in scope.

Detection

  • Event 4662 (an operation was performed on an object) on the domain object, with the replication GUIDs above in the properties. This requires auditing "Directory Service Access" with a SACL on the domain root.
  • Filter out DC computer accounts. A 4662 with 1131f6ad-... from a user account or from a non-DC IP is the signal.
  • Network: DRSUAPI GetNCChanges traffic from a host that isn't a domain controller. Many NDR and identity-protection tools alert on exactly this.
  • Alert on changes to the domain object's ACL that add replication rights (event 5136).

Mitigation

  • Review who holds replication rights on the domain root. Anything beyond the default groups and DCs needs a documented reason.
  • Treat accounts like Azure AD Connect sync accounts as Tier 0. Protect them like domain admins.
  • Keep Domain Admin membership small and use separate admin accounts.
  • If DCSync happened, reset krbtgt twice (with replication time between resets) and rotate privileged credentials.

FAQ

Does DCSync require Domain Admin?

No. It requires the DS-Replication-Get-Changes and DS-Replication-Get-Changes-All rights. Domain Admins have them by default, but so can any account someone delegated them to.

Does DCSync touch the domain controller's disk?

No. It asks the DC for the data over the replication protocol. Nothing is written to or read from NTDS.dit by the attacker directly.

What Event ID detects DCSync?

Event ID 4662 with the DS-Replication-Get-Changes-All GUID 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2, from an account or host that isn't a domain controller.

Get new AD attack write-ups

Kerberos, ADCS and HTB write-ups by email, with the detection side included. No spam. Unsubscribe in one click.