Lion Cipher Lab

Exploit AD CS ESC1 with Certipy: forge a Domain Admin certificate, then fix the template

Why it matters

For years, Active Directory Certificate Services was the quiet corner of the domain nobody audited -- and it turned out to be one of the most reliable roads to total domain compromise. AD CS is the Microsoft service that issues the digital certificates an organisation uses for smart-card logon, Wi-Fi, VPN, and web servers; because a certificate can be used to LOG IN as a user (via PKINIT, the certificate flavour of Kerberos), a single misconfigured certificate template can let an ordinary domain user request a certificate that says 'I am the Domain Administrator' and then authenticate as that…

What you'll learn

Steps in this lab

  1. First: this is your lab, and AD CS abuse is a real domain takeover
  2. The words you need: AD CS, CA, certificate template, EKU, enrollment rights
  3. What ESC1 is: the four ingredients that make a template a domain-takeover
  4. Set up the target: install AD CS and publish a deliberately vulnerable template
  5. Get Certipy ready on your Kali attacker VM
  6. Enumerate: let Certipy find and name the ESC1 template
  7. Attack step 1: request a certificate that impersonates the Domain Admin
  8. Attack step 2: PKINIT with the certificate to get a TGT and the admin's hash
  9. Prove domain compromise with what you recovered
  10. Fix it: remove the ESC1 condition and re-test to prove it's closed
  11. What you did, when to reach for it, and when NOT to

Open the full interactive lab →