Certipy is the go-to tool for enumerating and abusing Active Directory Certificate Services (AD CS) from Linux. It discovers templates and CAs, requests certificates, and turns them into domain authentication (NT hash or Kerberos TGT). It is the practical replacement for Certify + PKINITtools in a single Python binary.
What makes AD CS dangerous is not a single vulnerability but the configuration: a template that lets the requester set the subjectAltName (ESC1) turns any user into a domain admin. Certipy automates the whole flow — find spots the flaw, req issues the certificate impersonating the UPN, and auth redeems it for credentials — which is why understanding the condition behind each ESC matters more than memorizing the commands.
1. Beginner level — enumerate and request certificates
certipy req -u user@dom -p pass -ca CA -template T -key-size 4096
Adjust the key size
KRB5CCNAME=admin.ccache secretsdump.py -k dc.dom
Chain the TGT with secretsdump
3. Details people miss
Sync your clock with the DC (ntpdate or faketime) before running certipy auth: PKINIT and Kerberos reject tickets with time skew and you will hit KRB_AP_ERR_SKEW errors.
Since the May 2022 patch (KB5014754) the CA requires the SID embedded in the certificate; if ESC1 fails, add -sid with the victim's SID as shown in the first advanced row.
certipy find -vulnerable only flags what Certipy knows how to detect: always review the full report, because misconfigured templates may need manual judgment (enrollment rights, EKUs) that the flag does not surface.
Save the .pfx and protect its key: it is equivalent to the impersonated account's credentials and usually stays valid for the certificate's full lifetime, surviving a password change.
For ESC8 (relay) you must coerce authentication (PetitPotam, PrinterBug) toward your host; the relay alone does not trigger the incoming connection.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.
Certipy es la herramienta de referencia para enumerar y abusar de Active Directory Certificate Services (AD CS) desde Linux. Descubre plantillas y CAs, solicita certificados, y los convierte en autenticación contra el dominio (hash NT o TGT de Kerberos). Es el reemplazo práctico de Certify + PKINITtools en un solo binario de Python.
Lo que hace peligroso a AD CS no es una vulnerabilidad puntual sino la configuración: una plantilla que permita al solicitante fijar el subjectAltName (ESC1) convierte a cualquier usuario en administrador del dominio. Certipy automatiza el flujo completo — find detecta el fallo, req emite el certificado suplantando el UPN, y auth lo canjea por credenciales — por eso entender qué condición habilita cada ESC importa más que memorizar los comandos.
1. Nivel principiante — enumerar y solicitar certificados
certipy req -u user@dom -p pass -ca CA -template T -key-size 4096
Ajusta el tamaño de clave
KRB5CCNAME=admin.ccache secretsdump.py -k dc.dom
Encadena TGT con secretsdump
3. Detalles que se pasan por alto
Sincroniza el reloj con el DC (ntpdate o faketime) antes de usar certipy auth: PKINIT y Kerberos rechazan tickets con desfase horario y verás errores KRB_AP_ERR_SKEW.
Desde el parche de mayo de 2022 (KB5014754) la CA exige el SID incrustado en el certificado; si ESC1 falla, añade -sid con el SID de la víctima como en la primera fila avanzada.
certipy find -vulnerable solo marca lo que Certipy sabe detectar: revisa siempre el informe completo, porque plantillas mal configuradas pueden requerir criterio manual (permisos de inscripción, EKUs) que el flag no resalta.
Guarda el .pfx y protege su clave: equivale a las credenciales de la cuenta suplantada y suele ser válido durante toda la vigencia del certificado, no caduca con un cambio de contraseña.
Para ESC8 (relay) necesitas coaccionar autenticación (PetitPotam, PrinterBug) hacia tu host; el relay por sí solo no dispara la conexión entrante.
Uso responsable
Estos comandos son para entornos propios o con autorización explícita por escrito (laboratorios, CTF, auditorías contratadas). Usarlos contra infraestructura ajena sin permiso es ilegal en la mayoría de países.