# Coercion ntlm relay

> Coercion ntlm relay is an open-source agent skill for security. Guides an agent through coercing machine-account auth and relaying it with ntlmrelayx. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ADScanPro/Claude-AD/tree/main/skills/coercion-ntlm-relay
- **Repository:** https://github.com/adscanpro/claude-ad
- **GitHub stars:** 227
- **License:** MIT
- **Skill name:** coercion-ntlm-relay
- **Collection:** https://github.com/ADScanPro/Claude-AD
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-02

## About

This skill documents an Active Directory attack chain that pairs authentication coercion (PetitPotam, PrinterBug and DFSCoerce, run through Coercer or standalone scripts) with NTLM relay via impacket's ntlmrelayx. It lays out the conditions a relay target must meet, namely unenforced SMB or LDAP signing, missing LDAP channel binding, or an AD CS web enrollment endpoint without EPA, and it shows how to check those with netexec before starting.

The workflow is ordered: confirm an unprotected relay target, start the relay toward LDAP, AD CS (ESC8) or SMB, then coerce a privileged machine account to authenticate to the relay. Each relay outcome is followed to its next step, such as RBCD via S4U, a certificate turned into a TGT with PKINIT, or an SMB action. The skill also covers Windows event IDs to watch for and hardening steps defenders can apply.

The operator needs Coercer, impacket and netexec, plus network access to the target segment and explicit authorization to test it. The material is written for offensive security testing and red team work.

## When your agent uses it

> Authentication coercion (PetitPotam MS-EFSR, PrinterBug MS-RPRN, DFSCoerce MS-DFSNM) chained into NTLM relay (impacket ntlmrelayx) toward LDAP, AD CS web enrollment (ESC8), or SMB. Use when SMB signing is not enforced or LDAP channel binding is missing, and you want to force a privileged machine account to authenticate to your relay and turn that into RBCD, a DCSync-capable ACL grant, or a certificate. Includes the exact Coercer/ntlmrelayx commands, requirements, detection, and remediation.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ADScanPro/Claude-AD/tree/HEAD/skills/coercion-ntlm-relay)
- [License: MIT](https://github.com/ADScanPro/Claude-AD/tree/HEAD/skills/coercion-ntlm-relay)

## Features

- **Coercion method reference:** Covers PetitPotam (MS-EFSR), PrinterBug (MS-RPRN) and DFSCoerce (MS-DFSNM) with Coercer and standalone command lines.
- **Relay target validation:** Shows how to list hosts without SMB signing and check LDAP signing and channel binding state before relaying.
- **ntlmrelayx attack modes:** Describes relay options for LDAP delegation, AD CS certificate enrollment and SMB command or secrets extraction.
- **Chain follow-through:** Links relay results to follow-on steps such as S4U, PKINIT and certificate authentication.
- **Detection event guidance:** Lists Windows event IDs and Defender for Identity alerts relevant to machine-account NTLM logons and coercion calls.
- **Remediation checklist:** Summarizes hardening measures such as enforced signing, EPA on AD CS, disabling Print Spooler and restricting NTLM.

## Good for

- Check which hosts on a subnet lack SMB signing before planning a relay test
- Set up ntlmrelayx to delegate access on a domain controller over LDAPS
- Relay a coerced domain controller machine account to AD CS web enrollment for a certificate
- Write up detection and remediation steps for NTLM relay exposure in an AD assessment

## Install

### Claude Code

This skill ships in the `claude-ad` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ADScanPro/Claude-AD
/plugin install claude-ad@claude-ad
```

Or copy only this skill to `~/.claude/skills/coercion-ntlm-relay`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ADScanPro/Claude-AD.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/coercion-ntlm-relay &&
cp -R "$tmp/skills/coercion-ntlm-relay" ~/.claude/skills/coercion-ntlm-relay &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/coercion-ntlm-relay` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/coercion-ntlm-relay` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ADScanPro/Claude-AD.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/coercion-ntlm-relay &&
cp -R "$tmp/skills/coercion-ntlm-relay" ~/.agents/skills/coercion-ntlm-relay &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/coercion-ntlm-relay` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/coercion-ntlm-relay` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ADScanPro/Claude-AD.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/coercion-ntlm-relay &&
cp -R "$tmp/skills/coercion-ntlm-relay" ~/.cursor/skills/coercion-ntlm-relay &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/coercion-ntlm-relay` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ADScanPro/Claude-AD.git --path skills/coercion-ntlm-relay
```

Or copy the folder to `~/.gemini/skills/coercion-ntlm-relay` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/coercion-ntlm-relay`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ADScanPro/Claude-AD.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/coercion-ntlm-relay &&
cp -R "$tmp/skills/coercion-ntlm-relay" ~/.copilot/skills/coercion-ntlm-relay &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/coercion-ntlm-relay` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ADScanPro/Claude-AD.git
```

Then copy `Claude-AD/skills/coercion-ntlm-relay` into your agent's skills folder as `coercion-ntlm-relay`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What needs to be true before this chain works?

The relay target must lack protection: SMB signing not enforced for SMB relay, LDAP signing not enforced and channel binding absent for LDAP relay, or AD CS web enrollment reachable without EPA for ESC8.

### Which tools does the skill use?

It uses Coercer, the standalone PetitPotam, dementor and dfscoerce scripts, impacket's ntlmrelayx and netexec for signing checks.

### Does the skill include scripts or bundled files?

No. The folder contains a single SKILL.md with commands and reference links, and no scripts.

### What does the skill say about authorization?

It states that coercion and relay should only be run against systems the tester is explicitly authorized to test, because they generate real traffic and can disrupt services.

### How do I install Coercion ntlm relay in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/coercion-ntlm-relay to use it in all your projects, or to .claude/skills/coercion-ntlm-relay in one project. Or install the claude-ad plugin, which includes it: /plugin marketplace add ADScanPro/Claude-AD, then /plugin install claude-ad@claude-ad.

### Does Coercion ntlm relay run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Coercion ntlm relay?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Coercion ntlm relay?

The closest alternatives to Coercion ntlm relay are Ad environment constraints, Kerberos attacks, Acl abuse, Adcs attacks and Ad opsec telemetry.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Ad environment constraints](https://ai-powered.com/skills/ad-environment-constraints): Ad environment constraints is an open-source agent skill for security.
- [Kerberos attacks](https://ai-powered.com/skills/kerberos-attacks): Kerberos attacks is an open-source agent skill for security.
- [Acl abuse](https://ai-powered.com/skills/acl-abuse): Acl abuse is an open-source agent skill for security.
- [Adcs attacks](https://ai-powered.com/skills/adcs-attacks): Adcs attacks is an open-source agent skill for security.
- [Ad opsec telemetry](https://ai-powered.com/skills/ad-opsec-telemetry): Ad opsec telemetry is an open-source agent skill for security.
- [System](https://ai-powered.com/skills/system): System is an open-source agent skill for security.
- [Compliance mapping](https://ai-powered.com/skills/compliance-mapping): Compliance mapping is an open-source agent skill for security.
- [Ad methodology](https://ai-powered.com/skills/ad-methodology): Ad methodology is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/coercion-ntlm-relay
