cookie 是否安全,不会被 http 劫持
我看到 Facebook 通过 http 发送 cookie。他们如何防止被劫持?如果我将 cookie 复制到另一台计算机上,我会登录吗?
I see facebook sends cookies over http. How are they secure from hijacking? If I were to copy the cookie onto another computer would I be logged in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您刚刚描述了会话劫持,这是一个真正的安全问题。可以通过多种方法来避免这种情况。不过,保护 cookie 的最简单方法是确保使用 HTTPS 而不是 HTTP 来对它们进行加密。
You've just described Session Hijacking, and it is a real security issue. It can be avoided in a number of ways. The simplest way to secure the cookies, though, is to ensure they're encrypted over the wire by using HTTPS rather than HTTP.
通过 HTTP(端口 80)发送的 Cookie 并不安全,因为 HTTP 协议未加密。
通过 HTTPS(端口 443)发送的 Cookie 是安全的,因为 HTTPS 已加密。
因此,如果 Facebook 通过 HTTP 发送/接收 cookie,它们可能会被窃取并被恶意使用。
Cookies sent over HTTP (port 80) are not secure as the HTTP protocol is not encrypted.
Cookies sent over HTTPS (port 443) are secure as HTTPS is encrypted.
So, if Facebook sends/receives cookies via HTTP, they can be stolen and used nefariously.
通过 HTTP 发送的 Cookie 是不安全的,通过 HTTPS 发送的 Cookie 比 HTTP 更安全,但是它们仍然可能被盗,因为最近发现了一些破解 SSL 的方法。有关会话劫持和所有会话劫持攻击的完整文章可以在这里找到:http://cleverlogic .net/tutorials/session-hijacking-0。还有一些关于防止会话劫持的内容。
Cookies sent over HTTP are unsecure, those sent over HTTPS are a bit more secure than HTTP, however they can still be stolen since there are a few methods discovered lately to hack SSL. A complete writeup on session hijacking and all of the session hijacking attacks can be found here: http://cleverlogic.net/tutorials/session-hijacking-0. There is also a bit on preventing Session Hijacking.