某些黑客可以从用户那里窃取 Web 浏览器 cookie 并使用该名称登录网站吗? [英] Can some hacker steal a web browser cookie from a user and login with that name on a web site?

查看:39
本文介绍了某些黑客可以从用户那里窃取 Web 浏览器 cookie 并使用该名称登录网站吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读这个问题,不同的用户获得相同的 cookie - .ASPXANONYMOUS 中的值

并寻找解决方案,我开始思考,是否有人可以通过某种方式真正窃取 cookie,然后将其放在他的浏览器上并以管理员身份登录.

and search for a solution, I start thinking, if it is possible for some one to really steal the cookie with some way, and then place it on his browser and login lets say as administrator.

您知道表单验证如何确保即使cookie被盗,黑客也无法在实际登录中使用它吗?

Do you know how form authentication can ensure that even if the cookie is stolen, the hacker does not get to use it in an actual login?

是否有其他替代的自动防御机制?

Is there any other alternative automatic defense mechanism?

推荐答案

是否有可能窃取 cookie 并以管理员身份进行身份验证?

Is it possible to steal a cookie and authenticate as an administrator?

是的,这是可能的,如果 Forms Auth cookie 未加密,则有人可以破解他们的 cookie 以授予他们更高的权限,或者如果不需要 SSL,则复制其他人的 cookie.但是,您可以采取一些措施来降低这些风险:

Yes it is possible, if the Forms Auth cookie is not encrypted, someone could hack their cookie to give them elevated privileges or if SSL is not require, copy someone another person's cookie. However, there are steps you can take to mitigate these risks:

在 system.web/authentication/forms 元素上:

On the system.web/authentication/forms element:

  1. requireSSL=true.这要求 cookie 只能通过 SSL 传输
  2. slidingExpiration=false.如果为 true,则可以重新激活过期的票证.
  3. 无饼干=假.不要在您试图强制执行安全性的环境中使用无 cookie 会话.
  4. 启用CrossAppRedirects=false.如果为 false,则不允许跨应用处理 Cookie.
  5. 保护=全部.使用 machine.config 或 web.config 中指定的机器密钥对 Forms Auth cookie 进行加密和散列.此功能会阻止某人破解他们自己的 cookie,因为此设置会告诉系统生成 cookie 的签名,并且在每次身份验证请求时,将签名与传递的 cookie 进行比较.

如果您愿意,您可以通过在 Session 中放入某种身份验证信息来添加一些保护,例如用户名的哈希值(绝不是纯文本的用户名或密码).这将要求攻击者窃取会话 cookie 和表单身份验证 cookie.

If you so wanted, you could add a small bit of protection by putting some sort of authentication information in Session such as a hash of the user's username (Never the username in plain text nor their password). This would require the attacker to steal both the Session cookie and the Forms Auth cookie.

这篇关于某些黑客可以从用户那里窃取 Web 浏览器 cookie 并使用该名称登录网站吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆