What is a DCSync Attack?
A DCSync attack is a type of Active Directory attack where an attacker queries a domain controller to obtain account credentials without ever compromising the DC directly. Essentially, it abuses replication privileges in AD to “ask” the domain controller to provide the password hashes of user accounts.
With this attack, an attacker can obtain:
- NTLM hashes
- Kerberos Ticket-Granting Ticket (TGT) keys
- Passwords of domain administrators
This gives near-complete control over the domain if executed successfully.
How DCSync Works
1. Required Permissions
For DCSync, the attacker needs one of these privileges:
- Replicating Directory Changes
- Replicating Directory Changes All
- Membership in privileged groups such as Domain Admins or Enterprise Admins
These permissions allow an account to replicate directory objects, including user credentials.
2. Core Mechanism
DCSync leverages the MS-DRSR protocol (Microsoft Directory Replication Service Remote Protocol) to request password-related attributes from a DC.
Key attributes that can be extracted include:
unicodePwd– The cleartext password (if retrievable)ntPwdHistory– NTLM hash historylmPwdHistory– LM hash historydBCSPwd– LM/NTLM hashsupplementalCredentials– Kerberos keys
Attackers do not need physical access to a DC. They simply impersonate a DC and request replication data.
Tools Commonly Used for DCSync
-
Mimikatz – The go-to tool for DCSync attacks
# Example: Dump all domain users' hashes mimikatz # privilege::debug mimikatz # lsadump::dcsync /domain:example.local /user:Administrator -
Impacket – Python library for performing DCSync via scripts
# Using secretsdump.py to dump hashes via DCSync python3 secretsdump.py example.local/username:password@dc.example.local - PowerView – Useful for discovering accounts with replication privileges
Exploitation Scenario
Here’s a typical DCSync attack workflow:
-
Initial Access The attacker compromises a low-privileged domain account.
-
Privilege Escalation The attacker identifies accounts with replication privileges, often using PowerView or BloodHound.
-
Perform DCSync Using Mimikatz or Impacket, the attacker extracts password hashes of high-value accounts like Domain Admins.
-
Persistence & Lateral Movement With admin credentials, the attacker can:
- Create backdoor accounts
- Extract sensitive data
- Access all resources in the domain
Defending Against DCSync
-
Monitor Replication Permissions Limit
Replicating Directory ChangesandReplicating Directory Changes Allprivileges to only domain controllers and trusted accounts. -
Monitor Event Logs
- Event ID 4662 (object access) and 4672 (special privileges) can indicate suspicious replication attempts.
-
Use Tiered Administrative Model Separate admin accounts based on privilege tiers to reduce the risk of credential compromise.
-
Implement LAPS (Local Administrator Password Solution) Reduces lateral movement risk with local admin accounts.
Conclusion
The DCSync attack is a highly dangerous technique that highlights how misconfigured AD permissions can allow attackers to extract credentials without touching the domain controllers directly. Understanding this attack is crucial for both penetration testers and security teams to detect, mitigate, and harden Active Directory environments.