Skip to content
Skillpedia
Agents35k · #6185

relaying-ntlm-for-adcs-esc8

Helps your agent exploit a security flaw in Windows networks. It can obtain certificates that allow privileged access. It's useful in penetration tests to assess corporate network security.

What it does

This tool allows an attacker to obtain a computer certificate from a domain controller, which can then be used to gain full control of the network.

When to use it

  • ✓During a corporate network penetration test.
  • ✓To check if defenses against certificate attacks are working.
  • ✓In training exercises to simulate real attacks.

Example of what to ask your AI

“How can I get a domain controller certificate to take over the network?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/relaying-ntlm-for-adcs-esc8/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/relaying-ntlm-for-adcs-esc8/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool tricks a domain controller into authenticating to an attacker-controlled server. It then uses that authentication to request a certificate for the domain controller, ultimately gaining full access.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill relaying-ntlm-for-adcs-esc8

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/relaying-ntlm-for-adcs-esc8/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from 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 ntlmrelayx in --adcs mode 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

…

FAQ

What is 'coercion' in this context?

Coercion means tricking a computer into connecting to a server you control, sending its authentication credentials.

What is 'relay'?

Relay is taking the authentication you received from one computer and using it to connect to another service as if you were that computer.

Why is this dangerous?

It allows an attacker to impersonate a domain controller, which usually means full control over the entire corporate network.

Details

Original description by the author

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

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#6185
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills