Skip to content
General ITAdvanced

Man-in-the-Middle (MitM) Attacks Explained: How They Work, Common Techniques, Risks, Detection, and Prevention

A Man-in-the-Middle (MitM) attack is a cybersecurity attack in which an attacker secretly positions themselves between two parties that believe they are comm...

BI
Bison Technical Team Enterprise IT specialists
Updated 24 Aug 2026 16 min read 0 total views

A Man-in-the-Middle (MitM) attack is a cybersecurity attack in which an attacker secretly positions themselves between two parties that believe they are communicating directly with each other.

The attacker may intercept, monitor, capture, relay, or manipulate communications passing between the two parties.

Advertisement

For example, suppose a user believes their computer is communicating directly with an online service:

Normal communication:

User → Website/Server

During a successful MitM attack, the communication may effectively become:

User → Attacker → Website/Server

and the response follows the reverse path:

Website/Server → Attacker → User

The dangerous aspect is that both legitimate parties may continue communicating normally while being unaware that an attacker is positioned somewhere in the communication path.

Depending on the technique and whether encryption is successfully defeated or bypassed, an attacker may attempt to obtain information such as:

  • Usernames
  • Passwords
  • Session cookies
  • Authentication tokens
  • Email messages
  • Financial information
  • Business data
  • Personal information
  • Application traffic
  • Login sessions

In some cases, the attacker may also attempt to modify the information being transmitted rather than merely observe it.


How Does a Man-in-the-Middle Attack Work?

A MitM attack generally involves two broad technical stages:

  1. Interception
  2. Decryption, impersonation, or manipulation

The exact process depends heavily on the network, protocol, application, and security controls involved.


Stage 1: The Attacker Intercepts Communication

The attacker first needs to place themselves logically or physically somewhere along the communication path.

Consider a user opening an online service.

Normally:

Computer → Router → Internet → Website

In a MitM scenario, an attacker may attempt to create:

Computer → Attacker-controlled position → Router/Internet → Website

This interception can potentially be achieved through techniques involving:

  • Compromised Wi-Fi networks
  • Rogue wireless access points
  • Evil twin Wi-Fi
  • ARP spoofing
  • DNS manipulation
  • Compromised routers
  • Malicious proxies
  • Network infrastructure compromise
  • Certain phishing techniques
  • Adversary-in-the-Middle authentication proxies

Simply intercepting encrypted traffic, however, does not automatically reveal its contents. Modern HTTPS/TLS is specifically designed to protect communication against interception.

The attacker therefore needs some additional way to defeat, downgrade, bypass, terminate, or otherwise undermine the protected communication.


Stage 2: The Attacker Attempts to Read or Manipulate Traffic

If communication is unencrypted, intercepted information may potentially be readable directly.

For properly configured HTTPS/TLS communication, however, the attacker normally encounters encrypted traffic.

This is why certificate validation, modern TLS configurations, secure browsers, HSTS, and properly configured applications are important defenses.

An attacker may instead try techniques such as:

  • SSL/TLS downgrade attempts
  • SSL stripping under vulnerable conditions
  • Certificate-related deception
  • DNS manipulation
  • Malicious proxying
  • Session theft
  • Authentication phishing proxies
  • Compromising one of the endpoints

The success of these attacks depends on numerous factors, including the security configuration of the client, server, network, browser, and authentication system.


Simple Example of a MitM Attack

Imagine an employee connects a laptop to an untrusted wireless network.

The employee then accesses:

https://example.com

If the connection is correctly protected by HTTPS, certificate validation works correctly, and the user does not bypass certificate warnings, simply controlling the Wi-Fi network should not allow an attacker to transparently read the encrypted HTTPS content.

However, the malicious network could still attempt other attacks, such as:

  • Redirecting DNS queries
  • Redirecting unencrypted HTTP traffic
  • Presenting fake websites
  • Triggering certificate warnings
  • Attempting phishing
  • Observing some network metadata
  • Blocking or manipulating insecure protocols

This distinction is important because the common statement that "anyone on public Wi-Fi can automatically read your HTTPS passwords" is inaccurate.

Modern encryption significantly reduces that risk.


Common Types of Man-in-the-Middle Attacks

1. ARP Spoofing or ARP Poisoning

ARP stands for Address Resolution Protocol.

On IPv4 local networks, ARP helps devices associate IP addresses with MAC addresses.

An attacker on the same network may attempt to send falsified ARP information so that devices incorrectly associate the attacker's MAC address with another system, such as the default gateway.

The attacker may try to position their device between:

Victim ↔ Gateway

Traffic can then potentially be relayed through the attacker's system.

This is commonly called:

  • ARP spoofing
  • ARP poisoning
  • ARP cache poisoning

Encryption such as HTTPS can still protect application data even when an attacker succeeds in intercepting network traffic.


2. DNS Spoofing or DNS Poisoning

DNS translates domain names such as:

example.com

into IP addresses.

If an attacker can manipulate DNS resolution, the victim may be directed toward an incorrect destination.

Conceptually:

User requests:
bank.example

Legitimate DNS:
bank.example → legitimate server

Manipulated DNS:
bank.example → attacker-controlled destination

Modern HTTPS certificate validation provides an important additional defense because a fake server normally cannot simply present a valid certificate for a domain it does not control.

Users should therefore never casually ignore browser certificate warnings.


3. Evil Twin Wi-Fi Attack

An evil twin is a rogue wireless network designed to imitate a legitimate Wi-Fi network.

For example, legitimate Wi-Fi might be:

Airport_Free_WiFi

An attacker could create:

Airport_Free_WiFi

or a visually similar network name.

A user may connect to the attacker's access point without realizing it.

The attacker then controls the network through which the user's traffic travels.

Possible attacks can include:

  • DNS manipulation
  • Traffic redirection
  • Fake captive portals
  • Phishing pages
  • Monitoring insecure traffic
  • Attempting protocol downgrade attacks

HTTPS remains an important protection against direct content interception.


4. Rogue Wi-Fi Hotspots

A rogue hotspot does not necessarily need to copy an existing Wi-Fi network.

Attackers may simply create attractive network names such as:

Free_Public_WiFi

or:

Free_Airport_Internet

Users may voluntarily connect because the network appears convenient.

Once connected, their traffic passes through infrastructure controlled by the hotspot operator.


5. SSL Stripping

SSL stripping is a technique historically associated with forcing or keeping a victim on an insecure HTTP connection instead of allowing communication to upgrade to HTTPS.

Conceptually:

Victim → HTTP → Attacker → HTTPS → Website

The victim communicates insecurely with the attacker while the attacker communicates securely with the legitimate website.

Modern defenses such as:

  • HTTPS-by-default behavior
  • HTTP Strict Transport Security (HSTS)
  • Browser security improvements
  • Secure cookies

have made traditional SSL stripping considerably more difficult against correctly configured modern services.


6. HTTPS/TLS Interception

HTTPS uses TLS to provide:

  • Encryption
  • Authentication
  • Integrity protection

For transparent TLS interception, an attacker generally needs to overcome certificate validation.

If a malicious certificate is presented without being trusted, modern browsers normally display a security warning.

Users should treat warnings such as:

Your connection is not private

or:

Certificate not trusted

seriously.

Organizations should also carefully control trusted root certificates installed on managed endpoints because trusted certificates can affect TLS inspection capabilities.


7. Session Hijacking

After successful authentication, websites commonly issue a session cookie or authentication token.

That token may effectively tell the application:

This browser has already authenticated.

If an attacker obtains a usable session token, they may sometimes access an account without needing the original password.

This is called session hijacking.

Session tokens can therefore be extremely sensitive.

Modern applications should protect them through mechanisms including:

  • HTTPS
  • Secure cookie attributes
  • HttpOnly cookies
  • SameSite controls
  • Short session lifetimes where appropriate
  • Session rotation
  • Risk-based authentication
  • Reauthentication for sensitive operations

8. Adversary-in-the-Middle (AiTM) Phishing

Modern authentication attacks increasingly use an approach commonly called Adversary-in-the-Middle (AiTM) phishing.

Rather than attacking the network directly, the attacker places a malicious reverse proxy between the victim and legitimate authentication service.

Conceptually:

Victim → Malicious proxy → Legitimate login service

The proxy relays authentication pages between the user and legitimate service.

This can potentially allow attackers to capture:

  • Username
  • Password
  • Session cookies
  • Authentication tokens

Some AiTM techniques may bypass traditional MFA methods if the attacker successfully steals a valid authenticated session.

This is one reason organizations increasingly consider phishing-resistant authentication, such as FIDO2 security keys and passkeys, where supported.


Why Are MitM Attacks Dangerous?

MitM attacks threaten three fundamental cybersecurity properties.

Confidentiality

Attackers may attempt to read information that should remain private.

Examples include:

  • Credentials
  • Business information
  • Financial information
  • Personal information

Integrity

Attackers may attempt to modify information while it is being transmitted.

For example:

Original:
Transfer payment to Account A.

Modified:
Transfer payment to Account B.

Authentication

MitM attacks may interfere with a user's ability to verify who they are actually communicating with.

The victim may believe they are communicating with:

Trusted Server

when their communication is actually being relayed through:

Attacker-controlled infrastructure


What Information Can Be Targeted?

Depending on the attack and security protections involved, attackers may target:

  • Login credentials
  • Session cookies
  • Authentication tokens
  • Financial information
  • Personal data
  • Business documents
  • Email communication
  • API credentials
  • Application sessions
  • Cloud accounts

Not every MitM attack provides access to all of this information. Strong encryption and authentication can prevent many interception techniques from exposing application data.


Man-in-the-Middle Attacks and Public Wi-Fi

Public Wi-Fi has traditionally been associated with MitM attacks because users do not necessarily control or trust the network infrastructure.

Potentially risky networks include those found in:

  • Airports
  • Hotels
  • Cafés
  • Railway stations
  • Shopping centers
  • Conferences
  • Public venues

However, modern HTTPS has substantially improved security on untrusted networks.

A malicious hotspot may know that a device is communicating with certain network destinations or may observe other metadata, but correctly implemented TLS generally prevents it from simply reading HTTPS-protected passwords and page contents.

Public Wi-Fi should still be treated as untrusted infrastructure.


How HTTPS Helps Prevent MitM Attacks

HTTPS combines HTTP with TLS.

TLS provides three critical protections:

Encryption

Information transmitted between the browser and server is encrypted.

Authentication

Digital certificates help the browser verify the identity of the server.

Integrity

TLS helps detect unauthorized modification of transmitted information.

For example:

Browser ↔ Encrypted TLS Connection ↔ Web Server

An attacker capturing packets should normally see encrypted data rather than readable passwords, messages, or page contents.


How TLS Certificates Protect Users

When connecting to an HTTPS website, the browser validates the site's certificate.

Among other checks, it verifies whether:

  • The certificate is valid for the requested hostname
  • The certificate is within its validity period
  • The certificate chains to a trusted certificate authority
  • Relevant certificate validation requirements are satisfied

If certificate validation fails, the browser may display a security warning.

Ignoring such warnings can defeat an important security protection.


How to Detect a Possible MitM Attack

MitM attacks can be difficult for ordinary users to detect, but warning signs may include:

  • Unexpected certificate warnings
  • HTTPS unexpectedly unavailable
  • Redirects to unfamiliar domains
  • Unexpected login pages
  • Repeated authentication requests
  • Suspicious Wi-Fi networks
  • Duplicate wireless network names
  • Unexpected DNS behavior
  • Unusual account sessions
  • Security alerts from identity providers
  • Unexpected changes to network configuration
  • Unrecognized trusted certificates
  • IDS/IPS alerts
  • ARP anomalies on managed networks

Any one symptom does not automatically prove that a MitM attack is occurring.

Investigation should correlate multiple sources of evidence.


How Businesses Can Detect MitM Activity

Organizations can use layered monitoring technologies including:

Intrusion Detection and Prevention Systems

IDS/IPS platforms can identify suspicious network patterns.

Network Monitoring

Administrators can investigate:

  • ARP changes
  • MAC address anomalies
  • DNS changes
  • Gateway changes
  • Unusual proxies
  • Unexpected certificate behavior

SIEM

Security Information and Event Management platforms can correlate:

  • Authentication logs
  • Endpoint alerts
  • Firewall logs
  • DNS activity
  • Network events
  • Cloud identity logs

This can make sophisticated interception or account takeover attempts easier to identify.


How to Protect Against Man-in-the-Middle Attacks

Organizations and individual users should use multiple defensive layers.

1. Use HTTPS

Sensitive websites and applications should use HTTPS consistently.

Never transmit passwords or sensitive business information through insecure HTTP services.


2. Never Ignore Certificate Warnings

Unexpected certificate errors should be investigated rather than bypassed.

A certificate warning can indicate:

  • Website misconfiguration
  • Expired certificates
  • Incorrect system time
  • TLS inspection
  • Network problems
  • A potential interception attempt

3. Keep Browsers and Operating Systems Updated

Security updates help protect against vulnerabilities affecting:

  • TLS
  • Certificate validation
  • Browsers
  • Network stacks
  • Wireless networking
  • Authentication

4. Secure Wi-Fi Networks

Businesses should use modern wireless security, preferably WPA3 where practical or properly configured WPA2 where required for compatibility.

Avoid obsolete technologies such as:

  • WEP
  • WPA
  • Weak shared passwords

5. Use a VPN on Untrusted Networks When Appropriate

A reputable VPN creates an encrypted tunnel between the device and VPN endpoint.

Conceptually:

Device → Encrypted VPN Tunnel → VPN Server → Internet

This can reduce exposure to local network attackers, especially for traffic or applications that may not otherwise have strong transport protection.

A VPN does not eliminate every cybersecurity risk and does not replace HTTPS.


6. Use Multi-Factor Authentication

MFA adds another layer beyond passwords.

However, some forms of MFA can still be targeted through sophisticated phishing and AiTM attacks.

Where supported, organizations should consider phishing-resistant authentication such as:

  • Passkeys
  • FIDO2 security keys
  • WebAuthn-based authentication

7. Secure DNS

Organizations can consider technologies such as:

  • DNSSEC validation
  • DNS over HTTPS (DoH)
  • DNS over TLS (DoT)
  • Trusted enterprise DNS services

Each addresses different parts of DNS security, and they should not be treated as interchangeable protections.


8. Protect Network Infrastructure

Routers, firewalls, wireless controllers, switches, and access points should be securely configured.

Administrators should:

  • Change default credentials
  • Install security updates
  • Restrict management interfaces
  • Disable unnecessary services
  • Monitor configuration changes
  • Segment sensitive networks
  • Protect administrative accounts with MFA where supported

MitM Attacks Against Businesses

Businesses are particularly attractive targets because intercepted communications may expose access to:

  • Corporate email
  • Microsoft 365
  • Google Workspace
  • Banking systems
  • ERP applications
  • Customer databases
  • Cloud services
  • VPN accounts
  • Administrative portals
  • Internal applications

A successful interception combined with credential or session theft can potentially lead to broader account compromise.


MitM vs Phishing

These attacks are related but different.

Phishing typically tricks the victim into interacting with a fraudulent message, website, QR code, or other resource.

MitM involves positioning an attacker between communicating parties.

Modern AiTM phishing combines elements of both by using a phishing site or reverse proxy to relay authentication traffic to the legitimate service.


MitM vs Packet Sniffing

Packet sniffing means capturing network packets.

A packet sniffer may operate passively and simply observe available traffic.

A MitM attacker usually goes further by positioning themselves within the communication flow so traffic can potentially be:

  • Relayed
  • Monitored
  • Redirected
  • Manipulated

Encrypted packet capture alone does not mean that the captured application data can be read.


MitM vs Session Hijacking

A MitM attack describes an attacker being positioned between communicating parties.

Session hijacking involves obtaining control of an authenticated session.

A MitM or AiTM technique can sometimes be used to obtain session tokens, meaning the two attack types can be related.


Practical Example

Consider an employee who receives a link claiming to open a corporate Microsoft 365 or Google Workspace login page.

The link actually leads through attacker-controlled infrastructure.

The employee enters credentials.

The malicious service relays the authentication request to the legitimate provider.

If the attack successfully proxies the authentication flow and captures an authenticated session token, the attacker may potentially reuse that session.

This demonstrates why organizations should not rely exclusively on passwords and basic MFA.

Phishing-resistant authentication can significantly strengthen protection against this class of attack.


What Should You Do If You Suspect a MitM Attack?

If suspicious interception is suspected:

  1. Disconnect from the suspicious network.
  2. Do not continue through unexpected certificate warnings.
  3. Connect through a trusted network.
  4. Notify the organization's IT or security team.
  5. Review account sign-in activity.
  6. Revoke suspicious sessions where possible.
  7. Change potentially compromised passwords from a trusted device and network.
  8. Verify MFA settings and registered authentication methods.
  9. Check for unexpected certificates, proxies, DNS settings, or network configuration changes.
  10. Review endpoint, firewall, DNS, identity, and network logs.

For business environments, preserve relevant logs before they are overwritten.


Frequently Asked Questions (FAQ)

1. What is a Man-in-the-Middle attack?

A Man-in-the-Middle attack occurs when an attacker secretly intercepts or relays communication between two parties that believe they are communicating directly.

2. How does a Man-in-the-Middle attack work?

The attacker first gains a position from which communication can be intercepted and then attempts to observe, redirect, impersonate, decrypt, or manipulate the traffic.

3. Can a MitM attacker steal passwords?

Potentially, but this depends on the attack. Properly configured HTTPS prevents ordinary network interception from exposing passwords in plaintext. Phishing, malicious proxies, compromised endpoints, or defeated certificate validation can create additional risks.

4. Can HTTPS prevent MitM attacks?

HTTPS/TLS is one of the primary defenses against network-based MitM attacks because it provides encryption, server authentication, and integrity protection.

5. Can public Wi-Fi cause a MitM attack?

An untrusted or malicious public Wi-Fi network can create opportunities for interception and redirection attacks. HTTPS and other security technologies significantly reduce the exposure.

6. Can hackers read HTTPS traffic on public Wi-Fi?

Not simply because they control the Wi-Fi network. Correctly configured HTTPS encrypts the communication. Additional compromise, deception, or certificate-related conditions would generally be required to expose the encrypted content.

7. What is an evil twin Wi-Fi attack?

An evil twin is a malicious wireless network designed to imitate a legitimate network so users connect to attacker-controlled infrastructure.

8. What is ARP spoofing?

ARP spoofing involves sending falsified ARP information on a local IPv4 network to manipulate how devices associate IP addresses with MAC addresses.

9. What is DNS spoofing?

DNS spoofing involves manipulating DNS information so users may be directed toward an incorrect destination.

10. What is SSL stripping?

SSL stripping is a technique that attempts to keep the victim using an insecure HTTP connection while the attacker communicates with the legitimate server over HTTPS.

11. Can a VPN prevent MitM attacks?

A properly configured reputable VPN can significantly reduce exposure to local network interception by encrypting traffic between the device and VPN endpoint. It does not replace HTTPS or protect against every type of attack.

12. Can MFA stop MitM attacks?

MFA improves account security, but some traditional MFA methods can be targeted by AiTM phishing. Phishing-resistant authentication such as FIDO2/WebAuthn and passkeys provides stronger protection where supported.

13. What is an AiTM attack?

An Adversary-in-the-Middle attack is a modern form of interception in which attacker-controlled infrastructure, often a malicious reverse proxy, sits between the victim and legitimate authentication service.

14. Can MitM attacks bypass two-factor authentication?

Certain AiTM attacks can potentially steal authenticated session tokens after the user completes some forms of MFA. This does not mean that all MFA can be universally bypassed.

15. What should I do if my browser displays a certificate warning?

Do not enter credentials or sensitive information. Verify the website address, network connection, system time, and certificate problem. In a business environment, report unexpected certificate warnings to IT or security personnel.

16. Can antivirus detect a MitM attack?

Antivirus may detect related malware or suspicious endpoint activity, but MitM detection often requires additional technologies such as network monitoring, IDS/IPS, DNS monitoring, endpoint security, and identity monitoring.

17. Are MitM attacks still relevant today?

Yes. HTTPS has made many traditional interception techniques more difficult, but attackers continue using techniques involving compromised networks, phishing proxies, session theft, DNS manipulation, and account authentication.

18. Is packet sniffing the same as a MitM attack?

No. Packet sniffing refers to capturing network packets. A MitM attack generally involves placing the attacker within the communication path to relay or potentially manipulate traffic.

19. How can businesses reduce MitM risk?

Businesses should use HTTPS/TLS, secure Wi-Fi, network segmentation, strong authentication, phishing-resistant MFA where possible, endpoint protection, secure DNS, infrastructure patching, certificate monitoring, and centralized security logging.

20. What is the most important defense against MitM attacks?

There is no single universal defense. Modern TLS/HTTPS, correct certificate validation, secure authentication, patched systems, trusted networks, and user awareness work together to provide effective protection.

Conclusion

A Man-in-the-Middle attack attempts to place an attacker between two communicating parties so information can potentially be intercepted, relayed, redirected, or manipulated.

Traditional MitM techniques include ARP spoofing, DNS manipulation, rogue Wi-Fi networks, evil twin hotspots, and SSL stripping. Modern threats also include Adversary-in-the-Middle phishing, which can target authentication sessions and tokens.

Modern HTTPS/TLS has dramatically strengthened protection against basic network interception. However, encryption alone cannot compensate for compromised endpoints, ignored certificate warnings, stolen sessions, phishing, weak authentication, or insecure infrastructure.

Effective MitM protection therefore requires a layered security strategy combining HTTPS/TLS, secure Wi-Fi, certificate validation, strong authentication, phishing-resistant MFA, secure DNS, network monitoring, endpoint security, patch management, and cybersecurity awareness.

#Tags

#ManInTheMiddle #MITM #MITMAttack #CyberSecurity #CyberAttack #NetworkSecurity #InformationSecurity #DataSecurity #InternetSecurity #WiFiSecurity #PublicWiFi #EvilTwin #ARPSpoofing #ARPPoisoning #DNSSpoofing #DNSPoisoning #SSLStripping #TLSSecurity #SSL #HTTPS #Encryption #CyberThreats #CyberAwareness #CyberSecurityAwareness #NetworkAttack #DataInterception #PacketSniffing #SessionHijacking #CredentialTheft #IdentityTheft #AccountTakeover #MFA #TwoFactorAuthentication #Passkeys #FIDO2 #WebAuthn #VPN #VPNSecurity #SecureBrowsing #WebSecurity #EndpointSecurity #ZeroTrust #DigitalCertificate #PKI #SecureWiFi #AiTM #Phishing #CyberDefense #SecurityAwareness #CyberSecurityTips

YOUR FEEDBACK

Was this guide useful?

Your answer helps us keep BISONKB accurate and practical.

BISON AI

Ask about “Man-in-the-Middle (MitM) Attacks Explained: How They Work, Common Techniques, Risks, Detection, and Prevention”

This interface is ready to connect to your preferred AI provider. No article or user data is sent until that service is configured.

THE BISON BRIEF

Practical IT knowledge, once a week.

New troubleshooting guides, scripts and infrastructure notes. No noise.

By subscribing, you agree to our privacy policy.