adcs-security-review
Skill0 starsChanged 12 days agoMITView on GitHub
Review Active Directory Certificate Services for ESC1–ESC16 style misconfigurations — enrollee-supplied SAN templates, dangerous EKUs, weak template/CA ACLs, EDITF_ATTRIBUTESUBJECTALTNAME2, web enrollment NTLM relay — using Certify/Certipy output, PSPKIAudit or Locksmith, and monitor certificate issuance. Use when assessing AD CS, after an AD compromise, or investigating suspicious certificate requests.
In this repository273 other files it gives its agents.
- ad-attack-path-analysisSkill
- ad-privileged-access-reviewSkill
- dcsync-detectionSkill
- gpo-security-reviewSkill
- kerberos-attack-detectionSkill
- agent-tool-permission-reviewSkill
- ai-incident-responseSkill
- llm-gateway-controlsSkill
- llm-security-evaluationSkill
- mcp-server-security-reviewSkill
- model-artifact-securitySkill
- prompt-injection-reviewSkill
- rag-security-reviewSkill
- api-abuse-detectionSkill
- api-authorization-testingSkill
- api-inventorySkill
- api-schema-securitySkill
- dast-baselineSkill
- sast-triageSkill
- sca-dependency-riskSkill
- secure-code-reviewSkill
- security-requirementsSkill
- threat-modelingSkill
- asset-criticality-tieringSkill
- asset-inventory-reconciliationSkill
- external-attack-surface-reviewSkill
- shadow-it-discoverySkill
- aws-credential-compromiseSkill
- aws-iam-reviewSkill
- aws-org-guardrailsSkill
- cloudtrail-investigationSkill
- guardduty-triageSkill
- s3-exposure-reviewSkill
- azure-activity-investigationSkill
- azure-rbac-reviewSkill
- conditional-access-reviewSkill
- entra-audit-investigationSkill
- entra-signin-investigationSkill
- backup-assuranceSkill
- critical-service-mappingSkill
- ransomware-recoverySkill
- recovery-exerciseSkill
- cloud-exposure-reviewSkill
- cloud-incident-responseSkill
- cloud-logging-baselineSkill
- cloud-posture-assessmentSkill
- audit-evidence-packageSkill
- continuous-control-monitoringSkill
- control-mappingSkill
- control-testing-samplingSkill
- container-incidentSkill
- dockerfile-hardeningSkill
- image-scanningSkill
- runtime-detection-falcoSkill
- db-audit-loggingSkill
- db-exfiltration-investigationSkill
- db-hardeningSkill
- db-privilege-reviewSkill
- data-classificationSkill
- data-discoverySkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
If a malicious certificate was issued, revoke it and publish the CRL — resetting the user's password does not invalidate certificate auth.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AD CS Security Review
AD CS misconfigurations frequently give any domain user a path to Domain Admin via certificate-based authentication (PKINIT), and certificates survive password resets.
Core misconfigurations (SpecterOps "Certified Pre-Owned" naming)
| ID | Condition | Fix |
| ESC1 | Template: low-priv enroll + ENROLLEE_SUPPLIES_SUBJECT + client-auth EKU + no manager approval | Remove enrollee-supplied subject or restrict enrollment; require approval |
| ESC2 | Any Purpose EKU or no EKU, low-priv enroll | Restrict EKU/enrollment |
| ESC3 | Certificate Request Agent EKU enrollable by low-priv | Restrict; enrollment agent restrictions on CA |
| ESC4 | Low-priv has write/owner rights on a template | Fix template ACL |
| ESC6 | CA flag EDITF_ATTRIBUTESUBJECTALTNAME2 | certutil -setreg policy\EditFlags -EDITF_ATTRIBUTESUBJECTALTNAME2, restart CertSvc |
| ESC7 | Low-priv ManageCA/ManageCertificates on CA | Fix CA ACL |
| ESC8 | HTTP web enrollment (/certsrv) allowing NTLM relay | Disable or require HTTPS + EPA, disable NTLM |
| ESC9/10 | Weak certificate mapping (StrongCertificateBindingEnforcement) | Enforce strong mapping (KB5014754) |
| ESC11 | RPC enrollment without packet privacy (IF_ENFORCEENCRYPTICERTREQUEST off) | Enable |
| ESC13+ | Issuance policy linked to groups (OID group link), others | Review per current research |
Assessment commands (read-only)
certutil -v -dstemplate > templates.txt # template details
certutil -getreg policy\EditFlags # ESC6 check on the CA
Invoke-Locksmith -Mode 0 # Locksmith (TrimarcJake) reportCertipy (Linux, authorized): certipy find -u user@corp.local -p '...' -dc-ip 10.0.0.1 -vulnerable -stdout. Treat output as sensitive.
Monitoring
Enable CA auditing (certutil -setreg CA\AuditFilter 127) and object access on the CA:
- 4886 request received, 4887 certificate issued, 4888 denied, 4899/4900 template changes.
- Alert when the requester ≠ subject/SAN, when a SAN UPN names a privileged user, or a certificate is issued from a template rarely used.
- 4768 with
PreAuthType=16/17(PKINIT) from unexpected hosts for privileged accounts.
Incident note
If a malicious certificate was issued, revoke it and publish the CRL — resetting the user's password does not invalidate certificate auth. Consider whether the CA private key itself was exposed (then the CA must be rebuilt and its certs distrusted from NTAuth).
Related skills
ad-attack-path-analysis, ad-privileged-access-review, certificate-lifecycle
References
- SpecterOps "Certified Pre-Owned": https://specterops.io/wp-content/uploads/sites/3/2022/06/Certified_Pre-Owned.pdf
- Locksmith: https://github.com/jakehildreth/Locksmith
- Microsoft KB5014754 certificate-based authentication changes: https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

