当前位置: 首页 > 图文教程 > 数据库 > MSSQL > SQL Server SA权限总结经典技术

MSSQL
在SQL Server 2005数据库中更改数据架构
建立适当的索引是实现查询优化的首要前提
巧用一条SQL 实现其它进制到十进制转换
处理SQL Server 2000的命名实例和多实例
解析:怎样掌握SQL Server中的数据查询
教你轻松掌握常用的子句、关键词和函数
如何获取SQL Server数据库元数据的方法
分析SQL Server中数据库的快照工作原理
汇总数据库备份 还原 压缩与数据库转移的方法
完全讲解 使用MSCS建立SQL Server集群
SQL Server 2005 内置工具建审查系统
在SQL Server计算机上运行病毒扫描软件
教你如何升级SQL Server数据库系统
SQL Server中处理空值时涉及的三问题
教你为SQL Server数据库构造安全门
在SQL Server中编写通用数据访问方法
针对SQL Server中业务规则链接的分析
运行SQL Server的计算机间移动数据库
怎样在不同版本SQL Server中存储数据
认识那些被忽略的SQL Server注入技巧

MSSQL 中的 SQL Server SA权限总结经典技术


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 148 ::
收藏到网摘: n/a

前提需要工具:SQL Query Analyzer和SqlExec Sunx Version   
  第一部分:  
  有关去掉xp_cmdshell来保护系统的分析总结:
  首先知道一下语句:
  1.去掉xp_cmdshell扩展过程的方法是使用如下语句:
  if exists (select * from dbo.sysobjects where id=object_id(N'[dbo].[xpcmdshell]') and OBJECTPROPERTY(id,N'IsExtendedProc')=1)exec sp_dropextendedproc N'[dbo].[xp_cmdshell]'
  2.添加xp_cmdshell扩展过程的方法是使用如下语句:
  sp_addextendedproc xp_cmdshell,@dllname='xplog70.dll'
  现在看看现象:
  我们在取得SA权限后远程用Sqlexec执行cmd命令,出现提示SQL_ERROR,那么很可能是去掉了xp_cmdshell。
  
  现在来看看被去掉xp_cmdshell后恢复的两种方法:
  
  方法一、使用SQL Query Analyzer连接对方后直接写入,挺方便sp_addextendedproc xp_cmdshell,@dllname='xplog70.dll'方法二、使用SqlExec Sunx Version首先在SqlExec Sunx Version的Format选项里填上%s,在CMD选项里输入sp_addextendedproc 'xp_cmdshell','xpsql70.dll'或者对Sql2000情况下使用sp_addextendedproc 'xp_cmdshell','xplog70.dll'另外使用SqlExec Sunx Version来去除xp_cmdshell的方法和加的时候选择条件一样,然后输入sp_dropextendedproc 'xp_cmdshell'就可以了
  
  第二部分:
  
  假如对方已经把xplog70.dll删除或者改了名,我们来用下面的方法继续我们的hack任务:
  当出现如下现象暗示代表很有可能是xplog70.dll删除或者改了名。
  在查询分析器中写入sp_addextendedproc xp_cmdshell,@dllname='xplog70.dll'提示数据库中已存在名为'xp_cmdshell'的对象。