> For the complete documentation index, see [llms.txt](https://gokulkarthik.gitbook.io/pentesting-checklist/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gokulkarthik.gitbook.io/pentesting-checklist/windows-and-active-directory/initial-attack-vectors/mitm6-ipv6-attack.md).

# MITM6 IPv6 Attack

### Overview

The MITM6 attack is a network-based exploitation technique that targets how Windows environments handle IPv6 by default. Even in organizations that don’t actively use IPv6, Windows systems automatically send DHCPv6 requests when they boot or connect to the network.

An attacker running **mitm6** can respond to these requests as a rogue IPv6 DHCP server, assigning the victim machine a malicious DNS server address. Once the victim trusts the attacker’s DNS, all name resolution requests can be intercepted and redirected.

In combination with **ntlmrelayx** from Impacket, this attack becomes especially powerful. By spoofing WPAD (Web Proxy Auto-Discovery Protocol) and relaying NTLM authentication attempts, the attacker can capture or relay credentials to other services.

### Prerequisites

1. IPv6 Enabled on the Network(Default)
2. No Secure IPv6 Configuration
3. Attacker on the Same Network
4. NTLM-Based Authentication in Use(Fallback is also fine)
5. Relay Target Available(Eg: LDAP, LDAPS, SMB etc)

### Steps

1. Run **ntlmrelayx** first and then **mitm6** to spoof IPv6 DNS/DHCPv6.

   ```bash
   impacket-ntlmrelayx -6 -t ldap://dc.toffee.bth -wh anywpad.domain.local -l lootme
   sudo mitm6 -d sequel.htb
   ```
2. As clients boot or reconnect to the network, they use the attacker as DNS and also send authentication attempts.
3. Possible outcomes:
   * LDAP privilege escalation
   * Adding user to privileged groups
   * AD CS certificate abuse
   * DCSync rights assignment
4. Depending on relay target, we can perform DCSync, dump hashes, etc.

### Attack Flow

<figure><img src="https://3453411915-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBRf05U6QUYhwtDnwC88%2Fuploads%2FcyTdTGa1iSrOm7CyR7To%2Fimage.png?alt=media&amp;token=7e7b480d-bc99-40a0-957e-1b336b35a7ee" alt=""><figcaption></figcaption></figure>

### Mitigations

1. Disable WPAD via group policies.
2. Enable LDAP Signing and LDAP Channel Binding.
3. Block DHCPv6 Traffic. Can use Windows Firewall Group Policies.
