Man in the Middle Attack — Ethical Hacking as a Beginner [12]
2 min readApr 29, 2024
Here’s a breakdown of how MITM, or Man-in-the-Middle attacks work, their dangers, and ways to protect yourself:
Core Concept
- Interception: An attacker positions themselves strategically between two communicating parties (e.g., you and your bank’s website). They might be on the same Wi-Fi network, control a router, or even have compromised a server along the communication path.
- Impersonation: The attacker then intercepts traffic flowing from both sides of the communication, making each party believe they’re still talking directly to each other.
- Manipulation or Eavesdropping: Now in control of the communication channel, the attacker has two main options:
- Eavesdropping: Simply listening in and capturing sensitive data (passwords, credit card numbers, private messages).
- Manipulation: Actively altering data passed between the parties, potentially redirecting payments, changing content, or injecting malware.
Common Ways to Execute MITM Attacks
- ARP Spoofing: Tricking devices on a local network into sending traffic to the attacker’s machine instead of the intended destination.
- DNS Spoofing: Compromising a DNS server to redirect users to fake websites that look like legitimate ones.
- Wi-Fi Attacks: Creating a rogue wireless access point that appears legitimate, luring users into connecting and enabling the attack.
- SSL/TLS Hijacking: Exploiting vulnerabilities in secure connections to downgrade them or insert the attacker as a middleman.
Dangers of MitM Attacks
- Theft of Personal Information: Login credentials, financial information, private conversations.
- Unauthorized Actions: Attacker may perform actions on your behalf on impersonated websites (making transactions, changing settings).
- Spreading Malware: Injecting malicious code into downloads or website content.
- Gateway to Further Attacks: Gaining a foothold within a network for more extensive attacks or long-term surveillance.
Protecting Yourself
- Look for HTTPS: Reputable websites use HTTPS (with the padlock icon). This adds encryption, making it harder (though not impossible) for an attacker to snoop.
- Be Wary of Public Wi-Fi: Public networks are prime targets. Use a VPN to shield your traffic if you must use public Wi-Fi.
- Trust Your Browser: If your browser warns about certificate issues, take it seriously. This could indicate an attempted MITM attack.
- Strong Passwords and 2FA: Even if passwords are intercepted, unique passwords and two-factor authentication significantly reduce the risk of account takeover.
- Software Updates: Keep devices and browsers up-to-date. Vulnerabilities in older software make MITM attacks easier.
- To check if you are arpspoofed, open cmd and enter
arp -a
. You should ideally be seeing different MAC addresses for different IPs, if you see same MAC for different IPs, you’re arpspoofed.
Note: Even with precautions, highly sophisticated MITM attacks can be tough to defend against, especially if attackers manage to compromise trusted infrastructure. It emphasizes the need for ongoing security vigilance and awareness.
Stay Protected!