Man-in-the-Middle Attacks: From Evil Twin to AiTM, How to Defend

1. Introduction
A man-in-the-middle attack (MITM) is one of the most silent vectors: the attacker positions themselves between the employee and the legitimate service without either of them noticing. There is no need to break advanced cryptography: it is enough to be at the right point of the network — or create it — and wait. This article, based on chapter 9 of the book “Practical cybersecurity protocols and procedures” (Confemetal, 2026), reviews the evolution of the man-in-the-middle attack from classic ARP spoofing to the AiTM that steals sessions and bypasses MFA.
The MITM matters because it combines two dangerous elements: it is hard to detect and it evolves quickly. The variants of a decade ago attacked the local network; the ones of 2025-2026 attack the user and their session, no matter which network they connect from. Understanding that evolution is the precondition for a defense that does not become obsolete.
Throughout the article we will look at the three capabilities that define the MITM, the technical and hardware variants, the jump to AiTM with Evilginx and Modlishka, and a layered defense — network, application and mobility — with its detection signals and immediate response.
2. What Defines a Man-in-the-Middle Attack
Every man-in-the-middle attack requires three capabilities, and telling them apart helps you know what you are defending against. Intercepting and reading traffic affects confidentiality and, when the destination uses TLS, is reduced to capturing metadata. Modifying it affects integrity and requires a downgrade to an old protocol or a fake certificate. Impersonating or redirecting the user affects authenticity and is the most effective: it does not require reading anything, only that the victim types in the wrong place.
That third capability explains the evolution of MITM. Chapter 9 summarizes it this way: modern attacks do not break cryptography; they break trust in the connection point.
| Capability | What it achieves | How it is achieved |
|---|---|---|
| Intercept and read | Confidentiality | ARP spoofing, DNS spoofing, compromised router |
| Modify | Integrity | SSL stripping, downgrade, fake certificate |
| Impersonate and redirect | Authenticity | Evil Twin, fake captive portal, AiTM |
Fig. 1 – The three capabilities of MITM and their associated techniques.
3. The Classic Variants in the Local Network
In the local network segment, the historical king is ARP spoofing: the attacker sends fake ARP responses so that traffic between the victim and the gateway passes through their machine. The classic tools are arpspoof and dsniff, Ettercap and Bettercap, legitimate for pentesting and also present in the attacker’s kit. Once in the middle, traffic is read, modified or redirected to a fake service.
Next comes DNS spoofing, which forges resolution responses to take the user to an identical server controlled by the attacker, and SSL stripping, which downgrades HTTPS to HTTP at browser startup. The latter has a known and deliberate limit: domains with HSTS preload block it, because the browser requires HTTPS unconditionally. The first defense, therefore, is eliminating HTTP: if the downgraded path does not exist, the attack loses its favorite tool.
These variants depend on the local network: the attacker must be on the same segment as the victim or control the connection point. That limitation drove the next phase of MITM: creating the connection point itself.
4. The Hardware Variants: Evil Twin and Captive Portals
The attacker who cannot be on your local network creates their own. The rogue AP and its evolution, the Evil Twin, clone the SSID of the hotel, the airport or the coworking space and broadcast a stronger signal. The device automatically joins the strongest signal, and there the attacker deploys the fake captive portal: a page that asks for corporate credentials, a payment card or the installation of a “network certificate”.
The reference hardware is the Hak5 family: the WiFi Pineapple is a pocket access point for these tests, and airbase-ng or Wifiphisher automate the process. Deauthentication attacks kick devices off the legitimate network to force them onto the fake one; WPA3 mitigates these with Management Frame Protection (PMF).
The recent history of WiFi explains why they still work: in 2017 WPA2 suffered the KRACK attack, which allowed decrypting traffic on PSK networks. But the real problem is the combination of WPA2-Personal with a shared key, clients without isolation and users who pick SSIDs at random. Mobility is the most frequent scenario for three reasons: the user does not control the infrastructure, the SSID is not verifiable and the captive portal is trivial to fake.
5. The Modern Evolution: AiTM with Evilginx and Modlishka
The current frontier is Adversary-in-the-Middle (AiTM). Tools such as Evilginx or Modlishka act as a reverse TLS proxy: the user believes they are talking to Microsoft or your corporate SaaS, but they are talking to the proxy, which forwards the conversation to the real service and obtains the session cookie.
What is decisive: the victim enters their password and their MFA code on the fake page, authentication completes successfully against the real provider and the attacker steals the post-MFA cookie. SMS, TOTP and push all fall equally: the second factor is typed on the wrong site. With typo-squatting and a valid certificate for the fake site, not even the browser padlock betrays it. A well-executed AiTM is indistinguishable from a legitimate session, inheriting even Single Sign-On trust.
The consequence is direct: any account with classic MFA is vulnerable to a modern MITM, and AiTM campaigns are already a standard of the criminal ecosystem and the Red Team. Defense requires phishing-resistant MFA (FIDO2/passkeys) and the layers that follow.
6. Layered Defense Against MITM
Defending against a man-in-the-middle attack is not a single action: it is a three-layer architecture. The first layer protects the network, the second the application and the third user mobility.
6.1. Network Layer: WPA3-Enterprise and 802.1X
The corporate WiFi network — and the home network, for remote work — should use WPA3-Enterprise with 802.1X authentication, preferably EAP-TLS with per-device and per-user certificates. Compared with WPA3-Personal, the Enterprise version authenticates every device against a RADIUS server (Microsoft NPS, FreeRADIUS, Cisco ISE or Aruba ClearPass) with an internal or cloud PKI, allows automatic rotation and revocation and resists the Evil Twin: a fake AP cannot present the correct RADIUS certificate, so the client rejects the connection.
6.2. Application Layer: TLS 1.3, HSTS and Pinning
At the application layer, the minimum requirement is mandatory TLS 1.3, validated with Qualys SSL Labs or testssl.sh, removing TLS 1.0, 1.1 and weak cipher suites. HSTS with preload closes SSL stripping from the browser; certificate pinning protects critical mobile apps against interception proxies; and DNS over TLS or HTTPS (1.1.1.1, 8.8.8.8 or Quad9) closes DNS spoofing. Every protocol that accepts an old version is an open door to MITM.
6.3. Mobility Layer: VPN or ZTNA Always On
In mobility, the rule is the one from the public WiFi chapter: an IPsec, OpenVPN or WireGuard VPN, or better ZTNA (Cloudflare Access, Zscaler ZPA, Entra Private Access or Netskope), which exposes only the authorized resource. With transparent activation — Always-On VPN, corporate Cloudflare WARP or MDM profiles — the decision is not left to the user. And discipline: nothing sensitive on public WiFi, mobile data for critical work, never install certificates requested by a captive portal and distrust the SSID: AiTM also shows a padlock.
| Layer | Key control | MITM technique it blocks |
|---|---|---|
| Network | WPA3-Enterprise with EAP-TLS and 802.1X | Evil Twin and rogue AP |
| Network | RADIUS + PKI and WIPS | Default credentials and fake APs |
| Application | TLS 1.3 and HSTS preload | SSL stripping and downgrade |
| Application | Pinning and DoH/DoT | Interception proxy and DNS spoofing |
| Mobility | Always-On VPN/ZTNA through MDM | ARP spoofing and fake captive portal |
| Identity | Phishing-resistant MFA (FIDO2) | AiTM with session theft |
Fig. 2 – Layered defense against MITM and what each control blocks.
7. Detection and Response to a Possible MITM
Detecting the MITM requires watching signals that, together, betray the interception. Certificate warnings on regular services are the most reliable: a persistent TLS error on corporate email is an interception proxy until proven otherwise. Next are sign-ins from unusual geographies or ASNs in the SIEM, Entra ID or Google Workspace and anomalies detected by NDR or EDR.
If MITM is suspected, the list of immediate actions is the following:
Response checklist - MITM
[ ] Disconnect the device from the suspicious network
[ ] Switch to mobile data or a verified network
[ ] Revoke active sessions (Entra ID / Google Workspace)
[ ] Rotate credentials entered from that connection
[ ] Preserve the device for forensics without powering off
[ ] Review forwarding rules and granted OAuth tokens
[ ] Escalate to forensics if behavior persists
[ ] Evaluate AEPD notification (72h) and NIS2 CSIRT
Fig. 3 – Immediate response checklist for a possible MITM.
Regarding notification, the usual rules apply: the data protection authority within 72 hours if personal data is involved and NIS2 through the corresponding CSIRT. The most frequent root causes in real cases: WPA2-Personal with a shared PSK, inconsistent VPN, domains without HSTS and unencrypted DNS. You can dig deeper in how credentials are stolen with SSLStrip and classic MITM and in how DNS spoofing and the related phishing work.
8. Conclusion
The man-in-the-middle attack has moved from local ARP spoofing to AiTM that steals sessions and bypasses classic MFA, but its logic is always the same: positioning itself between the user and the service. The defense, therefore, is not a single control: it is a chain — enterprise networking, TLS 1.3, HSTS preload, pinning, encrypted DNS, ZTNA and phishing-resistant MFA — in which each link closes a different way of getting in the middle.
The good news is that most of these measures already exist in your infrastructure or are configuration, not purchases. The bad news is that few of them are activated. A technical network and TLS audit, the progressive deployment of WPA3-Enterprise and ZTNA, and response plans validated with real exercises turn MITM into a risk with an excellent return.
Need help with Man-in-the-middle attack?
At Jaymon Security, we help organizations protect their systems. From security audits to SIEM/SOC implementation, our expert team designs custom solutions.
Contact us for a free infrastructure assessment.

