MS00-035: MS SQL7.0 Service Pack may leave passwords on system (263968) - Nessus

Medium   Plugin ID: 11330

This page contains detailed information about the MS00-035: MS SQL7.0 Service Pack may leave passwords on system (263968) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 11330
Name: MS00-035: MS SQL7.0 Service Pack may leave passwords on system (263968)
Filename: smb_nt_ms00-035.nasl
Vulnerability Published: 2000-05-30
This Plugin Published: 2003-03-09
Last Modification Time: 2018-11-15
Plugin Version: 1.41
Plugin Type: local
Plugin Family: Windows : Microsoft Bulletins
Dependencies: ms_bulletin_checks_possible.nasl, smb_hotfixes.nasl
Required KB Items [?]: SMB/MS_Bulletin_Checks/Possible

Vulnerability Information


Severity: Medium
Vulnerability Published: 2000-05-30
Patch Published: 2000-05-30
CVE [?]: CVE-2000-0402
CPE [?]: cpe:/a:microsoft:sql_server

Synopsis

The remote SQL server is vulnerable to an information disclosure attack.

Description

The installation process of the remote MS SQL server left a file named 'sqlsp.log' on the remote host. This file contains the password assigned to the 'sa' account of the remote database.

An attacker may use this flaw to gain administrative access to the database server.

Solution

Apply the appropriate patches from MS00-035 or upgrade MS SQL.

Public Exploits


Target Network Port(s): 139, 445
Target Asset(s): Host/patch_management_checks
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the MS00-035: MS SQL7.0 Service Pack may leave passwords on system (263968) vulnerability:

  1. Metasploit: exploit/windows/mssql/mssql_payload_sqli
    [Microsoft SQL Server Payload Execution via SQL Injection]
  2. Metasploit: exploit/windows/mssql/mssql_payload
    [Microsoft SQL Server Payload Execution]
  3. Exploit-DB: exploits/windows/remote/16394.rb
    [EDB-16394: Microsoft SQL Server - Payload Execution (via SQL Injection) (Metasploit)]
  4. Exploit-DB: exploits/windows/remote/16395.rb
    [EDB-16395: Microsoft SQL Server - Payload Execution (Metasploit)]
  5. Exploit-DB: exploits/windows/remote/21693.nasl
    [EDB-21693: Microsoft SQL Server 2000 - User Authentication Remote Buffer Overflow]

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:P/I:N/A:N/E:F/RL:OF/RC:C
CVSS Base Score:5.0 (Medium)
Impact Subscore:2.9
Exploitability Subscore:10.0
CVSS Temporal Score:4.1 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:4.1 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:F/RL:O/RC:C
CVSS Base Score:5.3 (Medium)
Impact Subscore:1.4
Exploitability Subscore:3.9
CVSS Temporal Score:4.9 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:4.9 (Medium)

Go back to menu.

Plugin Source


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

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

include("compat.inc");

if (description)
{
  script_id(11330);
  script_version("1.41");
  script_cvs_date("Date: 2018/11/15 20:50:29");

  script_cve_id("CVE-2000-0402");
  script_bugtraq_id(1281);
  script_xref(name:"MSFT", value:"MS00-035");
  script_xref(name:"MSKB", value:"263968");

  script_name(english:"MS00-035: MS SQL7.0 Service Pack may leave passwords on system (263968)");
  script_summary(english:"Reads %temp%\sqlsp.log");

  script_set_attribute(attribute:"synopsis", value:
"The remote SQL server is vulnerable to an information disclosure
attack.");
  script_set_attribute(attribute:"description", value:
"The installation process of the remote MS SQL server left a file named
'sqlsp.log' on the remote host. This file contains the password
assigned to the 'sa' account of the remote database.

An attacker may use this flaw to gain administrative access to the
database server.");
  script_set_attribute(attribute:"see_also", value:"https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2000/ms00-035");
  script_set_attribute(attribute:"solution", value:"Apply the appropriate patches from MS00-035 or upgrade MS SQL.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Microsoft SQL Server Payload Execution via SQL Injection');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2000/05/30");
  script_set_attribute(attribute:"patch_publication_date", value:"2000/05/30");
  script_set_attribute(attribute:"plugin_publication_date", value:"2003/03/09");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:sql_server");
  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:"Windows : Microsoft Bulletins");

  script_dependencies("smb_hotfixes.nasl", "ms_bulletin_checks_possible.nasl");
  script_require_keys("SMB/MS_Bulletin_Checks/Possible");
  script_require_ports(139, 445, 'Host/patch_management_checks');
  exit(0);
}

include("audit.inc");
include("smb_func.inc");
include("smb_hotfixes.inc");
include("smb_hotfixes_fcheck.inc");
include("misc_func.inc");

get_kb_item_or_exit("SMB/MS_Bulletin_Checks/Possible");

bulletin = 'MS00-035';
kb = "263968";

kbs = make_list(kb);
if (get_kb_item("Host/patch_management_checks")) hotfix_check_3rd_party(bulletin:bulletin, kbs:kbs, severity:SECURITY_WARNING);

get_kb_item_or_exit('SMB/WindowsVersion');


common = hotfix_get_systemroot();
if (!common) exit(1, "Can't get system root.");

port = kb_smb_transport();
login  = kb_smb_login();
pass   = kb_smb_password();
domain = kb_smb_domain();

if(! smb_session_init()) audit(AUDIT_FN_FAIL, "smb_session_init");

r = NetUseAdd(login:login, password:pass, domain:domain, share:"IPC$");
if (r != 1)
{
  NetUseDel();
  audit(AUDIT_SHARE_FAIL,"IPC$");
}

hklm = RegConnectRegistry(hkey:HKEY_LOCAL_MACHINE);
if ( isnull(hklm) )
{
  NetUseDel();
  audit(AUDIT_REG_FAIL);
}

key_h = RegOpenKey(handle:hklm, key:"SYSTEM\CurrentControlSet\Control\Session Manager\Environment", mode:MAXIMUM_ALLOWED);
if ( isnull(key_h) )
{
 RegCloseKey(handle:hklm);
 NetUseDel();
 exit(0);
}

value = RegQueryValue(handle:key_h, item:"TEMP");
RegCloseKey(handle:key_h);
RegCloseKey(handle:hklm);
NetUseDel(close:FALSE);

if ( isnull(value) )
{
 NetUseDel();
 exit(1);
}

value[1] = ereg_replace(pattern:"%systemroot%", string:value[1], replace:common, icase:TRUE);
share = ereg_replace(pattern:"^([A-Za-z]):.*", replace:"\1$", string:value[1]);
rootfile =  ereg_replace(pattern:"^[A-Za-z]:(.*)", replace:"\1\sqlsp.log", string:value[1]);


r = NetUseAdd(login:kb_smb_login(), password:kb_smb_password(), domain:kb_smb_domain(), share:share);
if (r != 1)
{
  NetUseDel();
  audit(AUDIT_SHARE_FAIL,share);
}

handle =  CreateFile (file:rootfile, desired_access:GENERIC_READ, file_attributes:FILE_ATTRIBUTE_NORMAL, share_mode:FILE_SHARE_READ, create_disposition:OPEN_EXISTING);

if ( ! isnull(handle) )
{
  CloseFile(handle:handle);
  NetUseDel();

  if (
    defined_func("report_xml_tag") &&
    !isnull(bulletin) &&
    !isnull(kb)
  ) report_xml_tag(tag:bulletin, value:kb);

  hotfix_security_warning();
  set_kb_item(name:"SMB/Missing/"+bulletin, value:TRUE);

  exit(0);
}

NetUseDel();
exit(0, "The host is not affected.");


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

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

Go back to menu.

How to Run


Here is how to run the MS00-035: MS SQL7.0 Service Pack may leave passwords on system (263968) 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 Windows : Microsoft Bulletins plugin family.
  6. On the right side table select MS00-035: MS SQL7.0 Service Pack may leave passwords on system (263968) plugin ID 11330.
  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 smb_nt_ms00-035.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

/opt/nessus/bin/nasl -T - smb_nt_ms00-035.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 smb_nt_ms00-035.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: MSKB | Microsoft Knowledge Base: MSFT | Microsoft Security Bulletin:
  • MS00-035
See also: Similar and related Nessus plugins:
  • 10519 - MS00-067: Telnet Client NTLM Authentication Vulnerability (272743)
  • 10563 - MS00-091: Incomplete TCP/IP Packet Vulnerability (199346)
  • 10492 - MS00-006: Microsoft IIS IDA/IDQ Multiple Vulnerabilities (uncredentialed check)
  • 10564 - Microsoft IIS Phone Book Service /pbserver/pbserver.dll Remote Overflow

Version


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

Go back to menu.