We have control over user adunn and this user has DCSync privilege in the INLANEFREIGHT.LOCAL domain.
Let’s run DCSync in both Windows and Linux host.
Overview
DCSync - Steals the AD password database by using built-in Directory Replication Service Remote Protocol, which is used by DC to replicate domain data. Attacker can mimic a DC and retrieve user NTLM password hashes.
Key of this attack is requesting a DC to replicate passwords via DS-Replication-Get-Changes-All extended right.
To perform this attack, we need to have control over an account that has the rights to perform domain replication. Domain/Enterprise Admins and default domain admins have this right by default.
Cofirm DCSync
Get-DomainUser
Let’s first use PowerView’s Get-DomainUser to get the user’s SID:
Get-ObjectAcl
Now let’s check all ACLs set on the domain object using Get-ObjectAcl to get the ACLs associated with the object.
For this time, we will search specifically for replication rights and check if our user adunn possesses these rights.
Now we have confirmed adunn has replication rights.
DCSync Abuse
DCSync replication can be performed using tools such as Mimikatz, Invoke-DCSync, and impacket’s secretsdump.py.
secretsdump.py
Let’s use secretsdump.py to extract NTLM hashes and Kerberos Keys.
just-dc flag tells the tool to extract NTLM hashes and Kerberos keys from the NTDS file.
We can use -just-dc-ntlm flag for only NTLM hash or we can use jsut-dc-user <USERNAME> to only extract data for a specific user.
-pwd-last-set: when each account’s password was last changed
-history: dump password history
-user-status: check if a user is disabled
mimikatz
Reversible Password
Sometimes when dumping hashes with secretsdump or mimikatz, we can see that there’s plain text passwords. This is due to reversible password. It is using RC4 for encryption and it could be decrypted using the secret key on the system.
Let’s search for account with reversible encryption option set:
We can also use PowerView’s Get-DomainUser for this as well:
Moving On
Let’s study on ways to enumerate and take advantage of remote