问题标签 [session-hijacking]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
session-hijacking - 使用 Session_regenerate_id()
为什么总是建议在创建用户会话之前使用session_regenerate_id() 。根据我的理解,一旦创建了用户会话 id,就应该使用 session_regenerate_id(),我们需要重新生成它,以减轻黑客的会话固定攻击。
请推荐!!
php - 在没有 SSL 的情况下防止会话 cookie 劫持
为了防止会话劫持,我尝试根据以下变量为每个用户分配一个特定的 cookie 名称:用户代理和IP 地址。
我使用以下函数来生成包含会话 ID的会话cookie 名称。
这意味着每个访问我的网站的用户都会有一个不同的会话 cookie 名称。它将阻止劫持者使用其他人的 cookie,除非他/她将他/她的用户代理更改为受害者的用户代理;并尝试以某种方式使用受害者的 IP 地址出现在线,例如使用用户的互联网调制解调器、路由器、NAT 等。
让我用一个例子来解释它。因此,如果两个用户使用相同的浏览器并从相同的 IP 地址连接,他们将获得相同的 cookie 名称(假设为 f5e30acc605e938b097dee73c0272470)。
现在,该脚本将在这两个客户端上的名为f5e30acc605e938b097dee73c0272470的 cookie 中查找会话 ID 。在这种情况下,其中一个客户端可以劫持其他客户端的 cookie。相同的 IP、相同的用户代理和相同的 cookie 名称!
这种方法很好,但不是很安全。更改用户代理并不难,如果受害者和劫持者从 Coffenets、公共热点等公共网络连接,他们可能拥有相同的 IP 地址。
拒绝攻击者这样做很重要,特别是如果我们使用“还记得我吗?” 生成持久会话 cookie 的选项。
有人对这个问题有什么建议吗?
正如我所研究的,其中一种解决方案是使用 SSL 和安全 cookie。但是,我正在寻找不使用 SSL 的解决方案。
asp.net - 使用唯一信息保护会话
为了避免用户登录后的会话劫持,我可以在登录过程中依靠哪些信息来验证确实是合法用户。这样拦截会话中继的人就会失效
他们的 IP 地址和浏览器信息是否足够好?
php - suPHP 会话安全性
我试图更好地理解 suPHP。
我显然在 google 上找到了 suPHP 文档,并找到了关于它是什么和做什么的通用答案,但我对它如何帮助会话安全和防止会话劫持感到困惑。
如果有人能为我澄清这一点,我将不胜感激。谷歌没有产生任何好的结果!
php - 防止身份验证中的会话劫持的 PHP 最佳实践
可能重复:
防止会话劫持
我正在为PHP
Web 应用程序编写我的登录和身份验证系统,并寻找防止会话劫持的最佳实践。登录页面集的会话:
然后在每个页面和操作中,我检查以确保会话存在,并且存储在会话中的 IP 地址与 $_SERVER['REMOTE_ADDR'] 中的 IP 地址匹配。
但是,在网上阅读,有些人说仅仅检查 IP 地址是不够的。还需要什么?此外,还有关于使用session_regenerate_id()
. 这对我的代码有何影响?我会session_regenerate_id()
在每一页上调用吗?
谢谢。
php - 会话劫持预防...我的脚本能走多远?额外的预防程序?
当用户登录当前会话时,设置了变量
在我的 common.php 页面(所有 php 页面都需要)中,我使用了以下脚本,每次用户处于活动状态时都会重置一个 15 分钟的计时器,此外还会检查 IP 地址并检查 user_agent,如果它们不匹配的话当他们第一次登录/第一次设置会话时,会话被取消,并且不活动长达 15 分钟,会话也被取消。
...我所做的是防止会话劫持的好方法,而且它是否安全,或者是否足够?如果没有,还能做什么?
php - PHP is allowing old Session ID's to be used without changing them which allows Sessions to be easily Hijacked. How to fix?
On one of my sites, I have ini_set('session.use_trans_sid', 1)
set which allows users with no Cookies to use the site. It does this be keeping track of the Session via the URL.
However, I'm experiencing a serious security issue that is allowing Sessions to be easily hijacked.
Basically, Google is indexing pages with the Session ID it was given at the time of its Crawl since the Googlebot does not use Cookies.
Then, when someone searches for my site and then clicks the search result in Google that includes the old Session URL, that old Session ID now becomes their Session ID (rather than a new one being generated).
So then when that user logs in, their account is logged in using the Session ID indexed all over Google! That means any other users searching for our site and clicking one of the search results in Google gets automatically logged in to that other users account!
Talk about a massive security hole!
How can I fix this? I would have thought that PHP would recognize that a Session ID is no longer valid (or no longer exists) and then generate a new one, but it doesn't seem to be doing that. It seems like if it did do that, it would fix this issue.
Please help!
EDIT:
What is essentially happening here is that PHP is allowing anyone to create their own custom Session ID by simply entering whatever they want for the Session ID parameter in their URL, and PHP will start using that as their Session ID. I can literally make the Session ID = "securityflaw" in the URL and it will literally use that as the Session ID even after logging in! So when someone clicks a link on Google with the Googlebot's old Session ID, PHP is making the users "custom" Session ID be that. Surely something is amiss!
php - 检测到 PHP 会话劫持
我有这个代码:
一切正常。但是每次我登录(每 24 小时一次)时,我都会收到错误消息。用户代理是改变还是什么?
谢谢你的帮助。
session - 会话可以由用户客户端操作吗?
背景故事:我们运营一个拥有数千名用户和少数管理员的网站。其中一些管理员不需要对网站的所有访问权限,因此我想通过授予他们个人权限来限制他们的访问权限。
我的计划是在用户登录时设置一个带有用户权限的会话(如果有的话)。但是,我担心这可能是不安全的操作。
会话可以由用户客户端操作吗?在这种情况下,如果普通用户知道权限名称并为自己设置会话,他们就可以访问管理功能。
我在 Stackoverflow 上找到了一些相关的问题,但他们没有给我足够的关于这个主题的信息。
hibernate - Tomcat 上的 Spring Security/JSF/Hibernate 意外会话劫持?
前几天我发生了一件非常奇怪和尴尬的事情,我无法用语言来描述发生的事情。
我的应用程序在 Tomcat 7 上运行与 JSF 2.1、Hibernate 4、Spring Security 集成的 Spring 3。我通过电话与 C 级别的重要人物通话,我们同时在同一页面上同时在测试环境中。当他的页面出现我的个人帐户详细信息时,他几乎在同一时刻导航到我正在导航的页面。我不相信他,所以我走到他的办公室,果然,他不知何故以我的帐户登录,而他没有密码。
该应用程序将保护患者的健康信息,因此我被要求向 C 级人员提供一份完整的报告,说明所发生的事情,但我不知道这是怎么可能的。我搜索了代码库,一无所获。我试图在多个场合重现确切的场景,但始终无法重现。我什至没有一个我满意的有根据的猜测。
我认为可能对存储在 Tomcat 应用程序上下文实现中的会话进行了一些不安全的线程操作,但如果它不可重现,我无法证明这一点。我还认为,由于 Spring Security 在其他请求和转发之前作为过滤器运行,因此可能其他 servlet 过滤器之一受到干扰。另外两个是我最近添加的 Primefaces 文件上传过滤器和 Omnifaces SEO 过滤器。
Omnifaces 过滤器确实干扰了 Primefaces 文件上传过滤器,我不得不修改它的配置,这样它们两个才能很好地相互配合,所以我仍然觉得这也可能是一种可能性。
Spring Security 是否有任何已知的错误导致类似的问题?Tomcat 是否存在关于从 ApplicationContext 意外提供错误会话状态的已知问题?有没有其他人遇到过类似的问题或对此有一些独特的见解?
编辑:发布后不久,我发现了这个,仅在几天前发布:
会话混合 - apache httpd 与 mod_jk、tomcat、spring security - 提供其他用户的数据
它几乎与我在 Tomcat 前面安装 Apache httpd+mod_jk 插件的设置完全相同,所以我肯定不是疯了 :)
更新:
我能够在没有 mod_jk 或 Apache 的情况下在我的开发环境中重现该问题,因此我可以可靠地将其排除为罪魁祸首。