当前位置: 首页 > 图文教程 > 数据库 > MSSQL > SQL Server下几个危险的扩展存储过程

MSSQL
Microsoft SQLServer的版本区别及选择
在SQL Server数据库中为标识(IDENTITY)列插入显式值
访问和更改关系数据,使用MSSQL外联接
一个查看MSSQLServer数据库空间使用情况的存储过程 SpaceUsed
SQL语句去掉重复记录,获取重复记录
复习一下sql server的差异备份
SQL中object_id函数的用法
SQL Server日期计算
找回SQL企业管理器里的SQL连接的密码的方法
mssql数据库系统崩溃后的一般处理步骤与方法
海量数据库的查询优化及分页算法方案
SQL Server连接中三个常见的错误分析
在程序中压缩sql server2000的数据库备份文件的代码
MS SQL SERVER 数据库日志压缩方法与代码
如何远程连接SQL Server数据库的图文教程
复制SqlServer数据库的方法
搜索sql语句
sql中返回参数的值
sql中生成查询的模糊匹配字符串
将Session值储存于SQL Server中

MSSQL 中的 SQL Server下几个危险的扩展存储过程


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

MSSQL数据库存在几个危险的扩展存储过程,默认Public组可执行权限,SQL注入者可利用此读取文件目录及用户组,并可通过先写入数据库然后导出为文件的方法往服务器写入危险脚本进一步提权,或直接使用某些存储过程执行命令,如xp_cmdshell。 这些存储过程如下:
sp_makewebtask
xp_cmdshell
xp_dirtree
xp_fileexist
xp_terminate_process
sp_oamethod
sp_oacreate
xp_regaddmultistring
xp_regdeletekey
xp_regdeletevalue
xp_regenumkeys
xp_regenumvalues
sp_add_job
sp_addtask
xp_regread
xp_regwrite
xp_readwebtask
xp_makewebtask
xp_regremovemultistring
对应措施:删除上述存储过程或可执行文件或修改存储过程相应用户组可执行权限,删除上述存储过程对应脚本为:
drop PROCEDURE sp_makewebtask
exec master..sp_dropextendedproc xp_cmdshell
exec master..sp_dropextendedproc xp_dirtree
exec master..sp_dropextendedproc xp_fileexist
exec master..sp_dropextendedproc xp_terminate_process
exec master..sp_dropextendedproc sp_oamethod
exec master..sp_dropextendedproc sp_oacreate
exec master..sp_dropextendedproc xp_regaddmultistring
exec master..sp_dropextendedproc xp_regdeletekey
exec master..sp_dropextendedproc xp_regdeletevalue
exec master..sp_dropextendedproc xp_regenumkeys
exec master..sp_dropextendedproc xp_regenumvalues
exec master..sp_dropextendedproc sp_add_job
exec master..sp_dropextendedproc sp_addtask
exec master..sp_dropextendedproc xp_regread
exec master..sp_dropextendedproc xp_regwrite
exec master..sp_dropextendedproc xp_readwebtask
exec master..sp_dropextendedproc xp_makewebtask
exec master..sp_dropextendedproc xp_regremovemultistring

举例:
exec xp_dirtree 'C:' 1,1