HTTPS those things (iii) Attack instance and defense (reprint)

Source: Internet
Author: User
Tags http strict transport security ssl certificate stunnel goagent

Original address: http://www.guokr.com/blog/148613/

In the "https" Thing (ii) SSL Certificate I describe some security issues that need to be noted when using SSL certificates, and in this article I'll show you some examples of HTTPS attacks that make it safer to use HTTPS. The enemy Baizhanbudai.

Let's talk about my test environment, WiFi LAN, two computers, one of which is Windows 7 for initiating an attack. Another test machine is used to test the attack, configured for Windows XP sp3,ie8,chrome 17.

Before you begin, review the three-point reason for SSL certificate validation failure:

    1. The SSL certificate is not issued by a trusted CA authority
    2. Certificate Expiration
    3. The site name you are accessing does not match the domain name of the certificate binding
One, SSL hijacking attack

SSL hijacking is the SSL certificate spoofing attack, the attacker in order to obtain the HTTPS transmission of plaintext data, you need to first access to the browser and the target site (middleman), in the process of transmitting data, replace the target website issued to the browser certificate, and then decrypt the data in the transmission, a simple diagram is as follows:

[Browser] <======> [target website] (normal condition)

[Browser] <======> middleman <======> [target website] (man-in-the-middle attack)

The best environment for man-in-the-middle attacks is that in a local area network, all computers in the LAN need to be connected to the Internet through a fixed exit (gateway), so that attackers can successfully intercept all data transmitted between the computer and the gateway by simply implementing an in-person attack on the LAN.

Is the SSL certificate spoofing tool that was implemented in my test environment after a man-in-the-middle attack, and you can see the machine that was deceived at this time, the browser has given the security prompt for the certificate error:


When you see such a hint, the normal situation should stop the access, and if you continue to access, all encrypted transmitted data can be decrypted by the attacker. Here I choose to continue the visit to see the forged SSL certificate information.

As can be seen here, the false certificate in the "issued to", "issuer", "Effective Date" and the true certificate (see), the attacker can generate a certificate release certificate to write the same information as the original certificate to confuse the user, but not to confuse the authentication mechanism of the certificate. For ordinary users, be sure to see the browser's warning message, if there is a problem, do not continue to visit.

Second, SSLstrip attack

SSLstrip attacks also require an attacker to be an intermediary, and then replace HTTPS access with HTTP returned to the browser, since the data transmitted by the HTTP protocol is unencrypted to intercept the data that the user accesses. For example, when we visit hotmail.com and redirect to an https address of https://login.live.com, SSLstrip will communicate with the server instead of the user and change the address to HTTP/ Login.live.com (Note that this address has no s behind HTTP) is returned to the browser, at which point the attacker intercepts the user's password if the user continues to log on. This attack is very confusing to ordinary users, but the defense is very simple:

    1. For a Web site, add an "http Strict Transport Security" configuration item when configuring the HTTPS service, or you can force all HTTP requests to HTTPS on the code, and use the URL rewrite to achieve the same effect.
    2. For the key information, such as the user login site ID and password, before sending the first encryption processing with JavaScript, this method is not only valid for SSLstrip, SSL hijacking attack is also effective, Even the use of the HTTP protocol to transfer the user's login ID and password is safe. This feature is supported by the shell mesh.
    3. For users, when visiting those Web sites that support HTTPS, in the browser's address bar to enter the URL is forced to add "https://", most users usually do not pay attention to this, such as access to Gmail, we generally enter "gmail.com", if it is input "https ://gmail.com "can avoid sslstrip attacks. For the use of scripts to implement address jumps also need to pay attention to this problem, location.href after the URL, be sure to force the addition of "https://".

Because the defensive sslstrip attack is relatively simple, most of the sites have been configured for security, but there are a few sites still do not pay attention to this issue.

Iii. attacks of the third Kind

The so-called third kind of attack, is completely the software vendor in the software design process ignores the security question, for example, some time ago a mobile browser did such a embarrassing thing. In fact, this is also a common situation, program bugs, loopholes, design flaws, will break some security model. In this case, the software vendors in the software design phase to fully consider the security issues, and timely update the program defects and security vulnerabilities, as a user to update the application or system patches in a timely manner, thereby reducing security threats.

The most common means are still SSL hijacking attacks, but no matter what the attack means, the basis of the use of the network is a man-in-the-middle attack, this attack method is very practical, especially in the public network. Man-in-the-middle attacks on SSL may be good for ordinary users, but most of us access HTTP sites, and the transmitted data is plaintext, in which case a man-in-the-middle attack is not easily discoverable. For ordinary users, the following methods can be used to defend the LAN man-in-the-middle attack:

    1. Corporate office network must be on the switch to the MAC address binding, for some small scale, temporarily do not consider the reinforcement of the intranet company can take the following I said method.
    2. Temporarily access the public network of the computer, you can temporarily open the security software in the ARP firewall. or use a VPN.
    3. For some users who do not like to install security software, you can use Stunnel to configure the agent or use SSH to socks 5 proxy. However, this requires the user to have a separate server.
    4. Using the Goagent Proxy tool, goagent, like Stunnel, is a tool for encrypting transports using SSL tunnel. Even if you are visiting an HTTP Web site, goagent can encrypt the transmission like stunnel, ensuring that you can browse the Web and access the Web mailbox securely. Goagent uses the Google App engine server, so the speed of visiting the domestic website will be slow, for this situation can use the Sina App engine, the specific configuration method can be used in search engines with "goagent SAE" as the keyword search.
    5. In a public network, if you want to do business, it is best to encrypt the transmission using a VPN provided by the company.

Finally said mobile internet, the current public Wi-Fi more and more popular, mobile internet access is more convenient, so also need to pay attention to the security issues in the process of data transmission. While Goagent also has versions that support Android and iOS, it's a good idea to use an official app to do things like online payments. Security protection for mobile phones is not as powerful as computers, so it's best not to use your phone to do anything that involves privacy or business secrecy until you can guarantee the transmission of encrypted data.

HTTPS those things (iii) Attack instance and defense (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.