DCSync
![](https://book.hacktricks.xyz/~gitbook/image?url=https%3A%2F%2F129538173-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-L_2uGJGU7AVNRcqRvEi%252Fuploads%252F5TcVz2YCPl9uPQOfof4g%252Fimage.png%3Falt%3Dmedia%26token%3Dd432ad03-20d1-4ca4-a621-0dbbcdf316da&width=768&dpr=4&quality=100&sign=cebea23d&sv=1)
Use Trickest to easily build and automate workflows powered by the world's most advanced community tools. Get Access Today:
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:
HackTricks Training GCP Red Team Expert (GRTE)
DCSync
The DCSync permission implies having these permissions over the domain itself: DS-Replication-Get-Changes, Replicating Directory Changes All and Replicating Directory Changes In Filtered Set.
Important Notes about DCSync:
The DCSync attack simulates the behavior of a Domain Controller and asks other Domain Controllers to replicate information using the Directory Replication Service Remote Protocol (MS-DRSR). Because MS-DRSR is a valid and necessary function of Active Directory, it cannot be turned off or disabled.
By default only Domain Admins, Enterprise Admins, Administrators, and Domain Controllers groups have the required privileges.
If any account passwords are stored with reversible encryption, an option is available in Mimikatz to return the password in clear text
Enumeration
Check who has these permissions using powerview
:
Exploit Locally
Exploit Remotely
-just-dc
generates 3 files:
one with the NTLM hashes
one with the the Kerberos keys
one with cleartext passwords from the NTDS for any accounts set with reversible encryption enabled. You can get users with reversible encryption with
Persistence
If you are a domain admin, you can grant this permissions to any user with the help of powerview
:
Then, you can check if the user was correctly assigned the 3 privileges looking for them in the output of (you should be able to see the names of the privileges inside the "ObjectType" field):
Mitigation
Security Event ID 4662 (Audit Policy for object must be enabled) – An operation was performed on an object
Security Event ID 5136 (Audit Policy for object must be enabled) – A directory service object was modified
Security Event ID 4670 (Audit Policy for object must be enabled) – Permissions on an object were changed
AD ACL Scanner - Create and compare create reports of ACLs. https://github.com/canix1/ADACLScanner
References
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:
HackTricks Training GCP Red Team Expert (GRTE)
![](https://book.hacktricks.xyz/~gitbook/image?url=https%3A%2F%2F129538173-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-L_2uGJGU7AVNRcqRvEi%252Fuploads%252F5TcVz2YCPl9uPQOfof4g%252Fimage.png%3Falt%3Dmedia%26token%3Dd432ad03-20d1-4ca4-a621-0dbbcdf316da&width=768&dpr=4&quality=100&sign=cebea23d&sv=1)
Use Trickest to easily build and automate workflows powered by the world's most advanced community tools. Get Access Today:
Last updated