Man-in-the-Middle
Man-in-the-Middle (MitM) is an attack in which an adversary intercepts communication between two parties, enabling eavesdropping, data modification, or credential theft. MitM attacks can occur at the network level (ARP spoofing) or application level (SSL stripping).
What is Man-in-the-Middle?
Man-in-the-Middle Definition
Man-in-the-Middle (MitM) is an attack type where an adversary positions themselves between two parties (e.g., user and server) to intercept, read, or modify communication. The victim doesn’t realize their traffic is routed through the attacker.
MitM Attack Variants
Network-level:
- ARP spoofing
- DNS spoofing
- DHCP spoofing
- BGP hijacking
Application-level:
- SSL/TLS interception
- SSL stripping
- HTTP injection
- Session hijacking
Wireless:
- Evil twin (rogue WiFi)
- Karma attacks
- Bluetooth MitM
How does MitM work?
Classic scenario:
- Attacker joins the same network as victim
- ARP spoofing redirects victim’s traffic
- Attacker intercepts communication
- Traffic forwarded (victim unaware)
- Eavesdropping, modification, credential theft
MitM Attack Tools
- Ettercap: Classic MitM framework
- Bettercap: Modern successor
- mitmproxy: HTTP/HTTPS interception
- Wireshark: Traffic analysis
- Responder: LLMNR/NBT-NS poisoning
SSL/TLS and MitM
SSL stripping:
- Downgrading HTTPS to HTTP
- User sees HTTP (no padlock)
- Attacker sees plaintext traffic
Defense:
- HSTS (HTTP Strict Transport Security)
- Certificate pinning
- User awareness
Adversary-in-the-Middle (AiTM)
Modern MitM variant targeting MFA:
- User receives phishing link
- Phishing proxies traffic to legitimate site
- User completes MFA authentication
- Attacker captures session token
- Session used to bypass MFA
MitM Defense
Network:
- 802.1X authentication
- Dynamic ARP inspection
- DHCP snooping
- Network segmentation
Application:
- TLS everywhere
- Certificate validation
- HSTS
- Certificate pinning
User:
- VPN on untrusted networks
- Verifying certificates
- Avoiding public WiFi for sensitive operations
MitM attacks remain relevant despite TLS ubiquity, especially in internal networks and through social engineering (AiTM).