A man-in-the-middle (MITM) attack, also called an on-path attack, is when an attacker secretly positions themselves between two communicating parties, usually a user and a server, and relays their traffic through themselves. The attacker can then eavesdrop on passwords and payment details, alter messages in transit, or inject malware, while both sides believe they are talking directly to each other.
Key takeaways
- A MITM attacker sits between you and a server, relaying traffic so neither side notices.
- Public Wi-Fi, ARP spoofing, DNS spoofing, evil twins and SSL stripping are the most common routes in.
- TLS with certificate validation, HSTS, phishing-resistant MFA and a VPN on untrusted networks are the strongest defenses.
You type your bank's address, the page loads, and you log in. Nothing looks wrong. But between your device and the bank, someone else is quietly reading every message — and can change the account number on a transfer before it reaches the bank. That is a man-in-the-middle attack.
What is a man-in-the-middle attack?
A man-in-the-middle (MITM) attack, also called an on-path attack, is when an attacker secretly relays and possibly alters communications between two parties who believe they are directly communicating with each other. The attacker makes independent connections with each victim and passes messages between them, so the conversation is controlled by the attacker.
Norton defines a MITM attack as a cybercriminal placing themselves between two communicating parties to intercept or alter sensitive data, as explained in its man-in-the-middle attack guide.
Think of it like a postal analogy: you send a letter to a friend, but someone opens it, reads it, changes a number inside, reseals it and forwards it. Your friend never knows the letter was touched. On a network, the "letter" is your login, your payment details or your session cookie.
MITRE ATT&CK lists this behavior as T1557: Adversary-in-the-Middle, covering ARP cache poisoning, DNS poisoning, LLMNR/NBT-NS poisoning and related techniques. The name matters less than the pattern: interception, then eavesdropping or modification.
How does a man-in-the-middle attack work?
Most MITM attacks unfold in two phases: interception, then decryption and use. First the attacker gets into a position to see your traffic, then they read or change it.
Interception: attackers target unsecured or poorly secured networks, often public Wi-Fi, because it is easier to steal unencrypted data there. They use techniques such as ARP spoofing or DNS spoofing to position themselves between your device and the server.
Decryption: once in position, attackers try to decrypt and read the traffic. If the connection is plain HTTP, there is nothing to decrypt. If it is HTTPS, they try to downgrade it, present a fake certificate, or exploit a weak protocol.
Use: with access, the attacker can eavesdrop on logins and banking details, alter a payment destination, hijack a session by stealing its cookie, or inject malware into a download. The attack often ends with fraud, identity theft or a foothold for a larger intrusion.
What are the main types of man-in-the-middle attacks?
All MITM attacks aim to intercept traffic, usually by exploiting a lack of encryption or by removing it. The main types differ in how the attacker gets into the middle.
| Type | How it works | What it steals |
|---|---|---|
| ARP spoofing | Fake ARP messages link the attacker's MAC address to the gateway IP | Local network traffic |
| DNS spoofing | Forged DNS answers send you to a fake server | Logins, sessions |
| SSL / TLS stripping | HTTPS downgraded to HTTP in transit | Anything sent in plain text |
| HTTPS spoofing | Fake certificate makes a malicious site look secure | Credentials on a fake page |
| Evil twin Wi-Fi | Fake hotspot copies a real network name | All traffic on that network |
| Session hijacking | Stolen session cookie reused as the victim | Logged-in accounts |
| BGP hijacking | False routing announcements redirect traffic | Traffic for whole networks |
| Email hijacking | Compromised mailbox used to intercept threads | Payment instructions, invoices |
ARP spoofing
On a local network, devices use ARP to map IP addresses to MAC addresses. An attacker sends fake ARP messages associating their own MAC address with the gateway's IP, so traffic meant for the router flows through the attacker's machine first.
DNS spoofing
DNS spoofing, or DNS cache poisoning, returns a forged answer to a DNS query, sending the victim to an attacker-controlled server instead of the real one. DNSSEC and trusted resolvers reduce this risk.
SSL stripping
SSL stripping downgrades an HTTPS connection to HTTP. The attacker keeps an HTTPS connection to the real server, but serves the victim plain HTTP, so everything the victim types is readable. HSTS, which tells browsers to use HTTPS only, is the main defense.
Evil twin Wi-Fi
An evil twin is a fake Wi-Fi network that copies the name of a legitimate hotspot in a coffee shop, airport or hotel. Devices that auto-connect join the attacker's network, and the attacker can then intercept their traffic.
Session hijacking
Once a user logs in, the server gives their browser a session cookie. If an attacker steals that cookie over an unencrypted connection, they can reuse it to act as the user without knowing the password. Secure, HttpOnly cookies and HTTPS everywhere prevent most of this.
What are real examples of man-in-the-middle attacks?
MITM is not only a coffee-shop threat. It appears in protocol downgrade attacks, in compromised networks, and in business email compromise where an attacker sits inside a real email thread.
The POODLE attack, described by CISA, showed how an attacker who could act as a man-in-the-middle could force a protocol downgrade to SSL 3.0 and then decrypt parts of an encrypted session. The fix was to disable SSL 3.0 entirely — a reminder that old protocols are a MITM opportunity, not just a compatibility question.
In business settings, the most costly MITM pattern is email hijacking: an attacker compromises a supplier's mailbox, watches a real invoice thread, then sends new bank details at the payment moment. The victim is talking to a real thread, with a real history, and only the payment destination has changed. See our guide to what spear phishing is for how that first access often happens.
How can you tell if you are being attacked?
MITM attacks are designed to be invisible, so look for the small breaks in the illusion. No single sign proves an attack, but several together should make you stop.
- Certificate warnings: your browser says the certificate is invalid, expired or for a different site. Stop and investigate — do not click through.
- HTTP where HTTPS should be: a login or payment page that suddenly loads over plain HTTP.
- Repeated logouts: your session ends unexpectedly, or a site asks you to log in again for no reason.
- One session, two places: a sign-in from a hosting provider or a new location right after your own sign-in.
- Strange slowness on public Wi-Fi: traffic routed through an extra hop is often slower.
- DNS or certificate changes: your IT team sees unexpected DNS record changes or new certificates.
How do you prevent man-in-the-middle attacks?
Prevention is layered: validate the server, protect the connection, secure accounts and devices, and monitor for suspicious changes. No single control covers every MITM route.
For users
- Use HTTPS and check the padlock. If a site that should be secure shows a warning, stop.
- Avoid sensitive tasks on public Wi-Fi. If you must use it, use a trusted VPN and keep HTTPS on.
- Turn off auto-connect. Do not let your phone join unknown networks automatically, and forget networks you no longer use.
- Use passkeys or a security key. They cannot be relayed the way one-time codes can.
- Keep software updated. Old TLS libraries and old browsers are easier to downgrade.
For businesses
Enforce HTTPS and HSTS on every site you run. Redirect HTTP to HTTPS, use modern TLS — CISA recommends TLS 1.3 where possible — and renew certificates before they expire. Check your own site with the free SSL checker.
Use DNSSEC and trusted resolvers. DNSSEC lets resolvers verify that a DNS answer is authentic, which makes DNS spoofing much harder.
Segment networks and monitor ARP. On corporate networks, dynamic ARP inspection, network segmentation and IDS/IPS alerts catch spoofing early.
Require phishing-resistant MFA. One-time codes can be relayed; passkeys and FIDO2 keys cannot, because they are bound to the real website. Learn how to secure the network itself in our guide to how to secure your Wi-Fi.
What should you do if you suspect a MITM attack?
Stop using the network immediately. Disconnect from the Wi-Fi, do not log in to anything sensitive, and do not click through any certificate warning to "get it working again."
- Disconnect from the suspect network and switch to mobile data or a trusted network.
- Change passwords for any account you used on that network, from a trusted device and network.
- Check sessions: sign out of all sessions and review active sessions for unknown devices or locations.
- Tell your IT team which network, when, and what warnings you saw, so they can check DNS, ARP and certificates.
- Report it to the venue or network owner, and in the US to the FBI's IC3 if money or credentials were stolen.
The bottom line
A man-in-the-middle attack works because both sides believe they are talking directly. Encryption breaks that illusion — but only when certificates are validated, HTTPS is enforced, and users do not click through warnings.
Use HTTPS everywhere, enable HSTS, move to passkeys, and use a VPN on networks you do not control. You can check whether your own site is enforcing modern TLS in seconds with the free SSL checker.
Frequently asked questions
What is a man-in-the-middle attack in simple terms?
It is an attack where someone secretly sits between you and a website, app or server, and reads or changes the messages passing between you. You think you are talking directly to the service, but all your traffic goes through the attacker first.
What is the difference between MITM and eavesdropping?
Eavesdropping is passive listening. A man-in-the-middle attack is active: the attacker relays the connection, so they can not only read traffic but also alter it, inject content or steal a session. All MITM attacks involve interception, but not all eavesdropping is MITM.
Can a man-in-the-middle attack happen on HTTPS?
Properly configured HTTPS with valid certificates protects against MITM, because the attacker cannot read or alter encrypted traffic without a trusted certificate. Attacks succeed when HTTPS is downgraded to HTTP, a fake certificate is trusted, or the user clicks through a certificate warning.
Is a man-in-the-middle attack the same as a phishing attack?
No. Phishing tricks you into visiting a fake site or handing over credentials. MITM intercepts a real connection in transit. The two are often combined: a phishing message gets you onto a malicious network, and MITM then steals what you send.
How do I know if I am a victim of a MITM attack?
Warning signs include unexpected certificate warnings, a site that suddenly uses HTTP instead of HTTPS, being logged out repeatedly, a session used from two places at once, and slow or strange behavior on a public network. A certificate warning is a reason to stop, not to click through.
Does a VPN prevent man-in-the-middle attacks?
A reputable VPN encrypts traffic between your device and the VPN server, which protects you on untrusted Wi-Fi. It does not protect traffic after it leaves the VPN, and it does not help if the VPN itself is malicious or misconfigured, so use a trusted provider and keep HTTPS on as well.
What is an evil twin attack?
An evil twin is a fake Wi-Fi network that copies the name of a real one, for example a coffee shop hotspot. Devices connect to it automatically, and the attacker can then intercept, read or alter their traffic.
Can MITM attacks steal MFA codes?
Yes, if the MFA method can be relayed. A fake login page can forward your password and one-time code to the real site in real time. Phishing-resistant MFA such as passkeys and FIDO2 security keys is bound to the real website, so a relayed page cannot reuse it.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against MITRE ATT&CK T1557, CISA guidance on TLS downgrade attacks, Cloudflare's SSL stripping primer, and Norton and Wikipedia definitions of MITM attacks.
How we write and fact-check →