DCSync and Replication Rights
Domain controllers keep each other up to date by asking for changes over the directory replication protocol (MS-DRSR, the "DRSUAPI" RPC interface): "send me everything that changed since USN 41,000". The reply includes secrets: the NT hashes and Kerberos keys of accounts whose passwords changed. Nothing in the protocol checks that the caller is a domain controller; it checks permissions on the domain object. Any account holding the two replication rights can therefore ask a DC for the keys of any account, including krbtgt, from any machine on the network, without touching a DC's disk or memory. That technique, implemented in Mimikatz in 2015 and in Impacket's secretsdump since, is called DCSync. It is the cleanest form of total domain compromise, and one of the easiest to detect if the right auditing is on.
Replication itself is explained in Domain Controllers, Replication and FSMO Roles.
The rights
Replication is controlled by extended rights (control-access rights) granted on the domain's naming context root (DC=corp,DC=lab,DC=test):
| Right | GUID | Grants |
|---|---|---|
| DS-Replication-Get-Changes | 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 |
replicate changes (without secret attributes) |
| DS-Replication-Get-Changes-All | 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 |
replicate secret attributes too (password hashes, keys) |
| DS-Replication-Get-Changes-In-Filtered-Set | 89e95b76-444d-4c62-991a-0facbeda640c |
replicate the RODC-filtered attribute set |
DCSync needs the first two. By default they are held by Domain Controllers, Enterprise Domain Controllers, Administrators, Domain Admins and Enterprise Admins (read-only DCs get only the first). Anyone else with both is a path to every key in the domain. Products have added themselves over the years: Microsoft Entra Connect's sync account needs Get-Changes and Get-Changes-All for password hash synchronisation, old Exchange installations had WriteDacl on the domain object (so they could grant themselves anything), and some identity-management and backup tools ask for the rights at install time.
Auditing who holds the rights
The export below is shaped like the access-control entries of the domain root ((Get-Acl "AD:DC=corp,DC=lab,DC=test").Access on a DC, reduced to identity, right and object type GUID). The script finds every principal holding both replication rights, or a right that lets it grant them, and compares the result with the expected list.
$acl = @'
Identity,Right,ObjectType
CORP\Domain Controllers,ExtendedRight,1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
CORP\Domain Controllers,ExtendedRight,1131f6ad-9c07-11d1-f79f-00c04fc2dcd2
NT AUTHORITY\ENTERPRISE DOMAIN CONTROLLERS,ExtendedRight,1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
NT AUTHORITY\ENTERPRISE DOMAIN CONTROLLERS,ExtendedRight,1131f6ad-9c07-11d1-f79f-00c04fc2dcd2
BUILTIN\Administrators,ExtendedRight,1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
BUILTIN\Administrators,ExtendedRight,1131f6ad-9c07-11d1-f79f-00c04fc2dcd2
CORP\Read-only Domain Controllers,ExtendedRight,1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
CORP\MSOL_8f3a21,ExtendedRight,1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
CORP\MSOL_8f3a21,ExtendedRight,1131f6ad-9c07-11d1-f79f-00c04fc2dcd2
CORP\svc-backup,ExtendedRight,1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
CORP\svc-backup,ExtendedRight,1131f6ad-9c07-11d1-f79f-00c04fc2dcd2
CORP\Exchange-Perms,WriteDacl,00000000-0000-0000-0000-000000000000
CORP\Domain Users,ReadProperty,00000000-0000-0000-0000-000000000000
'@ | ConvertFrom-Csv
$GET = '1131f6aa-9c07-11d1-f79f-00c04fc2dcd2'
$ALL = '1131f6ad-9c07-11d1-f79f-00c04fc2dcd2'
$expected = 'CORP\Domain Controllers', 'NT AUTHORITY\ENTERPRISE DOMAIN CONTROLLERS', 'BUILTIN\Administrators'
$documented = @{ 'CORP\MSOL_8f3a21' = 'Entra Connect sync account (password hash sync): Tier 0' }
$byId = $acl | Group-Object Identity
foreach ($g in $byId | Sort-Object Name) {
$rights = $g.Group
$sync = ($rights | Where-Object ObjectType -eq $GET) -and ($rights | Where-Object ObjectType -eq $ALL)
$grant = $rights | Where-Object { $_.Right -in 'WriteDacl', 'WriteOwner', 'GenericAll' }
if (-not ($sync -or $grant)) { continue }
$how = if ($sync) { 'can DCSync' } else { "can grant itself DCSync ($($grant[0].Right))" }
$verdict = if ($expected -contains $g.Name) { 'expected' }
elseif ($documented.ContainsKey($g.Name)) { 'documented: ' + $documented[$g.Name] }
else { 'FINDING' }
"{0,-44} {1,-36} {2}" -f $g.Name, $how, $verdict
}BUILTIN\Administrators can DCSync expected
CORP\Domain Controllers can DCSync expected
CORP\Exchange-Perms can grant itself DCSync (WriteDacl) FINDING
CORP\MSOL_8f3a21 can DCSync documented: Entra Connect sync account (password hash sync): Tier 0
CORP\svc-backup can DCSync FINDING
NT AUTHORITY\ENTERPRISE DOMAIN CONTROLLERS can DCSync expected
Two findings. svc-backup holds both rights, probably granted by a backup product's installer "to back up AD"; a backup agent needs a system-state backup on the DC, not replication from the network. Exchange-Perms holds WriteDacl on the domain, which is one step from DCSync, as the attack-path lesson showed. The Entra Connect account is legitimate, and that makes it and its server Tier 0: whoever controls the sync server controls an account that can read every hash.
Detecting DCSync
Replication by a real DC and by an attacker look alike in content; they differ in who and from where:
- 4662 (an operation was performed on an object) on DCs, with Directory Service Access auditing and the default SACL on the domain root:
Propertiescontains1131f6ad-…(Get-Changes-All) and the subject is not a DC computer account. This is the standard rule and it is reliable. - Network: DRSUAPI
DRSGetNCChangesrequests from an IP that isn't a DC (Zeek's DCE/RPC log, Defender for Identity's "suspected DCSync attack"). - Logon context: a 4624 on the DC (logon type 3) for the same account from the same source just before the 4662s.
The detection on synthetic 4662 events:
import pandas as pd
GET_ALL = "1131f6ad-9c07-11d1-f79f-00c04fc2dcd2"
dcs = {"DC01quot;: "10.10.0.20", "DC02quot;: "10.10.0.26"}
sync_accounts = {"MSOL_8f3a21": "10.10.0.27"} # documented: Entra Connect server
ev = pd.DataFrame([
("2026-01-15 09:00:00", "DC02quot;, "10.10.0.26", "{" + GET_ALL + "}"),
("2026-01-15 09:02:00", "MSOL_8f3a21", "10.10.0.27", "{" + GET_ALL + "}"),
("2026-01-15 09:15:00", "svc-backup", "10.10.0.21", "{" + GET_ALL + "}"),
("2026-01-15 09:15:01", "svc-backup", "10.10.0.21", "{" + GET_ALL + "}"),
("2026-01-15 09:20:00", "MSOL_8f3a21", "10.10.0.66", "{" + GET_ALL + "}"),
("2026-01-15 09:30:00", "alice", "10.10.0.21", "{bf967a86-0de6-11d0-a285-00aa003049e2}"),
], columns=["time", "subject", "ip", "properties"])
repl = ev[ev.properties.str.contains(GET_ALL, regex=False)].copy()
def verdict(r):
if dcs.get(r.subject) == r.ip:
return "ok: domain controller"
if sync_accounts.get(r.subject) == r.ip:
return "ok: documented sync server"
if r.subject in sync_accounts:
return "ALERT: sync account replicating from an unexpected host"
return "ALERT: DCSync by a non-DC account"
repl["verdict"] = repl.apply(verdict, axis=1)
print(repl.drop(columns="properties").drop_duplicates(["subject", "ip"]).to_string(index=False)) time subject ip verdict
2026-01-15 09:00:00 DC02$ 10.10.0.26 ok: domain controller
2026-01-15 09:02:00 MSOL_8f3a21 10.10.0.27 ok: documented sync server
2026-01-15 09:15:00 svc-backup 10.10.0.21 ALERT: DCSync by a non-DC account
2026-01-15 09:20:00 MSOL_8f3a21 10.10.0.66 ALERT: sync account replicating from an unexpected host
The rule catches both the over-privileged backup account and the more dangerous case: the legitimate sync account replicating from 10.10.0.66, meaning its credentials were stolen and used elsewhere. The allow-list is per account and host for that reason.
How it is prevented
- Only DCs, and documented Tier 0 sync accounts, hold the replication rights; remove all others and any
WriteDacl,WriteOwnerorGenericAllon the domain root (Auditing ACLs). - Treat Entra Connect (and any other sync server) as Tier 0: patched, isolated, admin only from Tier 0 PAWs.
- Enable Directory Service Access auditing so 4662 exists, and forward it.
- Network-level: allow DRSUAPI to DCs only from other DCs and the sync server, where the network design permits.
- If DCSync happened: assume every key is known. Reset
krbtgttwice (Golden and Silver Tickets), then all privileged accounts, service accounts and, in time, all users.
Pitfalls
- Looking for 4662 without the SACL. The default domain-root SACL covers these rights, but hardened or migrated domains sometimes lost it; test with a lab replication.
- Allow-listing by account only. A stolen sync-account password replicates just as well from a laptop.
- Assuming "admins only" means safe. Every Domain Admin can DCSync; the question is how many such accounts exist and where they sign in.
- Forgetting nested groups and owners of the domain object.
Practice
1. Which of the two GUIDs is the one to alert on, and why not the other?
1131f6ad-… (Get-Changes-All): it is needed for secrets. 1131f6aa-… alone is used by more tools (for example directory synchronisation without password hashes) and is noisier.
2. The backup vendor says its agent needs replication rights. What do you ask?
Which operation needs them. A system-state backup of a DC is taken locally by the backup service on the DC (Backup Operators rights), not by replication; if the product replicates secrets over the network to its own server, that server becomes Tier 0 and must be protected and documented as such.
3. Add a row to the 4662 data that should not alert, and one that should.
Not alert: ("…", "DC01quot;, "10.10.0.20", "{1131f6ad-…}"), a DC replicating from its own address. Alert: ("…", "DC01quot;, "10.10.0.66", …), a DC account used from another host, for example with a forged or stolen machine credential.
Test yourself
What does DCSync need?
- Local admin on a DC
- The DS-Replication-Get-Changes and Get-Changes-All rights on the domain object
- Physical access to NTDS.dit
- Schema Admins membership
Which event and property reveal DCSync on a DC?
- 4769 with RC4
- 4662 with the Get-Changes-All GUID, by a non-DC account
- 4625 with 0xC000006A
- 7045
Why is the Entra Connect server Tier 0?
- It runs DNS
- Its sync account holds replication rights for password hash sync, so controlling the server gives access to every hash
- It is a domain controller
- It hosts SYSVOL
Which right on the domain object is one step from DCSync?
- ReadProperty
- WriteDacl
- ListChildren
- Read