MS02-061: Microsoft SQL Server Multiple Vulnerabilities (uncredentialed check) - Nessus

Critical   Plugin ID: 11214

This page contains detailed information about the MS02-061: Microsoft SQL Server Multiple Vulnerabilities (uncredentialed check) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 11214
Name: MS02-061: Microsoft SQL Server Multiple Vulnerabilities (uncredentialed check)
Filename: mssql_litchfield_overflows.nasl
Vulnerability Published: 2002-07-24
This Plugin Published: 2003-01-25
Last Modification Time: 2018-11-15
Plugin Version: 1.52
Plugin Type: remote
Plugin Family: Databases
Dependencies: mssql_ping.nasl
Required KB Items [?]: MSSQL/UDP/Ping

Vulnerability Information


Severity: Critical
Vulnerability Published: 2002-07-24
Patch Published: N/A
CVE [?]: CVE-2002-0644, CVE-2002-0645, CVE-2002-0649, CVE-2002-0650, CVE-2002-0721, CVE-2002-1137, CVE-2002-1138, CVE-2002-1145
CPE [?]: cpe:/a:microsoft:data_engine, cpe:/a:microsoft:sql_server
Exploited by Malware: True

Synopsis

The remote database server is affected by multiple buffer overflows.

Description

The remote MS SQL server is affected by several overflows that could be exploited by an attacker to gain SYSTEM access on that host.

Note that a worm (sapphire) is exploiting these vulnerabilities in the wild.

Solution

Microsoft has released patches for SQL Server 7.0 and 2000 as well as Microsoft Data Engine (MSDE) 1.0 and 2000.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the MS02-061: Microsoft SQL Server Multiple Vulnerabilities (uncredentialed check) vulnerability:

  1. Metasploit: exploit/windows/mssql/ms02_039_slammer
    [MS02-039 Microsoft SQL Server Resolution Overflow]
  2. Exploit-DB: exploits/windows/remote/16393.rb
    [EDB-16393: Microsoft SQL Server - Resolution Overflow (MS02-039) (Metasploit)]
  3. GitHub: https://github.com/rewardone/MS02-039-Port
    [CVE-2002-0649]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS V2 Vector [?]: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.7 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.7 (High)

Go back to menu.

Plugin Source


This is the mssql_litchfield_overflows.nasl nessus plugin source code. This script is Copyright (C) 2003-2018 Tenable Network Security, Inc.

#
# (C) Tenable Network Security, Inc.
#

#
# ping code taken from mssql_ping by H D Moore
#
#
# MS02-061 supercedes MS02-020, MS02-038, MS02-039, MS02-043 and MS02-056
#
# BID xref by Erik Anderson <[email protected]>
#
# Other CVEs: CVE-2002-0729, CVE-2002-0650
#

include("compat.inc");

if (description)
{
 script_id(11214);
 script_version("1.52");
 script_cvs_date("Date: 2018/11/15 20:50:21");

 script_cve_id("CVE-2002-1137", "CVE-2002-1138", "CVE-2002-0649", "CVE-2002-0650",
               "CVE-2002-1145", "CVE-2002-0644", "CVE-2002-0645", "CVE-2002-0721");
 script_bugtraq_id(5309, 5310, 5311, 5312, 5481, 5483, 5877, 5980);
 script_xref(name:"MSFT", value:"MS02-061");
 script_xref(name:"MSKB", value:"316333");

 script_name(english:"MS02-061: Microsoft SQL Server Multiple Vulnerabilities (uncredentialed check)");
 script_summary(english:"Microsoft's SQL UDP Info Query");

 script_set_attribute(
  attribute:"synopsis",
  value:"The remote database server is affected by multiple buffer overflows."
 );
 script_set_attribute(attribute:"description", value:
"The remote MS SQL server is affected by several overflows that could
be exploited by an attacker to gain SYSTEM access on that host.

Note that a worm (sapphire) is exploiting these vulnerabilities in the
wild." );
 script_set_attribute(attribute:"see_also", value:"https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2002/ms02-061");
 script_set_attribute(
  attribute:"solution",
  value:
"Microsoft has released patches for SQL Server 7.0 and 2000 as well as
Microsoft Data Engine (MSDE) 1.0 and 2000."
 );
 script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
 script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
 script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
 script_set_attribute(attribute:"exploit_available", value:"true");
 script_set_attribute(attribute:"exploited_by_malware", value:"true");
 script_set_attribute(attribute:"metasploit_name", value:'MS02-039 Microsoft SQL Server Resolution Overflow');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
 script_cwe_id(119);

 script_set_attribute(attribute:"vuln_publication_date", value:"2002/07/24");
 script_set_attribute(attribute:"plugin_publication_date", value:"2003/01/25");

 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:sql_server");
 script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:data_engine");
 script_end_attributes();

 script_category(ACT_GATHER_INFO);
 script_copyright(english:"This script is Copyright (C) 2003-2018 Tenable Network Security, Inc.");
 script_family(english:"Databases");

 script_dependencies("mssql_ping.nasl");
 script_require_keys("MSSQL/UDP/Ping");
 exit(0);
}

#
# The script code starts here
#


function sql_ping()
{
 local_var r, req, soc;

 req = raw_string(0x02);
 if(!get_udp_port_state(1434))exit(0);
 soc = open_sock_udp(1434);


 if(soc)
 {
	send(socket:soc, data:req);
	r  = recv(socket:soc, length:4096);
	close(soc);
	return(r);
 }
}



r = sql_ping();
if(strlen(r) > 0)
 {
  soc = open_sock_udp(1434);
  send(socket:soc, data:raw_string(0x0A));
  r = recv(socket:soc, length:1);
  if(strlen(r) > 0 && ord(r[0]) == 0x0A)security_hole(port:1434, proto:"udp");
 }
exit(0);



The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/mssql_litchfield_overflows.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\mssql_litchfield_overflows.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/mssql_litchfield_overflows.nasl

Go back to menu.

How to Run


Here is how to run the MS02-061: Microsoft SQL Server Multiple Vulnerabilities (uncredentialed check) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Databases plugin family.
  6. On the right side table select MS02-061: Microsoft SQL Server Multiple Vulnerabilities (uncredentialed check) plugin ID 11214.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl mssql_litchfield_overflows.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a mssql_litchfield_overflows.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - mssql_litchfield_overflows.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state mssql_litchfield_overflows.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: MSKB | Microsoft Knowledge Base: MSFT | Microsoft Security Bulletin:
  • MS02-061
CWE | Common Weakness Enumeration:
  • CWE-119 (Weakness) Improper Restriction of Operations within the Bounds of a Memory Buffer
See also: Similar and related Nessus plugins:
  • 10673 - Microsoft SQL Server sa Account Default Blank Password
  • 11067 - Microsoft SQL Server Authentication Function Remote Overflow
  • 10943 - MS02-018: Cumulative Patch for Internet Information Services (327696)
  • 10932 - Microsoft IIS .HTR ISAPI Filter Enabled
  • 11028 - Microsoft IIS .HTR Filter Multiple Overflows (MS02-028)
  • 11161 - Microsoft Data Access Components RDS Data Stub Remote Overflow
  • 19387 - CA BrightStor ARCserve Backup Agent for Windows Long String Overflow
  • 105613 - ADV180002: Microsoft SQL Server January 2018 Security Update (Meltdown) (Spectre)
  • 126631 - Security Updates for Microsoft SQL Server (July 2019)
  • 126630 - Security Updates for Microsoft SQL Server (Uncredentialed Check) (July 2019)
  • 133719 - Security Updates for Microsoft SQL Server (February 2020)
  • 133718 - Security Updates for Microsoft SQL Server (Uncredentialed Check) (February 2020)
  • 145033 - Security Updates for Microsoft SQL Server (January 2021)
  • 25117 - XAMPP ADOdb mssql_connect Remote Buffer Overflow

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file mssql_litchfield_overflows.nasl version 1.52. For more plugins, visit the Nessus Plugin Library.

Go back to menu.