当前位置:网站首页>updatexml, extractvalue and floor error injection principle
updatexml, extractvalue and floor error injection principle
2022-07-29 20:02:00 【Happy star people】
updatexml
updatexml是SQL语法的一个函数:UPDATEXML(XML_document, XPath_string, new_value)
参数:
1: XML_document是String格式,为XML文档对象的名称,文中为Doc
2:XPath_string (Xpath格式的字符串) ,用于匹配第一个参数中的部分内容.(就像使用正则表达式匹配一个文本的特定内容一样)
3: new_value,String格式,替换查找到的符合条件的数据.
在这里,我们利用updatexml函数的报错机制进行注入,原理就是When the format of the second parameter sumsXpath的格式不符的时候,就会产生报错,我们可以将我们的payload构造到第二个参数中,让其随着报错信息展示到页面上.
and updatexml(1, (concat('#',(payload))), 1) #
or updatexml(1, (concat('#',(payload))), 1) #
具体使用and 还是 or就要根据前面的一条语句执行是否成功来判断
extractvalue
extractvalue(xml_frag, xpath_expr)
从一个使用xpath语法的xmlExtract a value from a string.xml_frag:xml文档对象的名称,是一个string类型.xpath_expr:使用xpathA path in syntax format.
SQLError-injected applications:当使用extractvalue(xml_frag, xpath_expr)函数时,若xpath_expr参数不符合xpath格式,就会报错.
而~符号(ascii编码值:0x7e)是不存在xpath格式中的, 所以一旦在xpath_expr参数中使用~符号,就会产生xpath syntax error (xpath语法错误),By using this method, the purpose of error injection can be achieved.
and extractvalue(1, (concat(0x7e,(payload)))) #
or extractvalue(1,concat(0x3a,(select database()),0x3a)) #
floor
当floor(), count(), group bymeet togetherfrom一个3row above the table,A duplicate primary key error will be generated,At this point, you construct the information you want to display into the primary key,mysqlThis information will be displayed to you on the page by reporting an error.
select count(*),concat((payload), floor(rand(0)*2)) as a from information_schema.tables group by a
(select 1 from (select concat(0x7e,database(),0x7e,floor(rand(0)*2)) x,count(*) from users GROUP BY x) b)
floor() : 向下取整.
count() : Often used to count the number of rows
group by: 分组
rand() : 产生一个0-1的随机浮点数
rand(0): 0为随机数种子,0Can be replaced with any integer
floor(rand(0)*2)可能为0也可能为1.floor(rand(0)*2)The return result is fixed,返回一个序列0110110011101
The data in the table used in the query in the injection statement must be>=3条select count(*) from users group by floor(rand(0)*2);
When the data in the table is less than 3,The query result is correct
https://blog.csdn.net/weixin_43901998/article/details/105227678
https://blog.csdn.net/weixin_54894046/article/details/124940161
https://blog.csdn.net/weixin_46634468/article/details/120692475
边栏推荐
- What should I do if the Win11 network is unstable?The solution to frequent disconnection of wifi connection in Win11
- Win11任务栏太宽了怎么变窄?Win11任务栏宽度调整方法
- Test push | Ali Fliggy, Baidu, 58 (recruitment), Zhihu, Huanxin Network, Baiguoyuan, Ali (Lazada), Shenzhicheng, Yuanrong Qixing are recruiting
- 算力顶天地,存力纳乾坤:国家超级计算济南中心的一体两面
- 2022/7/27
- exdark数据集转yolo格式(仅供参考)
- 支持向量机SVM
- Low code of the trilogy
- 牛客网刷题记录 || 指针
- 第21章 内存管理
猜你喜欢

碎片化时间真的适合学习吗?

Postgresql-xl全局快照代码走读与GTM原理(支线1)

7 lines of code crashed station B for 3 hours, but because of "a tricky 0"

成都 | 转行软件测试,从零收入到月薪过万,人生迎来新转折...

第02章 MySQL的数据目录【1.MySQL架构篇】【MySQL高级】

关于高考选志愿
![Chapter 01 Installation and use of MySQL under Linux [1. MySQL Architecture] [MySQL Advanced]](/img/f6/8c513ab62c8d3259c9c8ef13887276.png)
Chapter 01 Installation and use of MySQL under Linux [1. MySQL Architecture] [MySQL Advanced]

不堆概念、换个角度聊多线程并发编程

String类型_static成员_动态内存分配_拷贝构造函数_const关键字_友元函数与友元类

第01章 Linux下MySQL的安装与使用【1.MySQL架构篇】【MySQL高级】
随机推荐
开源数据标注工具
无人驾驶技术有什么优点,人工驾驶的优缺点英文
项目分析(三个小众的嵌入式产品)
2.1寸旋钮屏结合6.86寸串口屏助力集成灶智能升级|启明智显
Small programs use npm packages
效率技巧│十分钟学会 xmind 思维导图的使用
Gesture password unlock WeChat applet project source code
答对这3个面试问题,薪资直涨20K
C#_OpenCV使用相机
第21章 内存管理
一线大厂软件测试面试题及答案解析,2022最强版...
真·摸鱼带师:程序员小哥每天工作10分钟年薪57万,我破防了...
Chapter 01 Installation and use of MySQL under Linux [1. MySQL Architecture] [MySQL Advanced]
大中型网站列表页翻页过多怎么优化?
R语言时间序列数据可视化: 使用plot函数可视化单序列时间序列数据、多序列时间序列数据并指定不同时间序列的线条类型(lty)
FP6601QS6 SOT-23-6 USB专用充电端口控制器 QC2.0/3.0快充协议IC
高速无源链路阻抗匹配套路
Win11网络不稳定怎么办?Win11连接wifi频繁掉线的解决方法
PIL库和opencv库
经典SQL语句大全