For the complete documentation index, see llms.txt. This page is also available as Markdown.

DCSync

Overview

  • DCSync steals the Active Directory password database using the built-in Directory Replication Service Remote Protocol

  • Mimics a Domain Controller to retrieve user NTLM password hashes

  • Requires DS-Replication-Get-Changes and DS-Replication-Get-Changes-All extended rights

  • Domain/Enterprise Admins have this right by default

Checking for DCSync Rights

PowerView

$sid = "S-1-5-21-3842939050-3880317879-2865463114-1164"
Get-ObjectAcl "DC=inlanefreight,DC=local" -ResolveGUIDs | ? { ($_.ObjectAceType -match 'Replication-Get')} | ?{$_.SecurityIdentifier -match $sid} | select AceQualifier, ObjectDN, ActiveDirectoryRights,SecurityIdentifier,ObjectAceType | fl

BloodHound

  • Use pre-built query: "Find Principals with DCSync Rights"

Performing DCSync

From Linux with secretsdump.py

From Windows with Mimikatz

Output Files

  • When using -just-dc flag, three files are created:

    • .ntds - NTLM hashes

    • .ntds.kerberos - Kerberos keys

    • .ntds.cleartext - Cleartext passwords (accounts with reversible encryption)

Reversible Encryption

  • Accounts with "Store passwords using reversible encryption" enabled store passwords using RC4 encryption

  • The Syskey can decrypt them, and tools like secretsdump.py will show cleartext

  • Check for accounts with reversible encryption:

DCSync via Group Membership Abuse

If you have GenericAll over a group that holds DCSync rights (e.g., GetChanges and GetChangesAll), add yourself to that group then perform DCSync.

Add User to Privileged Group

DCSync After Group Addition

Cleanup


Mitigation

  • Limit accounts with DCSync rights to only Domain Controllers

  • Monitor for replication requests from non-DC sources

  • Audit the DS-Replication-Get-Changes and DS-Replication-Get-Changes-All permissions regularly

Last updated