# Man-in-the-Middle Attack (MITM)

> Someone sneaks in between two sides. They read or change what each side sends.

**Field:** Infrastructure  
**Category:** Security  
**Also known as:** MITM, MITM Attack, On-Path Attack, Adversary-in-the-Middle, Machine-in-the-Middle

## Think of it like

Think of it like someone who opens your mail on the way. They read it, then seal it up again.

## Definition

In a man-in-the-middle attack, someone secretly sits between two sides. Each side thinks it is talking only to the other. Every message passes through the attacker first. The attacker can read it, change it, or pass it on untouched. It often starts on free Wi-Fi or a fake website. HTTPS stops it, because the attacker can neither read the messages nor pretend to be the other side.

## Example

Jack joins free Wi-Fi named Cafe Guest. It is really an attacker's laptop, and every site he opens without HTTPS passes through it as plain text.

## Why it matters

Both sides see nothing wrong, so the attack can run for a long time. Passwords and card numbers can be taken on the way.

## Common mistake

Clicking past a warning in the browser. That warning may be the only sign of someone in the middle.

## Three principles

- **In the path.** Every message goes through the attacker.
- **Read or change.** It can copy or alter what passes.
- **Encryption stops it.** Checked certificates prove who is really there.

## Related terms

- [HyperText Transfer Protocol Secure (HTTPS)](https://learn.benibix.com/term/infrastructure/https)
- [Transport Layer Security (TLS)](https://learn.benibix.com/term/infrastructure/tls)
- [TLS Certificate](https://learn.benibix.com/term/infrastructure/tls-certificate)
- [Virtual Private Network (VPN)](https://learn.benibix.com/term/infrastructure/vpn)
- [Phishing](https://learn.benibix.com/term/infrastructure/phishing)
- [Public-Key Cryptography](https://learn.benibix.com/term/development/public-key-cryptography)

![Top row: Jack's laptop on the left, a bank on the right, and an attacker box in the middle of the line between them. Bottom row: a company network box with an arrow of small data blocks leaving it for an attacker's server outside.](https://learn.benibix.com/diagrams/inf4-attacks.svg)

---

Source: https://learn.benibix.com/term/infrastructure/man-in-the-middle-attack
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
