Skip to main content
Relay attacks intercept authentication attempts and forward them to a different target than the one the victim intended to reach. The two main variants are NTLM relay (exploits NTLM’s lack of target binding) and Kerberos relay (exploits DNS to redirect ticket requests to a service you control).

Theory

NTLM Relay

NTLM is a challenge-response protocol. The response is not cryptographically bound to which server it was intended for, so you can forward it anywhere.

Kerberos Relay

Kerberos tickets are bound to a specific SPN (e.g. HTTP/target.domain.com). A ticket meant for SMB cannot be forwarded to HTTP. The attack works by making the victim request a ticket for a hostname you control.

Prerequisites

NTLM Relay to LDAP

  • LDAP signing not enforced (default on older DCs)
  • LDAP channel binding not enforced
  • SMB signing disabled on the coercion source, OR WebClient running on the target (enables HTTP coercion, bypassing SMB signing)
  • Target is not the same machine as the coercion source (no self-relay)

Kerberos Relay (krbrelayx)

  • DNS write access (all domain users can add records by default via dnstool.py)
  • Target service accepts Kerberos (Negotiate header present on HTTP endpoint)
  • NTLM disabled domain-wide, or preference for Kerberos relay
  • A coercion primitive available (DFSCoerce, PetitPotam, PrinterBug)

Enumeration

Coercion Primitives

DNS Record Management

Required before WebClient coercion and Kerberos relay.

NTLM Relay

ntlmrelayx Setup

Add --no-dump --no-da --no-acl --no-validate-privs to suppress default auto-actions and stay in manual control.

Interactive LDAP Shell

When run with -i, ntlmrelayx opens a local shell on 127.0.0.1:1100x for each relayed session.

Post-Relay: LDAP Write Primitives

RBCD

After the relay sets msDS-AllowedToActOnBehalfOfOtherIdentity on $TARGET$, request an impersonation ticket from your controlled computer account.

Shadow Credentials

After the relay writes to msDS-KeyCredentialLink, ntlmrelayx outputs a .pfx file. Use it to get a TGT, then extract the NT hash.

Kerberos Relay (krbrelayx)

Setup

DNS Record for DFSCoerce Coercion

Windows embeds a Base64-encoded CREDENTIAL_TARGET_INFO structure in the SPN during DFSCoerce auth. The marshalled DNS name encodes the target NetBIOS name. Use dirkjan’s krbrelayx helpers to generate the correct string for your target.

Coerce with DFSCoerce

Certificate to Domain Admin

krbrelayx writes a .pfx to the current directory on successful relay.

Decision Tree

Defenses