xss challenges平台学习

     虽然在很早之前就接触过xss,有一段时间还就着一本书研究过,但是始终没有实感,掌握的也不够系统,所以现在借着这几个平台再学习一遍

     首先来玩一玩xss challenge平台

第一关:http://xss-quiz.int21h.jp/?sid=2a75ff06e0147586b7ceb0fe68ee443b86a6e7b9

  

第二关:http://xss-quiz.int21h.jp/stage2.php?sid=f2d7d60125bdddb208fa757ee5cdae22f6818cd1

     提示:close the current tag and add SCRIPT tag...

    

第三关:http://xss-quiz.int21h.jp/stage-3.php?sid=93de7707279b3a5ae4ce419bfc7c0b1f380a20f6

     提示:The input in text box is properly escaped.

     尝试输入查看源码发现<>被转义了,于是抓包在country的位置插入xss

    

     成功

    

第四关:http://xss-quiz.int21h.jp/stage_4.php?sid=be5650b31307cf0ca1927eae2e4b755d72a4162c

     提示:invisible input field

     尝试在search和country处插入xss,但是查看源码发现都被转义了

     同时,在抓到的包中发现存在参数p3,于是尝试在p3处插入语句,出错了,看了下源码,发现需要闭合

    

     再来一次,成功

    

     在源码中可以看到,改了之后的语句成功的闭合了input

    

第五关:http://xss-quiz.int21h.jp/stage--5.php?sid=92e1efdf82ec7681dc71fd4b5b15470cce1bbe27

     提示:length limited text box

     尝试在search处插入xss,发现存在输入长度的限定,于是想到可以用burp抓包,然后再修改search的值

    

     但同样的这里也需要闭合,修改一下再发一次

    

     成功了

    

    

     还有一种方法,直接改maxlength=15

第六关:http://xss-quiz.int21h.jp/stage-no6.php?sid=10284e95452262a58b13c86015336f4489b6152e

     提示:event handler attributes

     输入"><script>alert(document.domain)</script><发现“<>”被过滤

    

     那么可以用onclick在input中触发:" οnclick=alert(document.domain) id="a

    

     然后点击输入框

    

第七关:http://xss-quiz.int21h.jp/stage07.php?sid=2e71a47a9c7061dcce2b9205b52f4252bd53b443

     提示:nearly the same... but a bit more tricky.

     和上一关一样,这里的"<>都被转义了

     但事实上,用" οnclick=alert(document.domain)还是可以插入,因为前面的"不影响后面的onlick点击事件

     还有一种方法:1 οnmοuseοver=alert(document.domain);

     onmouseover:事件会在鼠标指针移动到指定的元素上时发生。

    

    

第八关:http://xss-quiz.int21h.jp/stage008.php?sid=8407d42ea5cf46b072f5a358abffa591a449a2ba

     提示:the 'javascript' scheme.

     scheme:属性设置或返回用于解释 content 属性的值的格式

     也就是,用js的伪协议,当点击链接的时候弹出窗口

    

    

第九关:http://xss-quiz.int21h.jp/stage_09.php?sid=fcf3010be4306306e9668ee51b9d6916c0b3e129

     提示:UTF-7 XSS

     "<>都被转义了,当然也不能用onmouseover和onclick,根据提示,用UTF-7编码解码工具,将" οnmοusemοve="alert(document.domain)转为UTF-7编码:

     p1=1%2bACI- οnmοuseοver=%2bACI-alert(document.domain)%2bADsAIg- x=%2bACI-&charset=UTF-7

     这个对使用的IE浏览器有一定的限制,大部分浏览器都已经修复了这个漏洞,但IE7还没有

     因为我的实验环境没有IE7,所以这里直接用的另一个简单粗暴的方法:

    

     firebug是很强大的...

第十关:http://xss-quiz.int21h.jp/stage00010.php?sid=718360225fa9356a42c30995f38b5142c3496f6a

     提示:s/domain//g;

     很尴尬,他把domain过滤了

    

     但是可以这样,很常见的方过滤方式:

    

第十一关:http://xss-quiz.int21h.jp/stage11th.php?sid=4a4c328baf358d9bf01befc79228e70d25549025

     提示:s/script/xscript/ig;" and "s/on[a-z]+=/onxxx=/ig;" and "s/style=/stxxx=/ig;

     对script进行了过滤

    

     试试onclick和onmouseover,还是不行

    

     于是想到可以用<a>标签:"><a href="javascript:alert(document.domain);">here</a><"但是,因为对script做了过滤,所以要将script中的某个字符转为unicode编码,或者可以插入&#09;不可见字符

    

第十二关:http://xss-quiz.int21h.jp/stage_no012.php?sid=66a49c46b3d8e490003681f359c7b8b14ba174c8

     提示:s/[\x00-\x20\&lt;\&gt;\"\']//g;

     <>"被过滤,根据提示可以知道x00-x20&lt;&gt;,"'都被过滤了,但是`还没被过滤,于是可以用`加上onclick,onmouseover,onfocus均可,还有一个前提是IE,只有IE才有这个特性

    

    

第十三关:http://xss-quiz.int21h.jp/stage13_0.php?sid=ea59af045ae260dd938d73d6cbbd1c92a6806e06

     提示:style attribute

     在CSS样式中利用expression实现javascript中的onmouseover或onmouseout事件,同样前提是IE

     aa:expression(οnmοuseοver=function(){alert(document.domain)})

     还有一种:

     background-color:#f00;background:url("javascript:alert(document.domain);");

    

第十四关:http://xss-quiz.int21h.jp/stage-_-14.php?sid=88e5796eaebea97fe2b0cd79df9fbc9edad3ab9e

     提示:s/(url|script|eval|expression)/xxx/ig;

     这里过滤了expression,url,eval,script,但是通过加入注释符可绕过:here:expre/**/ssion(οnmοuseοver=function(){alert(document.domain)})

     或者:here:expre/**/ssion(window.x?0:(alert(document.domain),window.x=1));

    

      还有几种绕过过滤的方法:加\,加\0,将e转码为\0056

第十五关:http://xss-quiz.int21h.jp/stage__15.php?sid=1e785fb96bdb203c00b034203ee574681d1b4403

     提示:document.write();

     被过滤

    

     有几种方过滤的方法:

     第一种:换成16进制编码\\x3cscript\\x3ealert(document.domain);\\x3c/script\\x3e

    

     第二种:换成Unicode编码\\u003cscript\\u003ealert(document.domain);\\u003c/script\\u003e

第十六关:http://xss-quiz.int21h.jp/stage00000016.php?sid=d3e7f2565164c8482f758c4a887073bc36bccc45

     提示:document.write();" and "s/\\x/\\\\x/ig;

     第一种:换成Unicode编码\\u003cscript\\u003ealert(document.domain);\\u003c/script\\u003e

    

     第二种:换成十进制\\74script\\76ealert(document.domain);\\74/script\\76

第十七关:http://xss-quiz.int21h.jp/stage-No17.php?sid=a207c91d7b4cb2634e277df104c853554347e8ca

     提示:multi-byte character

     思路类似于宽字节注入,利用特殊字节吃掉双引号,于是抓包修改p1,p2

     p1=1%A7&p2=+onmouseover%3Dalert%28document.domain%29%3B+%A7

    

第十八关:http://xss-quiz.int21h.jp/stage__No18.php?sid=b23d6719a639f5655a2966a2f5ade6ec86841851

     提示:us-ascii high bit issue

     将每个字符的二进制最高位置为1,然后再转为16进制

     故"><script>alert(document.domain)</scirpt> 就转换为%A2%BE%BCscript%BEalert(document.domain);%BC/script%BE

     但是前提还是用旧的IE版本IE5,6

    

第十九关: http://xss-quiz.int21h.jp/stage_--19.php?sid=8e654fc6c2fe93f2c8bd38fbc6ad6b1588d859c7

     提示:Twitter DomXss at Sep 24, 2010

 

参考文献:

http://blog.csdn.net/nixawk/article/details/28038509

http://www.2cto.com/article/201509/441858.html

http://blog.csdn.net/emaste_r/article/details/16988167

转载于:https://www.cnblogs.com/sherlock17/p/6700430.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值