✧ Key takeaways
A man-in-the-middle attack puts an attacker between you and the website. How evil twins, ARP spoofing, and session hijacking work — and how to stop them.
Picture this: you sit down at a coffee shop, join the free Wi-Fi, and log in to your email. Everything looks normal. What you cannot see is someone at the next table reading that traffic as it passes through their laptop. They are not guessing your password. They did not break into the email provider's servers. They simply placed themselves in the middle of your connection.
That is a man-in-the-middle attack, usually shortened to MITM. The attacker does not need to defeat the security of the website you visit. They only need to control the path your data takes to get there. Once there, they can read what you send, change what you receive, or steal the session that proves you are logged in.
You do not need a technical background to follow this — the risk is about trust, not code. Every time your phone or laptop talks to a website, it trusts the network in between to deliver the messages untouched. On your home network, that trust is usually reasonable. On a public hotspot or hotel network, it is not. This article explains how the attack works in plain language, covers the techniques attackers use, walks through four real cases, and ends with practical steps — including why a VPN like NordVPN belongs in your routine whenever you connect to Wi-Fi you do not control.
How a MITM attack actually works
Every connection has two ends: your device and the server. Your logins, messages, and card details travel between them in small packets, hopping through routers. A MITM attack happens when a third party inserts themselves into that path and neither end notices. Think of a letter sent through the post: someone opens the envelope, reads it, changes a few words, reseals it, and sends it on. Your friend receives a letter that looks exactly like yours.
Encryption is what is supposed to stop this. When a site uses HTTPS, the letter goes into a locked box only the intended recipient can open. So a serious MITM attack has two jobs: get into the middle, then deal with the encryption. Some attacks steal a session token sent before encryption kicked in. Others trick your browser into accepting a fake certificate, like handing the attacker a copy of the key. A few attack the network itself, rerouting traffic before it reaches the encrypted tunnel.
Three conditions make the attack possible: the attacker must be on the same network or control a piece of it, redirect your traffic through their machine, and read or change it once it flows past them. What makes these attacks unsettling is how quiet they are. Nothing crashes, no warning pops up, the website loads at normal speed. The only sign might be a small certificate warning — and most people click past those.
The evil twin: a fake Wi-Fi hotspot
The simplest MITM setup is also one of the most common. An attacker creates a Wi-Fi network with a name that looks legitimate — "CoffeeShop_Free_WiFi", "Airport_WiFi", "Hotel_Guest" — and waits for people to connect. This is called an evil twin, and it works because phones and laptops are designed to be helpful: they show you nearby networks, and they often reconnect automatically to names they have seen before.
Once you join the attacker's network, every packet you send flows through their device. They can see which sites you visit and read any traffic that is not encrypted. The name can be copied exactly from the real network, so checking the spelling helps but does not settle the question, and a strong signal proves nothing. Ask staff for the exact official network name, and treat any network you did not set up yourself as untrusted.
ARP spoofing on local networks
ARP spoofing works on a local network — a home, office, hotel, or café — and it targets the way devices find each other. When your laptop wants to send data to the internet, it asks the local network, "which device here is the router?" The answer comes through a protocol called ARP. The problem is that ARP was designed when local networks were assumed to be friendly, so it accepts answers without checking who sent them.
An attacker on the same network sends a forged ARP reply: "I am the router — send everything to me." Your laptop believes it, and from that moment your traffic flows through the attacker's machine first, which forwards it to the real router so nothing looks broken. A MITM attack does not require the attacker to own the Wi-Fi network — they only need to be on it. A compromised device on a shared office network, or a stranger on the same hotel Wi-Fi, has everything needed to try it.
DNS spoofing: sending you to the wrong site
Before your browser can load a website, it has to translate the domain name — say, yourbank.com — into an IP address. That translation is handled by DNS, the domain name system, which works a bit like a phone book. DNS spoofing corrupts that lookup so your browser gets the wrong address and connects to the attacker's server instead of the real one.
The attacker builds a copy of the site you wanted and waits for you to log in. Because you typed the correct address yourself, everything feels legitimate. The fake page may even forward your credentials to the real site and log you in, so you never notice — while the attacker keeps a copy of what you typed. Modern protections have made crude DNS spoofing harder, but the attack still shows up wherever they are missing, and once an attacker controls your local traffic, poisoning a DNS answer is a small extra step.
HTTPS spoofing and SSL stripping
HTTPS is the lock icon in your browser's address bar, and it is the single most important defense against MITM attacks. When a site uses HTTPS, the connection between your browser and the server is encrypted, and your browser checks the site's certificate. An attacker sitting in the middle sees only scrambled data.
Attackers have two ways around this. The first is HTTPS spoofing: they register a lookalike domain — yourbank-secure.com, or a domain with a swapped letter — and get a real certificate for it. The certificate is genuine, but it belongs to the attacker's domain. The trick depends on you not noticing the address bar, and browsers hide the full URL on mobile.
The second is SSL stripping. Many sites still accept plain HTTP and redirect to HTTPS. An attacker in the middle intercepts that first unencrypted request and keeps you on the HTTP version, while they maintain their own HTTPS connection to the real site. You see the site, it works, but your side is unencrypted — and the attacker reads everything. The defense is HSTS, a header that tells browsers to only ever use HTTPS for a site. But a site that never set HSTS, or a first visit before the browser has learned the rule, leaves a window open. The lesson: the padlock matters, and the address matters more. A certificate warning should stop you cold — never click through it to reach a login page.
Session hijacking and cookie theft
When you log in to a website, the server gives your browser a session token — usually stored as a cookie — that says "this browser is logged in as this user." From then on, the site just checks the cookie instead of asking for your password. That convenience is what session hijacking exploits.
If an attacker captures your session cookie, they do not need your password at all. They paste the cookie into their own browser, and the site treats them as you. They can read your messages, change your settings, or make purchases until the session expires. The classic version happens on unencrypted connections, where the cookie travels in plain text. Modern sites have hardened this: cookies marked HttpOnly cannot be read by scripts, cookies marked Secure are only sent over HTTPS, and session tokens are shorter-lived. But the attack still works when a site is sloppy about those flags, when a user is on an unencrypted page, or when malware grabs the cookie from the browser. Because the attacker never needs your password, changing it after the fact does not always end the session — you may also need to log out all sessions from the account's security settings.
Real examples: four cases that showed how it works
Firesheep (2010): session hijacking for everyone
In 2010, Eric Butler released Firesheep, a free extension for Firefox. It watched open Wi-Fi networks for session cookies sent over unencrypted connections, and let anyone click a name in a sidebar to log in as that person on Facebook, Twitter, or other sites. No skill was required. No password was needed. If you were on the same café Wi-Fi as someone using Facebook over plain HTTP, their session was one click away.
Firesheep was a demonstration, not a criminal tool, and it worked exactly as intended — it shocked the industry. Within months, major sites began moving to HTTPS by default. The lesson: session hijacking was not a rare, expert-only attack. It was a one-click extension anyone could install.
Lenovo Superfish (2015): the attack came preinstalled
In 2015, researchers found Lenovo had shipped some consumer laptops with advertising software called Superfish preinstalled. Superfish inserted ads into web pages, but the way it did so was the problem: it installed its own root certificate on the laptop and used it to intercept encrypted HTTPS traffic — decrypting it, modifying it, and re-encrypting it before it reached the browser. In effect, the laptop shipped with a MITM attack built in.
The flaw was worse than the design. Superfish used the same private key on every affected laptop, and researchers quickly extracted it. Anyone with that key could intercept the encrypted traffic of any affected machine. Lenovo removed the software and in 2017 settled with the US Federal Trade Commission. The case is a reminder that a MITM attack does not always come from a stranger on your network — it can arrive in the box with the product.
Kazakhstan government HTTPS interception (2019)
In 2019, internet providers in Kazakhstan told users to install a government-issued root certificate, claiming it was needed for security. A root certificate is powerful: whoever holds the matching private key can issue certificates for any site and intercept its HTTPS traffic while the browser shows a normal padlock.
The move was widely understood as an attempt at large-scale interception of encrypted traffic. Google, Mozilla, and Apple blocked the certificate in Chrome, Firefox, and Safari. The government stopped the rollout shortly afterwards. The episode showed the scale a MITM attack can reach when run at the network level — and that the browser is the last line of defense.
TunnelVision (CVE-2024-3661, disclosed 2024)
In 2024, researchers at Leviathan Security disclosed TunnelVision, a technique assigned CVE-2024-3661. It abuses a feature of DHCP, the protocol that hands out network settings when a device joins a network. A rogue DHCP server can push a routing rule — DHCP option 121 — that tells a device to send traffic for certain destinations outside the VPN tunnel, in plain text, even while the VPN appears connected.
The attack does not break VPN encryption. It sidesteps it by deciding, at the routing level, which traffic goes into the tunnel. The researchers found the technique had been possible since 2002. Mitigations exist: VPN clients can reject the suspicious DHCP option, and a firewall rule blocking traffic outside the tunnel closes the gap. TunnelVision is a reminder that a VPN protects the traffic that actually goes through it.
How to protect yourself from a MITM attack
Check for HTTPS and read the address bar
Before you type a password, a card number, or any personal detail, confirm the site is using HTTPS and the domain is exactly the one you expect. Look for the padlock in the address bar. If the browser shows a certificate warning, stop. Do not click through it — a warning means the browser cannot verify who it is talking to, which is precisely the symptom of an interception in progress. Type important addresses yourself, and bookmark the sites you log in to regularly.
Use a VPN on public Wi-Fi
A VPN encrypts everything leaving your device and sends it through a tunnel to the VPN server, so anyone sitting in the middle of a public network sees scrambled traffic instead of your logins and messages. It is the most effective countermeasure for the evil twin and ARP spoofing scenarios above, because both depend on reading your traffic. NordVPN is our pick for this job: it is the VPN we recommend most often on SaaSNivo. Turn it on before you open anything else, and keep it on for the whole session.
For the full picture, see our NordVPN product page, and our cybersecurity roadmap for small business owners covers the other habits worth building alongside it.
Turn on two-factor authentication everywhere
Two-factor authentication (2FA) does not stop an attacker from intercepting traffic, but it limits what a stolen password is worth. Even if someone captures your login, they still need the second factor — usually a code from an authenticator app or a hardware key — to get in. Turn it on for your email first — email unlocks almost every other account — then for banking, cloud storage, and social media. Our guide to setting up two-factor authentication on every major app walks through the setup for each one.
Keep your software updated
Many MITM techniques rely on known flaws — an old browser that accepts weak certificates, an outdated operating system, a VPN client that does not block the TunnelVision routing trick. Updates close those gaps. Turn on automatic updates for your operating system and browser. It is unglamorous, and it is one of the highest-return security habits there is.
Do not do banking on public Wi-Fi
Some things are worth waiting for a trusted connection. Banking, card payments, and anything involving money should happen on your home network or mobile data, not on a café hotspot. If you are travelling and have no choice, use your phone's personal hotspot instead of the free network — it runs over your mobile carrier. Our public Wi-Fi safety article covers what else can go wrong on open networks and how to prevent it.
What to do if you suspect a MITM attack
If something feels wrong — a certificate warning on a familiar site, a login page that looks slightly different, a Wi-Fi network asking you to install a certificate — treat it as a real possibility. First, disconnect and switch to mobile data. Second, do not log in to anything sensitive until you are on a connection you trust. Third, once you are safe, change the passwords of the accounts you used on that network, starting with email, and log out sessions you do not recognise. Fourth, turn on 2FA for any account that lacks it. Fifth, run a malware scan. If the network belongs to a business, tell the staff or IT team. If you believe your bank account was accessed, call the bank on the number printed on your card.
The bottom line
A man-in-the-middle attack is not a Hollywood hack. It is a quiet, practical technique: get between a person and the site they are talking to, and read or change the traffic as it passes. The tools are cheap, the techniques are well known, and the four cases above show the range — from a free browser extension that hijacked Facebook sessions in a café, to software preinstalled on laptops, to a government intercepting a country's encrypted traffic.
The defenses are equally practical. Check the address bar and the padlock. Keep your software updated. Turn on two-factor authentication. Use your phone hotspot instead of free Wi-Fi when the stakes are high. And when you connect to a network you do not control, run a VPN first — NordVPN is the one we recommend, and you can see our full reasoning in our public Wi-Fi safety guide. None of these steps require technical skill.
SaaSNivo may earn a commission if you buy through links on this page, at no extra cost to you. This article is general information, not professional security advice, and reflects the techniques and cases described as of December 2026.