DCSync
Also calledDRSUAPI, GetNCChanges, Replication abuse, krbtgt
Asks a domain controller to replicate account secrets, as another DC would.
- Needs
- Replication
- Gives
- krbtgt KeyandNT HashandAES KeyandService Key
How the Attack Works
Domain controllers copy changes between themselves with the directory replication service, and a DC answers a GetNCChanges request with account secrets for any caller holding the replication rights on the domain. It checks those rights, not whether the caller is a domain controller, so the request can come from any machine. Domain Admins, Enterprise Admins, the built-in Administrators and the DCs hold the rights by default, and the Entra Connect sync account holds them by design.
Read first Password Hashes and Kerberos Keys
How It Plays Out
The attack step by step. Each step shows which machines take part, what travels, the keys and tickets each side now holds, what is logged and what a defender can see.
ws-042 Foothold
dc-01 Domain controller
- krbtgt key
- dana's key
- srv-fin-01 key
Step 1 of 3: Replication Request
ws-042 Foothold to dc-01 Domain controller
ws-042, which is not a DC, asks dc-01 to replicate named accounts' secrets, krbtgt's among them.
Logged
4662 An operation was performed on an object
On dc-01, in the Security log When enabled
Control Access on the domain object with DS-Replication-Get-Changes-All, by the caller
What Defenders See
The Security log on dc-01 shows event 4662 naming the replication rights, for an account that is not a DC. Replication from ws-042, an address that is not a DC's, shows too, and so does Defender for Identity's DCSync alert.
Step 2 of 3: Secrets Replicated
dc-01 Domain controller to ws-042 Foothold
dc-01 checks only that the caller holds the replication rights, then returns the accounts' keys.
Keys
- ws-042 now holds krbtgt key (new at this step) dana's key (new at this step) srv-fin-01 key (new at this step)
What Defenders See
The Security log on dc-01 records nothing more. Defender for Identity alerts on the request from ws-042, a computer that is not a DC.
Step 3 of 3: Keys Put to Use
On ws-042 Foothold
The krbtgt key forges TGTs. The other keys serve pass-the-hash, overpass-the-hash and silver tickets.
What Defenders See
No log on ws-042 or any DC shows anything until the keys are used. From then on, the golden ticket and pass-the-hash pages take over.
Needs First
What the attacker must already hold for this attack to be possible.
- Replication RightsAn account holding the replication rights, such as Domain Admins, a DC account, or one granted them.
Gives the Attacker
What running it hands the attacker to use next.
- The krbtgt KeyThe krbtgt key, for golden and diamond tickets, without touching any DC disk.
- An NT HashAny account's NT hash, and its password history, on request.
- An AES KeyAny account's Kerberos AES keys, where it has them.
- A Service's KeyAny service or computer account's key, for silver tickets.
Leads To
- krbtgt Key: Golden Ticket, Diamond and Sapphire Tickets, DCShadow
- NT Hash: Pass-the-Hash, Overpass-the-Hash
- AES Key: Overpass-the-Hash
- Service Key: Silver Ticket
What Defenders See
What this attack leaves for a defender to find, and what to read in each. None of it is proof on its own, so treat each as a lead and confirm it against the rest.
| Event and Log | Written On | Look For | Switch It On |
|---|---|---|---|
| 4662 An operation was performed on an object (opens in a new tab) Security log | Domain controllers, for objects with a matching audit entry | Properties naming 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 (Get-Changes-All) for an account that is not a DC or the sync account. | Audit Directory Service Access, and an audit entry (SACL) on the object |
Defender for Identity Alerts
Where Defender for Identity runs, its sensors raise these from what they read on the servers they are installed on, domain controllers above all. Each names what it flags, which is a lead to confirm, not proof on its own.
- Suspected DCSync attack (replication of directory services) (opens in a new tab)Raised when a computer that is not a DC asks for replication.
- DCSync attack (replication of directory services) (opens in a new tab)
- Possible NetSync attack (opens in a new tab)A related request over Netlogon that asks a DC for a computer account's password hash while posing as a DC.
Blind Spots
Where this attack leaves little or nothing to see, so a quiet log is not read as an all-clear.
- Without Directory Service Access auditing and an audit entry on the domain object, a DC writes no 4662 for DCSync at all.
- 4662 names the account, not the machine. A DC's own account used from elsewhere looks like normal replication until its Logon ID is matched to the DC's 4624, which holds the source address.
Hunt It
The query to run in each tool, and how well each one sees this attack. Pick the tool you use, and the others load their query when you open them.
Needs Defender for Identity sensors on every DC, and replace the dc- prefix with your DCs' names. The Entra Connect server replicates by design.
// Directory replication asked for by a computer that is not a domain controllerIdentityDirectoryEvents| where Timestamp > ago( 30d)| where ActionType has "replication"| where not( DeviceName startswith "dc-")| project Timestamp, ActionType, AccountName, AccountDomain, DeviceName, IPAddress, DestinationDeviceName, AdditionalFields| order by Timestamp descHow to Prevent It
The controls that break this attack, each with how it helps here and, where the Registry topic has it, where to check it on a machine.
Replication rights reviewed (opens in a new tab)
Take the replication rights from accounts that are not DCs or admins, and limit the sync account to what it needs.
Least-privilege administration (opens in a new tab)
Keep the groups that hold the rights by default, such as Domain Admins and Enterprise Admins, nearly empty.
Tiered administration (opens in a new tab)
Keep those accounts off every machine below the DCs, so their credentials are not there to take.
krbtgt password reset (opens in a new tab)
After any replication by an outsider, reset krbtgt twice and treat every account key as known.
Sources
- MITRE ATT&CK T1003.006: OS Credential Dumping: DCSync (opens in a new tab)
- [MS-DRSR] 4.1.10: IDL_DRSGetNCChanges (opens in a new tab)
- [MS-DRSR] 5.101: IsGetNCChangesPermissionGranted (the rights a DC checks) (opens in a new tab)
- Microsoft Learn: DS-Replication-Get-Changes-All extended right (opens in a new tab)
- Microsoft Learn: Defender for Identity, configure domain object auditing (event 4662) (opens in a new tab)
- Microsoft Learn: Remove non-admin accounts with DCSync permissions (opens in a new tab)
- Microsoft Learn: Remove unnecessary replication permissions for the Entra Connect account (opens in a new tab)