SSL/TLS MITM with Certificate Substitution
You'll learn how attackers intercept encrypted HTTPS traffic by replacing legitimate certificates with forged ones.
The Core Concept
When you've positioned yourself as a man-in-the-middle (using techniques like ARP spoofing), encrypted SSL/TLS traffic still remains a problem—you can see it flowing, but you can't read it. Certificate substitution solves this from an attacker's perspective: you act as a proxy, presenting a fake certificate to the victim while maintaining a separate legitimate connection to the real server.
Here's how it works:
- Victim connects to what they think is
bank.com - Your MITM device intercepts the connection
- You present a forged certificate claiming to be
bank.com(signed by a fake CA you control) - If the victim accepts it, their browser encrypts data using your certificate
- You decrypt the victim's traffic, read/modify it, then re-encrypt it with the real
bank.comcertificate and forward it along
The Weak Link
This attack only works if the victim's browser doesn't reject your fake certificate. Modern browsers check:
- Is the certificate signed by a trusted Certificate Authority?
- Does the domain name match?
- Is it expired?
Attackers must either install a rogue CA certificate on the victim's system first, or hope the victim clicks through browser security warnings.
Real-World Example
Tools like mitmproxy and bettercap automate this process. They generate certificates on-the-fly for any domain the victim visits, decrypt both sides of the conversation, and log everything in plaintext.
Key Takeaway: SSL/TLS MITM with certificate substitution breaks encryption by tricking the client into trusting a fake certificate, allowing the attacker to decrypt, inspect, and modify supposedly secure traffic—but only if certificate validation fails or is bypassed.