A man in the middle attack secretly positions an attacker between two communicating parties, intercepting or altering traffic that both sides believe is private. Techniques include rogue Wi-Fi access points, ARP and DNS spoofing, and certificate manipulation. HTTPS and TLS encryption defeat most attempts, provided certificate warnings are heeded and public Wi-Fi is treated as untrusted.
Two people believe they are talking directly to each other. In reality, every message passes through a third party who reads it, and sometimes edits it, before it continues on its way. Neither side notices anything wrong. That is the essence of a man in the middle attack, and it is why encryption and certificate validation matter so much for anything sensitive sent over a network.
What is a man-in-the-middle attack, and how does it work?
A man in the middle (MITM) attack is an interception attack where the attacker secretly relays and possibly alters communication between two parties who believe they are communicating directly. The attacker positions itself logically between the victim and the legitimate service, whether that is a website, an email server or another device, forwarding traffic so the connection appears to function normally while the attacker reads or modifies it in transit.
The attack can be purely passive, where the attacker simply eavesdrops to capture credentials, session tokens or confidential information, or active, where the attacker changes the content of messages, such as substituting a different bank account number into an invoice or payment instruction, or injecting malicious code into a webpage before it reaches the victim’s browser.
How do attackers get in the middle of a connection?
Rogue Wi-Fi access points. An attacker sets up a wireless network with a name that resembles a legitimate one, such as a cafe or airport network, and waits for devices to connect automatically or for users to connect manually. Once connected, all of the victim’s unencrypted traffic passes through the attacker’s equipment.
ARP spoofing. On a local network, the Address Resolution Protocol (ARP) maps IP addresses to physical device addresses. An attacker can send forged ARP messages that associate their own device with the IP address of a legitimate gateway or host, causing other devices on the network to send their traffic to the attacker instead.
DNS spoofing. By corrupting DNS (the system that translates domain names into IP addresses) responses, an attacker can redirect a victim to a fraudulent server that looks like the intended destination, positioning themselves to intercept or manipulate the interaction.
Certificate and TLS manipulation. Encrypted connections rely on certificates to prove a server’s identity. An attacker who can present a fraudulent certificate that a victim’s device accepts, whether through a compromised certificate authority, a trusted malicious root certificate installed on the device, or a user clicking through a warning, can decrypt and re-encrypt traffic transparently, a technique sometimes called SSL stripping when it downgrades a connection from HTTPS to unencrypted HTTP.
Compromised network equipment and malicious software. A compromised router, a malicious browser extension, or malware on the victim’s device can give an attacker a persistent, invisible vantage point over traffic without needing to be on the same physical network at all.
Does HTTPS prevent a man-in-the-middle attack?
HTTPS, which uses TLS (Transport Layer Security) to encrypt traffic between a browser and a server, defeats most passive man in the middle attempts because intercepted traffic is unreadable without the encryption keys. TLS also authenticates the server’s identity through a certificate issued by a trusted certificate authority, so a browser will typically display a warning if the certificate presented does not match what it expects, a signal that something may be intercepting the connection.
Encryption is not a complete answer on its own. It protects data while in transit, but it cannot stop an attack that happens before encryption is established, that exploits a user dismissing a certificate warning, or that relies on a victim being tricked into installing a malicious root certificate that makes a fraudulent certificate appear trusted. This is why certificate validation behaviour, not just the presence of encryption, is part of a complete defence.
How is a man-in-the-middle attack defended against?
For individuals, the most practical steps are avoiding sensitive activity on untrusted public Wi-Fi, using a VPN (which creates an encrypted tunnel for all traffic) when public networks are unavoidable, confirming a site uses HTTPS before entering credentials or payment details, and never dismissing a certificate warning without understanding why it appeared.
Organisations should enforce HTTP Strict Transport Security (HSTS), which instructs browsers to always use HTTPS for a domain and helps prevent downgrade attacks. Certificate pinning, where an application is configured to only trust a specific known certificate, provides stronger protection for high value applications such as banking or payment systems. DNS security extensions (DNSSEC) reduce the risk of DNS spoofing, and internal network monitoring can detect the abnormal ARP traffic associated with local spoofing attempts.
Phishing-resistant MFA is a strong complementary control, since it limits what an attacker can do even if they intercept a password, because a static credential alone is no longer sufficient to access the account.
How does Australian guidance address man-in-the-middle attacks?
The ASD’s Information Security Manual sets requirements for approved cryptographic protocols and certificate validation to protect data in transit, directly addressing man in the middle risk for government and regulated entities. The Essential Eight’s multi-factor authentication control reduces the value of any credentials an attacker manages to intercept, since a password alone becomes insufficient for account takeover.
Public Wi-Fi risk is a recurring theme in ACSC guidance for consumers, travellers and small businesses, reflecting how often these attacks target people working from cafes, airports and hotels. A penetration test that includes network layer testing can identify whether internal systems are vulnerable to ARP spoofing or whether applications fail to validate certificates correctly.
Frequently asked questions
What is a man-in-the-middle attack?
A man in the middle (MITM) attack occurs when an attacker secretly positions themselves between two communicating parties, intercepting, and sometimes altering, the traffic passing between them without either party realising. The attacker might read confidential information such as credentials or financial details, or actively modify messages, such as changing bank account details in a payment instruction. Both parties believe they are communicating directly with each other.
How do attackers get into the middle of a connection?
Common techniques include setting up a rogue Wi-Fi access point that looks legitimate, ARP spoofing to redirect traffic on a local network, DNS spoofing to send a victim to a fake server, and exploiting weaknesses in how a device validates certificates during an encrypted connection. Compromised routers and malicious browser extensions can also give an attacker a persistent vantage point over a victim’s traffic.
Does HTTPS prevent man-in-the-middle attacks?
HTTPS, which encrypts traffic between a browser and a website using TLS, prevents most passive interception because an attacker who intercepts the traffic only sees encrypted data they cannot read. It also authenticates the server through a certificate, so a browser will normally warn the user if it detects a certificate mismatch consistent with an attack. HTTPS does not protect against attacks that trick a user into accepting a fraudulent certificate or that occur before encryption is established.
How can individuals and organisations defend against man-in-the-middle attacks?
Avoid untrusted public Wi-Fi for sensitive activity, or use a VPN to encrypt traffic over it. Ensure websites are accessed over HTTPS and pay attention to certificate warnings rather than dismissing them. Organisations should enforce HSTS, use certificate pinning for high value applications, deploy DNS security extensions where possible, and monitor for ARP spoofing on internal networks. Phishing-resistant MFA reduces the damage if credentials are intercepted.
How does this attack relate to Australian cyber security guidance?
The ASD’s Information Security Manual specifies requirements for using approved cryptographic protocols and validating certificates to protect data in transit, directly reducing man in the middle risk. The Essential Eight’s multi-factor authentication control limits the value of intercepted credentials to an attacker. Guidance on public Wi-Fi risk is a regular feature of ACSC consumer and small business advice, given how often these attacks target travellers and remote workers.
Sources:
- Information Security Manual, Australian Signals Directorate, 2026
- Securing your Wi-Fi, Australian Cyber Security Centre, 2025
- Transport Layer Security (TLS) protocol, Internet Engineering Task Force, 2018
Last updated: 30 August, 2026
