You open a website, you type a message, maybe a password, maybe nothing important. You assume it goes straight to its destination. It doesn’t.

The internet feels direct.

You → Website → Done.

Clean, simple, private. But in reality, your data travels through multiple points before it reaches where it’s going. And if someone positions themselves in the right place, they can see everything passing through. This is what’s known as a Man-in-the-Middle attack.

People often think:

“If I’m not logging in, I’m safe.”

But even without credentials, there’s value in:

  • browsing behavior

  • session data

  • request patterns

  • background communication between apps

And in weaker setups, even more. In certain conditions, an attacker doesn’t just observe.

They can:

  • intercept data

  • manipulate requests

  • inject responses

  • redirect traffic

And the user? Still sees nothing unusual. Because trust on the internet is mostly invisible.

You trust:

  • the WiFi you connect to

  • the connection your device establishes

  • the systems handling your data

But you rarely verify what’s happening in between.

Man-in-the-Middle Attack ( MITM )

In a typical Man-in-the-Middle scenario, the attacker doesn’t break into a system. They position themselves between two devices on the same network, usually a user and a gateway (like a router).

Conceptually, it looks like this:

Victim → Attacker → Router → Internet

Instead of traffic flowing directly:

Victim → Router → Internet

The attacker silently inserts themselves into the communication path.

How It Works in Practice

To execute this attack, the attacker runs a few commands on their machine. Here's a simplified example:

# IPs: Gateway=192.168.1.1, Victim=192.168.1.100
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo arpspoof -i eth0 -t 192.168.1.100 192.168.1.1  
sudo arpspoof -i eth0 -t 192.168.1.1 192.168.1.100  

One command tells the victim: "I am your router", The other tells the router: "I am your victim"

Once both believe the lie, all traffic flows through the attacker. They can see everything, modify data, or simply observe.

The Result

The victim continues browsing normally. Pages load. Messages send. But every packet now passes through an invisible third party.