relaying-ntlm-for-adcs-esc8
Ce qu’il fait
Cet outil permet à un attaquant d'obtenir un certificat d'ordinateur auprès d'un contrôleur de domaine, ce qui peut ensuite lui donner le contrôle total du réseau.
Quand l’utiliser
- ✓Lors d'un test d'intrusion sur le réseau d'une entreprise.
- ✓Pour vérifier que les défenses contre les attaques sur les certificats fonctionnent.
- ✓Dans des exercices de formation pour simuler de vraies attaques.
Lien du skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/relaying-ntlm-for-adcs-esc8/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Comment obtenir un certificat de contrôleur de domaine pour prendre le contrôle du réseau ?”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'outil amène un contrôleur de domaine à s'authentifier auprès d'un serveur contrôlé par l'attaquant. Il utilise ensuite cette authentification pour demander un certificat pour le contrôleur de domaine, obtenant ainsi un accès complet.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
Relaying NTLM for ADCS ESC8
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.
Overview
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.
When to Use
- During an internal AD penetration test where AD CS with the HTTP Web Enrollment role is present and EPA is not enforced.
- When you have a foothold (even an unauthenticated network position with a coercion vector) and want a path to Domain Admin via certificate impersonation.
- When validating that the organization has mitigated ESC8 (EPA enabled, HTTP enrollment disabled, RPC/EFSRPC coercion patched).
- During purple-team exercises to test detection of coercion + relay + anomalous certificate enrollment.
Prerequisites
- A network position that can reach the CA web-enrollment endpoint and a coercion vector to the target DC.
- The CA hostname and an enrollable template that yields client-auth EKU (e.g.,
DomainController,Machine). - Tooling (install from official upstreams):
# 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)
Objectives
- Enumerate AD CS to confirm an ESC8-vulnerable web-enrollment endpoint.
- Stand up
ntlmrelayxin--adcsmode targeting the CA enrollment URL. - Coerce a domain controller to authenticate to the relay (PetitPotam/Coercer/printerbug).
- Capture the base64 certificate issued for the DC machine account.
- Use Certipy to convert the certificate into a TGT and recover the DC NT hash.
- Validate domain compromise (DCSync) and document mitigations.
MITRE ATT&CK Mapping
| 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. |
Workflow
1. Enumerate AD CS for ESC8
Use Certipy to find enabled, vulnerable templates and confirm a web-enrollment endpoint:
certipy find -u attacker@corp.local -p 'Password123!' -dc-ip 10.0.0.10 -vulnerable -enabled -stdout
…
Questions fréquentes
Qu'est-ce que la « coercition » dans ce contexte ?
La coercition consiste à inciter un ordinateur à se connecter à un serveur que vous contrôlez, ce qui lui fait envoyer ses identifiants d'authentification.
Qu'est-ce que le « relais » ?
Le relais consiste à reprendre l'authentification reçue d'un ordinateur pour se connecter à un autre service comme si vous étiez cet ordinateur.
Pourquoi est-ce dangereux ?
Cela permet à un attaquant de se faire passer pour un contrôleur de domaine, ce qui donne généralement le contrôle total de l'ensemble du réseau de l'entreprise.
Détails
Description originale de l’auteur
Uses Impacket's ntlmrelayx.py with a coercion tool (PetitPotam, Coercer, printerbug) to relay NTLM authentication from a coerced domain controller into the AD CS HTTP web-enrollment endpoint (ESC8), obtaining a DC certificate usable via Certipy for PKINIT/DCSync. Use during internal AD penetration tests or purple-team exercises when AD CS Web Enrollment lacks Extended Protection for Authentication
Popularité
- Étoiles GitHub
- 35k
- Position au classement
- #8348
- Licence
- Apache-2.0
- Mis à jour
- 31/08/2026
Commentaires
- …
Autres skills de ce dépôt
abusing-dpapi-for-credential-access
35kFournit à votre agent IA des instructions prêtes à l'emploi pour une tâche précise, afin qu'il la réalise mieux et plus vite.
abusing-shadow-credentials-for-privesc
35kApprend à votre agent IA à écrire des textes clairs et bien structurés.
achieving-cmmc-level-2-compliance
35kAide votre agent à préparer un environnement conforme à la certification CMMC niveau 2. Il met en œuvre les exigences de sécurité et gère la documentation nécessaire.
acquiring-disk-image-with-dd-and-dcfldd
35kAide votre agent à créer des copies exactes de disques durs. Utile pour garantir qu'aucune information n'est perdue ou modifiée lors d'enquêtes.
Skills similaires
add-model-provider
394kPermet à votre agent de connecter un nouveau fournisseur de modèles IA à OpenClaw par des commandes sûres, sans clé en clair, puis de lancer un test.
acp-router
394kAide votre agent à envoyer une tâche à un assistant de code comme Claude Code ou Cursor via OpenClaw, afin que le travail s'exécute dans cet outil.
browser-automation
394kApprend à votre agent à piloter des pages web étape par étape, y compris les connexions, les onglets et la reprise lorsqu'une page ne répond plus.