agentleFS
kaandgnshkaandgnsh/Claude-Blue/skills/active-directory-security/adcs-security-review/SKILL.md

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.

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
  1. Distinctive:

    If a malicious certificate was issued, revoke it and publish the CRL — resetting the user's password does not invalidate certificate auth.

    line 48

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

IDConditionFix
ESC1Template: low-priv enroll + ENROLLEE_SUPPLIES_SUBJECT + client-auth EKU + no manager approvalRemove enrollee-supplied subject or restrict enrollment; require approval
ESC2Any Purpose EKU or no EKU, low-priv enrollRestrict EKU/enrollment
ESC3Certificate Request Agent EKU enrollable by low-privRestrict; enrollment agent restrictions on CA
ESC4Low-priv has write/owner rights on a templateFix template ACL
ESC6CA flag EDITF_ATTRIBUTESUBJECTALTNAME2certutil -setreg policy\EditFlags -EDITF_ATTRIBUTESUBJECTALTNAME2, restart CertSvc
ESC7Low-priv ManageCA/ManageCertificates on CAFix CA ACL
ESC8HTTP web enrollment (/certsrv) allowing NTLM relayDisable or require HTTPS + EPA, disable NTLM
ESC9/10Weak certificate mapping (StrongCertificateBindingEnforcement)Enforce strong mapping (KB5014754)
ESC11RPC enrollment without packet privacy (IF_ENFORCEENCRYPTICERTREQUEST off)Enable
ESC13+Issuance policy linked to groups (OID group link), othersReview 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) report

Certipy (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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.