hackbar做sqllab闯关题目

(1)第一关。在其后面加上index.php?id=1

hackbar做sqllab闯关题目

(2)然后在1后面加上'查看返回信息:

hackbar做sqllab闯关题目

从上图的返回信息中是可以得知存在注入的,而且从 use near ''1'' LIMIT 0,1' at line 1中可以猜测出后台在处理请求时把数字转化成了字符处理。

(3)从UNION BASED功能中选取注入语句,首先得出列数首先选择语句:

hackbar做sqllab闯关题目

查看其返回信息:

hackbar做sqllab闯关题目

没有闭合,使用#(并进行url转码)进行闭合操作。

hackbar做sqllab闯关题目

返回信息提示没有第4行,也就是说存在1,2,3行。

(4)建立查询语句union:

hackbar做sqllab闯关题目

输入3,并使其报错。

hackbar做sqllab闯关题目

(5)得出当前用户,当前数据库和版本

hackbar做sqllab闯关题目

hackbar做sqllab闯关题目

由上图可以得知当前用户为[email protected] 数据库是security,版本号是:5.6.24

(6)已经知道了当前数据库,便继续爆出该数据库下的表

hackbar做sqllab闯关题目

hackbar做sqllab闯关题目

(7)现在已经得出security下的所有表,接下来按照套路对users表爆出其字段

hackbar做sqllab闯关题目

(8)接下来爆出具体数据

hackbar做sqllab闯关题目


hackbar做sqllab闯关题目

至此已经完成