如何通过简单地将 cookie 从机器复制到另一台机器来防止会话劫持? [英] How do I prevent session hijacking by simply copy a cookie from machine to another?

查看:24
本文介绍了如何通过简单地将 cookie 从机器复制到另一台机器来防止会话劫持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数 Web 应用程序使用 cookie 来管理用户的会话,并允许您在浏览器关闭时保持登录状态.

Most Web Applications use cookies to manage the session for a user and allow you to stay logged in even if the browser was closed.

让我们假设我们按照书本做了所有事情来确保 cookie 本身是安全的.

Let's assume we did everything by the book to make sure the cookie itself is safe.

  • 加密内容
  • 仅设置 http
  • 设置安全
  • ssl 用于连接
  • 我们会检查 cookie 的内容是否被篡改

是否可以防止对机器有物理访问权限的人复制 cookie 并在另一台机器上重复使用,从而窃取会话?

Is it possible to prevent someone with physical access to the machine to copy the cookie and reuse it on another machine and thus stealing the session?

推荐答案

这种风险是使用 cookie 对会话进行身份验证所固有的:cookie 是不记名令牌,任何可以出示 cookie 的人都已通过身份验证.

This risk is inherent in using cookies to authenticate sessions: the cookie is a bearer token, anyone who can present the cookie is authenticated.

这就是为什么您会看到更多保护措施,例如:

This is why you see further protections such as:

  • 在一定时间或一段时间不活动后自动退出;
  • 设备指纹识别
  • 要求对关键操作(例如进行银行转帐或更改密码)重新进行身份验证.

这篇关于如何通过简单地将 cookie 从机器复制到另一台机器来防止会话劫持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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