http://blog.chinaunix.net/uid-27070210-id-3255407.html

乍一看,好像和以前 css history hack 差不多,其实原理还是不一样的。
浏览器的 history 对象是比较特别的一个东西,与浏览历史不同,这个对象不是保存在本地的那个,也没那么多内容。
history对象是浏览器在生命周期中,比如tab页,访问的历史记录,用于提供"前进"、"后退"等操作。
在firebug里可以看到这个对象有以下几个属性:

history 对象里保存的url是一个list,这个list出于同源策略(SOP)的原因是不可读的。
但是 history.length 却是可读的,XSHM就是利用 history.length 可读,同时一些url发生变化时对length长度改变的特点来完成信息刺探的。
具体如下:
Browser History  is a global  list of pages  that have been visited using a browser tab.
By pressing the back and forward buttons of a browser, a user jumps through her browser
history.  If  a  page  contains  IFRAME,  any  location  changes  inside  IFRAME  are  also
recorded  in  the browser's  history. Consequently, opening  the  same URL multiple  times
will insert only one entry into the history list.  If a user opens Page A and this page uses
the HTTP Redirect directive to open Page B, only Page B will be stored in the browser‟s
history.

注意最后加粗的这句,如果发生了重定向,那么history对象只会增加重定向后指向的最终页面相同的页面不会重复进入history对象的list

利用这个特性,就可以实施许多跨域的刺探了
Algorithm:
1.  Create IFRAME with src=Page B
2.  Remember the current value of history.length 
3.  Change src of IFRAME to Page A
4.  If the value of history.length is the same– then the CONDITION is TRUE
比如作者的例子,检测用户是否有登录:

利用类似的方法,作者举了很多实际应用的例子,在某些情况下,配合其他漏洞使用,还是有一定作用的。

关于XSHM(Cross-Site History Manipulation)的更多相关文章

  1. 代码漏洞扫描描述Cross Site History Manipulation解决办法[dongcoder.com]

    代码漏洞扫描 漏洞描述:Cross Site History Manipulation 简要描述:产品的行为差异或发送不同的反应,在某种程度上暴露了与安全性相关的产品状态,例如特定的操作是否成功.可能 ...

  2. XSS (Cross Site Scripting) Prevention Cheat Sheet(XSS防护检查单)

    本文是 XSS防御检查单的翻译版本 https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sh ...

  3. WebGoat学习——跨站请求伪造(Cross Site Request Forgery (CSRF))

    跨站请求伪造(Cross Site Request Forgery (CSRF)) 跨站请求伪造(Cross Site Request Forgery (CSRF))也被称为:one click at ...

  4. WebGoat学习——跨站脚本攻击(Cross‐Site Scripting (XSS))

    跨站脚本攻击(Cross‐Site Scripting (XSS)) XSS(Cross Site Script)跨站脚本攻击.是指攻击者向被攻击Web 页面里插入恶意html代码,当用户浏览该页之时 ...

  5. Cross Site Request Forgery (CSRF)--spring security -转

    http://docs.spring.io/spring-security/site/docs/3.2.0.CI-SNAPSHOT/reference/html/csrf.html 13. Cross ...

  6. 跨站脚本攻击(Cross‐Site Scripting (XSS))

    跨站脚本攻击(Cross‐Site Scripting (XSS)) 跨站脚本攻击(Cross‐Site Scripting (XSS)) XSS(Cross Site Script)跨站脚本攻击.是 ...

  7. 跨站请求伪造(Cross Site Request Forgery (CSRF))

    跨站请求伪造(Cross Site Request Forgery (CSRF)) 跨站请求伪造(Cross Site Request Forgery (CSRF)) 跨站请求伪造(Cross Sit ...

  8. Healwire Online Pharmacy 3.0 Cross Site Request Forgery / Cross Site Scripting

    Healwire Online Pharmacy version 3.0 suffers from cross site request forgery and cross site scriptin ...

  9. DVWA 黑客攻防演练(十四)CSRF 攻击 Cross Site Request Forgery

    这么多攻击中,CSRF 攻击,全称是 Cross Site Request Forgery,翻译过来是跨站请求伪造可谓是最防不胜防之一.比如删除一篇文章,添加一笔钱之类,如果开发者是没有考虑到会被 C ...

随机推荐

  1. 谈谈MySQL中的降序索引 order by id DESC / ASC

    今天这篇主要讲order by 语句中的多个字段asc desc的问题.mysql5中,索引存储的排序方式是ASC的,没有DESC的索引.现在能够理解为啥order by 默认是按照ASC来排序的了吧 ...

  2. 028.Zabbix常见故障

    一 中文乱码处理 1.1 现象 1.2 解决方法 将任意一中文字体上传至/usr/share/zabbix/fonts,如微软雅黑. vi /usr/share/zabbix/include/defi ...

  3. 前端Hack之XSS攻击个人学习笔记

    简单概述 **        此篇系本人两周来学习XSS的一份个人总结,实质上应该是一份笔记,方便自己日后重新回来复习,文中涉及到的文章我都会在末尾尽可能地添加上,此次总结是我在学习过程中所写,如有任 ...

  4. js冲刺一下

    js中__proto__和prototype的区别和关系 1.对象有属性__proto__,指向该对象的构造函数的原型对象. 2.方法除了有属性__proto__,还有属性prototype,prot ...

  5. SpringMVC框架02——SpringMVC的Controller详解

    1.基于注解的控制器 1.1.@Controller 注解类型 在SpringMVC中使用org.springframework.stereotype.Controller注解类型声明某类的实例是一个 ...

  6. 使用ApiPost模拟发送get、post、delete、put等http请求

    现在的模拟发送请求插件很多比如老外的postman等,但亲测咱们国内的 ApiPost 更好用一些,因为它不仅可以模拟发送get.post.delete.put请求,还可以导出文档,支持团队协作也是它 ...

  7. Android-Binder(一)

    Android-Binder(一) 学习自 <Android开发艺术探索> https://www.jianshu.com/p/bdef9e3178c9 https://blog.csdn ...

  8. UEditor 的使用

    UEditor 的使用 一.UEditor 的使用 官方网站:http://ueditor.baidu.com/website/ 下载地址:http://ueditor.baidu.com/websi ...

  9. 实现DIV层内的文字垂直居中(转)

    有时候,为了网页设计的美观,需要把div+css设计的页面里的某些div层里的文字垂直居中,包括多行文字以及单行文字:方法有不少,但真正能实现而代码又简洁的介绍不多,flymorn就为大家介绍几种适用 ...

  10. vbs学习笔记2——创建桌面快捷方式

    脚本 Set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolde ...