🚀 Invicti Acquires Kondukto to Deliver Proof-Based Application Security Posture Management
SSL hijacking is a type of attack where the attacker generates fake certificates for the domains of HTTPS sites the victim attempts to visit. As a result, the victim assumes they have a secure connection to the target site, but in reality, they have a secure connection to a cloned or proxy site controlled by the attacker. SSL hijacking is considered a man-in-the-middle attack (MITM) technique.
Note: While man-in-the-middle attacks are usually considered to be a network security issue, SSL hijacking most often affects websites and web applications (because they use the HTTPS protocol), so it could be considered a web application security issue.
All network traffic secured using SSL/TLS (Secure Sockets Layer/Transport Layer Security) is encrypted on the basis of an SSL/TLS certificate. For example, when you visit a secure site using a web browser for the first time, your browser receives the SSL/TLS certificate, verifies its authenticity, and creates an encrypted connection based on that certificate and its security requirements, such as the preferred cryptographic algorithms.
While SSL/TLS can be used for all types of TCP connections, it is most often used for HTTPS to secure access to websites, web applications, and web APIs. To understand SSL/TLS better, you can read a series of TLS security articles on the Acunetix blog.
For SSL hijacking to be possible, the attacker must first use another type of man-in-the-middle attack to intercept the connection between the victim (the user being attacked) and the target (the page under attack). This can be done using, for example, ARP spoofing, IP spoofing, or DNS cache poisoning. When attempting to visit the target site, the victim actually establishes a connection to a server controlled by the attacker. The attacker’s server then relays all traffic to the target and back, allowing the attacker to read and modify information along the way.
However, if the victim wants to use HTTPS when visiting the site, their browser will expect the attacker-controlled site to present an SSL/TLS certificate for the domain under attack. This requires the attacker to generate a fake certificate for the target and send it to the victim’s browser.
The challenge with SSL hijacking is that due to the way public key infrastructure (PKI) works, your browser only trusts certificates signed by a trusted Certificate Authority (CA). If a certificate is not signed by a trusted CA, your browser will show a clear warning and may even refuse to open a page. Operating systems such as Microsoft Windows and Linux come with a built-in set of trusted Certificate Authorities, but you can always manually add new ones.
For SSL hijacking to succeed, the attacker needs to add their CA to the trusted certificate store in your operating system. This part has to be done through other attack vectors and vulnerabilities, such as phishing and cross-site scripting, making SSL hijacking nearly impossible unless combined with other attacks.
Note that even if a malicious hacker cannot find a way to put their CA certificate on your computer, they can still try an SSL stripping attack instead to get your browser to use HTTP connections instead of HTTPS, in effect sending web traffic in plain text.
In this example, the target is the invicti.com website, and you are the victim.
While invicti.com may not be a lucrative attack target, threat actors can apply the same techniques to any other website or web application to get your authentication information. For example, they could target an e-commerce site where you provide your credit card information, or pick another web application with functionality that stores and transmits sensitive data.
Note that, contrary to some claims, a web application firewall (WAF) can only prevent SSL hijacking when installed on a separate machine (for example, on the router) or if it uses a different certificate store from that of the main operating system. If you have a WAF that relies on CA certificates in the victim’s operating system for domain authenticity validation, it can be fooled in exactly the same way as the browser.
Once an SSL hijacking attack is successfully executed, there is no way to mitigate it. Sensitive information sent and received from the target site will be accessible to the attacker until the attack is somehow interrupted (for example, if the user removes the fake CA certificate or simply terminates the intercepted connection).
Mitigating all SSL hijacking attempts may also have unforeseen consequences because this technique is often used for legitimate purposes. For example, malware protection software installed on your computer probably uses SSL hijacking techniques to inspect traffic. Otherwise, it would not be able to protect you when you tried to download malware over a secure connection. Some companies use SSL hijacking to control traffic in their internal networks, for example, to check what content their employees are accessing. Parental control software also uses SSL hijacking. This means your system most likely has CA certificates from software that uses such techniques, and if you remove them, this software will stop working.
In an SSL hijacking MITM attack, the attacker generates fake certificates for the domains of HTTPS sites the victim attempts to visit. The victim assumes they have a secure connection to the target site, but in reality, they have a secure connection to a cloned or proxy site controlled by the attacker.
SSL hijacking can be very dangerous, but it is not easy to execute because it must be combined with other techniques such as ARP spoofing, IP spoofing, or DNS cache poisoning, as well as social engineering.
Read how the Kazakhstan government tried to use SSL hijacking on its citizens in 2019.
Basic cybersecurity hygiene and carefully reading browser warnings should be enough to prevent SSL hijacking. If you don’t allow yourself to be tricked into installing suspicious software that smuggles a fake CA certificate into your system, your browser will not be fooled by the attacker’s certificate and will show a warning that the site is not trusted.
Find out how to prevent other man-in-the-middle attacks (MITM).