`
holdbelief
  • 浏览: 696965 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

关于Session Fixation

阅读更多

  前两天我转了篇文章到pst的邮件列表,是关于在struts 2框架下重新生成session的,引起了一些讨论,我觉得有必要在这里提醒下程序员们,可能他们早就遗忘了这种威胁了。
  JSESSIONID Regeneration in Struts 2
  实际上这就是一种针对Session Fixation 的防范。
  Session Fixation 翻译过来就是 “Session 完成攻击”,以前的老的应用里可能比较常见这种问题,但是随着现在web应用越来越复杂,这种问题已经很少了。
  先理解这个攻击,打个比方:
  1. 你花钱买了一辆车
  2. 你把车钥匙复制了一把
  3. 你把这辆车卖给了一个冤大头
  4. 冤大头同学花钱买了辆2手车,结果在某天你趁他不在,用事先复制好的钥匙把车开走了!

  这个过程就是一个 Session Fixation 的过程,车钥匙就是 Session ID
  这类问题的本质在于:WEB应用在认证后没有改写或者更新session,从而导致了认证前的session还能使用。
  如果攻击者事先能够获知该session ID,则可以欺骗用户使用该session ID进行认证,认证后,由于session ID不变,但是该session变成了一个认证后的session,从而攻击者可以直接使用该session ID以用户身份通过系统的认证。
  在Web环境里,用户浏览页面时服务器会产生一个session,然后session ID会放在客户端,比如在浏览器URL里,或者是cookie里。用户持有这个session ID,服务器就可以找到他的session。用户输入用户名和密码后,系统对该session进行认证。认证成功,该session就是一个认证后的session,服务器就知道该用户认证过了,用户访问认证页面时就不再需要每次输入用户名和密码了。
  比如lqqm论坛,就是把session ID放在url里



 
  常见的利用Session Fixation的方法一般是发送一个link到邮件里,诱骗用户点击后登录,使得该session通过认证,比如:
  http://www.fvck.com/auth?session=xxxxxxx
  要对抗这种攻击,很简单,就是认证后重新生成一个session就可以了,甚至是增改当前session都能起到这个目的。
  像lqqm论坛,在登录后马上就把session重写了。tomcat等也是如此。
  而现在大部分的网站、论坛等复杂的WEB应用,一般是把session ID放在cookie中,而用户登录后,cookie里一般会多很多东西,这些多出来的东西也可以保证用户不受sesssion fixation攻击的影响。
  不过,session fixation攻击作为一种漏洞类型,不仅仅局限于用户登录的部分,只要是任何需要“认证”的地方,都需要考虑到这种威胁。
  • 大小: 33.5 KB
分享到:
评论

相关推荐

    Session Fixation Test:安全会话固定测试-开源

    安全会话固定测试是一个用于通过注入cookie来验证会话被盗的系统,可让您控制并提高其网站的安全性。

    J2EE的13种核心技术.pdf

    J2EE的13种核心技术,很是用的,初步入门级别

    经典的PHP网站安全防御文章

    8、Session 固定攻击(Session Fixation) 9、HTTP响应拆分攻击(HTTP Response Splitting) 10、文件上传漏洞(File Upload Attack) 11、目录穿越漏洞(Directory Traversal) 12、远程文件包含攻击(Remote Inclusion)...

    PHP漏洞全解

    8、Session固定攻击(SessionFixation) 9、HTTP响应拆分攻击(HTTPResponseSplitting) 10、文件上传漏洞(FileUploadAttack) 11、目录穿越漏洞(DirectoryTraversal) 12、远程文件包含攻击(RemoteInclusion) 13、动态...

    php漏洞大全

     8.Session 固定攻击(Session Fixation)  9.HTTP响应拆分攻击(HTTP Response Splitting)  10.文件上传漏洞(File Upload Attack)  11.目录穿越漏洞(Directory Traversal)  12.远程文件包含攻击(Remote Inclusion...

    TelegramSessionFixation-:电报桌面中的会话修复错误

    归功于 )电报用户名: : ( ) 如果看到tdata,请不要登录电报,也许您尝试为其他人制作有效令牌:) #根据我们对( 或 )的研究,发现了一个Session Fixation错误,该错误可能导致帐户被完全劫持,以及绕过两步验证...

    保安图书馆的Vert。x 3: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT…- pac4j / vertx-pac4j

    The vertx-pac4j project is an easy and powerful security library for Vert.x 3 ... but also advanced features like session fixation and CSRF protection.It's based on Java 8, Vert.x 3.9 and on the v4. It

    针对JEE的安全库:OAuth, CAS, SAML, OpenID Connect, LDAP, JWT…- pac4j / jee-pac4j

    but also logout and advanced features like session fixation and CSRF protection.It's based on Java 11, JavaEE 8 and on the v5. It's available under the Apache 2 license.A represents an authentication...

    Securing PHP Web Applications.pdf

    Session Fixation 130 Session Hijacking 131 Session Poisoning 133 Patching the Application to Secure the Session 133 Wrapping It Up 136 Chapter 10 Cross-Site Scripting 137 What Is XSS? 137 Reflected ...

    Spring Security 中文教程.pdf

    session-fixation-protection B.1.9. <concurrent-control> 元素 B.1.9.1. max-sessions 属性 B.1.9.2. expired-url 属性 B.1.9.3. error-if-maximum-exceeded 属性 B.1.9.4. session-registry-alias 和...

    SpringSecurity 3.0.1.RELEASE.CHM

    session-fixation-protection B.1.9. 元素 B.1.9.1. max-sessions属性 B.1.9.2. expired-url属性 B.1.9.3. error-if-maximum-exceeded属性 B.1.9.4. session-registry-alias和session-registry-ref属性 B....

    Spring Security-3.0.1中文官方文档(翻译版)

    session-fixation-protection B.1.9. <concurrent-control> 元素 B.1.9.1. max-sessions 属性 B.1.9.2. expired-url 属性 B.1.9.3. error-if-maximum-exceeded 属性 B.1.9.4. session-registry-alias ...

    hacker101:Hacker101.com的源代码-免费的在线Web和移动安全类

    黑客101 是用于网络安全的免费类。 无论您是对漏洞赏金感兴趣的程序员还是经验丰富的安全专家,Hacker101都可以教您一些知识。 入门 先决条件 Ruby意见建议:使用 bundler 如果需要,运行gem install bundler ...

Global site tag (gtag.js) - Google Analytics