NTLM Relay in Active Directory
NTLM relay intercepts an authentication attempt from one host and forwards it to a different target service before the original connection completes. The relay acts as a man-in-the-middle — the target service sees a legitimate authentication from the coerced account and grants access accordingly. The attacker never needs the account's credentials or hash.
The most impactful relay targets in Active Directory are LDAP on the DC (to set RBCD or create accounts), SMB on workstations (for command execution), and ADCS web enrollment (to obtain certificates). Each requires specific conditions on the target. Check those conditions before setting up the relay.
Check signing requirements
SMB relay only works when SMB signing is not enforced on the target. LDAP relay requires LDAP signing and channel binding to not be required on the DC. Check both before configuring a relay.
SMB 10.10.10.20 445 WS01 signing: False SMB 10.10.10.30 445 WS02 signing: False LDAP 10.10.10.10 389 DC01 LDAP signing NOT enforced
Relay setup
ntlmrelayx receives the incoming NTLM authentication and forwards it to the configured target. Responder poisons name resolution to capture authentication from hosts on the segment. When running both together, disable SMB and HTTP in Responder so those ports are free for ntlmrelayx to receive connections.
Warning
Responder's LLMNR/NBT-NS poisoning is prohibited in the OSCP exam. The relay itself stays fine when the authentication is triggered by coercion (PetitPotam, printerbug) instead of poisoning. Do not run Responder in poisoning mode during exam environments.
Relay to SMB — command execution
Relaying to SMB on a host without signing enforced gives an interactive shell or command execution as the relayed account. If the coerced account is a local admin on the target, the relay gives immediate code execution.
[*] SMBD-Thread-2: Connection from CORP/jsmith [*] Authenticating against smb://10.10.10.20 as CORP/jsmith [+] Successfully authenticated as CORP/jsmith [+] CORP/jsmith successfully relayed to SMB on 10.10.10.20
Relay to LDAP — RBCD and machine account creation
Relaying to LDAP on the DC lets ntlmrelayx modify AD objects as the relayed account. The two most useful actions are creating a machine account and configuring RBCD on a target computer. Both require the relayed account to have sufficient LDAP write permissions — a relayed computer account typically has enough rights to set RBCD on itself.
[*] SMBD-Thread-2: Connection from CORP/DC01$ [*] Authenticating against ldap://10.10.10.10 as CORP/DC01$ [+] Delegation rights modified successfully [+] ATTACKERSYSTEM$ can now impersonate users on DC01$ via S4U2Proxy [*] Machine Account: ATTACKERSYSTEM$ Password: RandomPassword
[+] Successfully added machine account ATTACKPC$ with password AttackPassword123!
Relay to ADCS — certificate request
Relaying to the ADCS web enrollment endpoint requests a certificate on behalf of the coerced account. This is ESC8 — see ADCS Exploitation for the full workflow including certificate-to-hash conversion.
[+] Successfully requested certificate for DC01$ [*] Base64 certificate: MIIRbQIBAzCC...
After a successful relay, the follow-on action depends on the relay target. SMB relay gives immediate execution — move to Credential Harvesting on the newly accessed host. LDAP relay with RBCD gives a path to impersonating Domain Admin on the target computer — follow the S4U2Proxy chain in ACL Abuse Privilege Escalation. ADCS relay yields a certificate — convert it to an NT hash via ADCS Exploitation.
References
-
Impacket — GitHubgithub.com/fortra/impacket (opens in new tab)
ntlmrelayx --delegate-access, --add-computer, --adcs flag reference
-
Responder — GitHubgithub.com/lgandx/Responder (opens in new tab)
Responder.conf SMB/HTTP disable for relay setup
-
NetExec (nxc) — GitHubgithub.com/Pennyw0rth/NetExec (opens in new tab)
--gen-relay-list and ldap-checker module reference
Was this helpful?
Your feedback helps improve this page.