sql-labs

做题步骤

  1. 判断是否字符型还是数字型
  2. 字段数
  3. 显示位
  4. 获取当前数据库
  5. 获取当前表名
  6. 获取所有字段
  7. 获取数据

less-1

  1. 判读是否是字符型还是数字型(猜闭合)

    image-20231226100831546

    image-20231226101205075

    可以看出来,这个是字符型

  2. 看字段数

    使用order by

    image-20231226101307234

  3. 判读回显位

    1
    select 1,2,3 ....

    最好还是和查询到的字段数相等

    image-20231226101538793

  4. 获取当前数据库

    1
    union select 1,database(),version()

    image-20231226101715713

  5. 查找需要的表名

    1
    union select 1,group_concat(table_name),3 from information_schema.tables where table_schema="security"

    注意这个地方是 table_schema

    也就是说,如果我们要更具某一个数据库找到他的表名,我们使用table_schema来限定数据库的名字

    image-20231226102521173

  6. 爆破字段名

    image-20231226102808283

  7. 找到需要的进行查询

    image-20231226102954790

less-2

  1. 判断什么类型

    image-20231226103536181

    image-20231226103550574

  2. 判断字段数

    image-20231226103810348

  3. 判断显示位

    http://127.0.0.1/sqlilabs/Less-2/?id=-1 union select 1,2,3 –+

  4. 判断数据库名

    image-20231226104036025

  5. 测表名

    image-20231226104218622

  6. 查字段名

    image-20231226104358065

  7. 查具体的信息

    image-20231226104604471

less-3

  1. 判断是什么类型

    ?id=1’

    出现了错误,然后看报错

    提示添加)

    image-20231226194535270

    image-20231226194741537

    image-20231226194757295

  2. 查询字段

  3. 查询显示位

  4. 查数据库名

  5. 查表名

  6. 查具体信息

less-5

  1. 判断是什么类型

    image-20240109200033028

  2. 开始爆破数据库

    image-20240109202818453

    http://127.0.0.1/sqlilabs/Less-5/?id=1‘ and updatexml(0x7e,concat(‘‘,(select database()),’‘),0x7e) %23

  3. 爆破表名

    image-20240109203052697

  4. 爆破字段

    image-20240109203209883

  5. 然后根据具体获取具体的信息

less-8

直接上sql-map

image-20240109203951911

可以发现他已经将表名和字段已经爆破出来了

image-20240109204132525

image-20240109204424593

Less-9

这关是时间盲注

image-20240109205642884

停顿了5s

image-20240109205901001

less-11

image-20240109210345014

用户名存在普通的联合注入


sql-labs
https://tsy244.github.io/2023/12/26/靶场记录/sql-labs/
Author
August Rosenberg
Posted on
December 26, 2023
Licensed under