1、 查看SQL SERVER中的所有用户:(SQL 2000或2005都可用)

Select * from sysusers;

SQL Server 安全风险分析_运维开发

2、 查看SQL SERVER服务器中所有空密码的用户:(2000/2005通用)

select name,password from syslogins where password is null;

SQL Server 安全风险分析_数据库_02

3、 设置mssql只能windows本地账户登陆:

SQL Server 安全风险分析_sql_03

SQL Server 安全风险分析_网络安全_04

4、 设置数据库日志审核:

右击数据库,打开数据库属性,选择安全性,将安全性中的审计级别调成全部。SQL Server 安全风险分析_数据库_05

SQL Server 安全风险分析_系统架构_06

5、 进行网络协议加密:

SQL Server 安全风险分析_数据库_07

6、 查看数据库信息和版本:


Select @@version;


7、 判断当前数据库是否存在xp_cmdshell;


select count(*) from master.dbo.sysobjects where xtype=‘x’ and
name=‘xp_cmdshell’;


如果返回结果非0,代表该服务器商存在xp_cmdshell;

8、 启用服务器上的xp_cmdshell:


Exec sp_configure ‘show advanced options’,1;
Reconfigure;
Exec sp_configure ‘xp_cmdshell’,1;
Reconfigure;


9、 使用xp_cmdshell进行过程存储的命令执行:SQL Server 安全风险分析_数据库_08

10、 添加xp_cmdshell:

SQL Server 安全风险分析_数据库_09