According to my experience surfing the web, many websites foo.com don't support https. When I go to https://foo.com, it just changes to foo.com
Can attackers forge the fact that foo.com doesn't support https and use http instead?
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.
Sign up to join this communityAccording to my experience surfing the web, many websites foo.com don't support https. When I go to https://foo.com, it just changes to foo.com
Can attackers forge the fact that foo.com doesn't support https and use http instead?
Contrary to the intuition, fact that https://foo.com
changes to http://foo.com
in modern browser means foo.com does support https, and whoever is issuing the redirect has certificate for foo.com
(and not any certificate, one that your browser trusts). Otherwise server at foo.com
wouldn't be able to instruct your browser to redirect, because redirect command (Location: http://foo.com
in combination with proper status code) is part of http protocol, which browser does not start to speak to the server in until the SSL handshake completed successfully.
My Old Answer:
If a site is not using https, it's already "sniffable", so it doesn't matter that it redirects from https to http. There's nothing additional to take advantage of, since it's already http.
Instead, if a site is purely https, that's where the MITM attack could take advantage of changing the protocol to http. This is certainly possible, and this is why when you are visiting a site that requests or displays personal information, you should check to make sure that the site is using https with a valid cert. If it's not, it's possible there is a MITM happening and your traffic is being compromised.
Edit: I'm sitting here racking my brains trying to figure out how my response could possibly be down-voted. But now I realize that I misunderstood the question. (And so did Badskillz judging from his comment.) I thought the question was something like: "Can attackers force a redirect to http on a site that only has http (or redirects from https to http)?" When in fact, it appears the question is asking, is it possible that foo.com is actually supposed to be using https, but an active MITM attack is redirecting it to http? The answer is Yes, it is possible for a MITM attack to do that. Of course, it's much more likely that somewhere on foo.com there are pages that use https, and those pages are forced to use https, and the rest of the site is forced to use http- thus the redirect. If you're on your banking site and you see a redirect to http, I'd be much more likely to start thinking that could due to a MITM attack.
I'm leaving my previous answer because it is still accurate information.
No, nothing is wrong with that.
Lot of websites function that way because they know their visitors forget easily to write https://
since they do not even know all of them the difference between HTTP and HTTPS. That is the only purpose of the behavior you described: in order not to loose their audience, lot of websites choose to behave like that.
Apache server is the most widespread as this study from Netcraft mentions:
Based on this, we can mention one of the most common methods used in Apache to have the result you described by taking advantage of its mod_rewrite used to rewrite the rules requested URLs which, if enabled, allows to achieve that goal by adding httpd.conf
file these lines:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Yes, they can. When they see an attempt to make a TLS connection to a server, they can intercept it and reply with a fake error message stating that the server does not support TLS. This technique is known as SSL stripping.