DC Sync Attack: The Art of Impersonation

In the arsenal of credential dumping techniques, few are as elegant and devastating as the DC Sync attack. Unlike traditional methods that require forcing entry into the NTDS.dit database file on a Domain Controller's hard drive, DC Sync exploits the fundamental DNA of Active Directory itself: Replication.

By impersonating a Domain Controller, an attacker can politely ask the network to hand over the keys to the kingdom—including the NTLM hashes of Domain Admins and the long-term krbtgt keys—all without ever logging into a Domain Controller or triggering traditional file-integrity monitors.

Understanding the Mechanism

To understand DC Sync, one must understand Active Directory replication. AD uses a multi-master replication model, meaning any Domain Controller (DC) can update the directory, and those changes must propagate to all other DCs to ensure consistency.

This replication relies on the Directory Replication Service Remote Protocol (DRSR). When a DC needs an update, it calls functions like IDL_DRSGetNCChanges to request data from its peers.

The Vulnerability

The vulnerability is not a bug; it is a feature. The ability to request replication data is controlled by specific Access Control List (ACL) permissions on the domain root object. If a user account has these permissions, the Domain Controller cannot distinguish it from a legitimate peer DC. It effectively says, "You have the badge; here is the data."

The specific permissions required are:

  1. Replicating Directory Changes
  2. Replicating Directory Changes All
  3. Replicating Directory Changes In Filtered Set (optional but common)

The Attack Lifecycle

A DC Sync attack typically follows a linear path from compromise to domain dominance.

1. Identifying Vulnerable Accounts

Attackers scanning the network look for non-machine accounts that possess the "Replicating" rights. Often, these rights are inadvertently granted to service accounts for synchronization tools (e.g., Azure AD Connect) or backup solutions.

2. Execution (The Mimikatz Way)

Once an attacker has compromised a user with these rights (or escalated privileges to an account that has them, like a Domain Admin), they can execute the attack from any machine in the network. They do not need to be on a DC.

Standard usage with Mimikatz:

# Dump the hash of the Administrator
lsadump::dcsync /domain:corp.local /user:Administrator

Output example:

[DC] 'corp.local' will be the domain
[DC] 'Administrator' will be the user account
Object RDN           : Administrator
** SAM ACCOUNT **
NTLM                 : 8846f7eaee8fb117ad06bdd830b7586c

3. The Golden Ticket

The ultimate goal of a DC Sync is often not just the Administrator hash, but the KRBTGT hash. This account encrypts all Kerberos Ticket Granting Tickets (TGTs). With this hash, an attacker can mint "Golden Tickets"—custom TGTs that grant valid access to any resource in the domain for 10 years, even if every user password is changed.

Comparison: DC Sync vs. Traditional Dumping

FeatureNTDS.dit ExtractionDC Sync
RequirementLocal Admin on DCReplication Rights (Remote)
MethodCopying locked file (VSS)RPC / DRSR Protocol
StealthNoisy (disk I/O, VSS logs)Stealthier (looks like traffic)
Remote?No (usually requires shell)Yes (can run from workstation)

Detection and Defense

Blocking DC Sync requires a combination of strict permission management and network visibility.

1. Audit Replication Permissions

The most effective defense is ensuring only domain controllers have replication rights. You can audit this with PowerShell:

# Check for accounts with replication rights on the domain root
$Root = (Get-ADRootDSE).defaultNamingContext
$ACL = Get-Acl "AD:\$Root"
$ACL.Access | Where-Object { 
    $_.ActiveDirectoryRights -like "*Replication*" -and 
    $_.IdentityReference -notlike "*Domain Controllers*" 
}

2. Network Segmentation

Replication traffic (RPC over TCP 135 and dynamic ports) should strictly happen between Domain Controllers. Workstations should never need to talk to a DC on these ports for replication purposes.

  • Firewall Rule: Block RPC traffic to DCs from non-Tier 0 subnets.

3. Event Monitoring

While DC Sync is stealthier than file copying, it leaves a trace.

  • Event ID 4662: An operation was performed on an object. Look for the Access Mask 0x100 (Control Access) and properties containing the replication GUIDs (1131f6aa...).
  • Source IP: Any replication request coming from an IP address that is not a known Domain Controller is an immediate high-fidelity alert.

Conclusion

The DC Sync attack highlights a critical lesson in Active Directory security: Identity is the new perimeter. The attacker doesn't need to breach the server room if they can simply ask the server to email them the passwords. By strictly monitoring the specific ACLs that control replication and segmenting DC traffic, organizations can neutralize this powerful technique.

Love it? Share this article: