MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote check) - Nessus

Critical   Plugin ID: 48405

This page contains detailed information about the MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote check) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 48405
Name: MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote check)
Filename: smb_pool_overflow.nasl
Vulnerability Published: 2010-08-10
This Plugin Published: 2010-08-23
Last Modification Time: 2018-11-15
Plugin Version: 1.19
Plugin Type: remote
Plugin Family: Windows
Dependencies: samba_detect.nasl, smb_accessible_shares.nasl
Required KB Items [?]: SMB/accessible_shares/1
Excluded KB Items: SMB/not_windows

Vulnerability Information


Severity: Critical
Vulnerability Published: 2010-08-10
Patch Published: 2010-08-10
CVE [?]: CVE-2010-2550, CVE-2010-2551, CVE-2010-2552
CPE [?]: cpe:/o:microsoft:windows

Synopsis

It is possible to execute arbitrary code on the remote Windows host due to flaws in its SMB implementation.

Description

The remote host is affected by several vulnerabilities in the SMB server that may allow an attacker to execute arbitrary code or perform a denial of service against the remote host. These vulnerabilities depend on access to a shared drive, but do not necessarily require credentials.

Solution

Microsoft has released a set of patches for Windows XP, Vista, 2008, 7, and 2008 R2.

Public Exploits


Target Network Port(s): 139, 445
Target Asset(s): N/A
Exploit Available: True (Exploit-DB, GitHub, Core Impact)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote check) vulnerability:

  1. Exploit-DB: exploits/windows/dos/14607.py
    [EDB-14607: Microsoft - SMB Server Trans2 Zero Size Pool Alloc (MS10-054)]
  2. GitHub: https://github.com/uroboros-security/SMB-CVE
    [CVE-2010-2550]
  3. GitHub: https://github.com/uroboros-security/SMB-CVE
    [CVE-2010-2551]
  4. GitHub: https://github.com/uroboros-security/SMB-CVE
    [CVE-2010-2552]

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:F/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.3 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.3 (High)

Go back to menu.

Plugin Source


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

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

include("compat.inc");

if (description)
{
 script_id(48405);
 script_version("1.19");
 script_cvs_date("Date: 2018/11/15 20:50:28");

 script_cve_id("CVE-2010-2550", "CVE-2010-2551", "CVE-2010-2552");
 script_bugtraq_id(42224, 42263, 42267);
 script_xref(name:"EDB-ID", value:"14607");
 script_xref(name:"MSFT", value:"MS10-054");
 script_xref(name:"MSKB", value:"982214");

 script_name(english:"MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote check)");
 script_summary(english:"Checks response to a Trans2 Query FS Attribute query");

 script_set_attribute(
  attribute:"synopsis",
  value:
"It is possible to execute arbitrary code on the remote Windows host
due to flaws in its SMB implementation."
 );
 script_set_attribute(
  attribute:"description",
  value:
"The remote host is affected by several vulnerabilities in the SMB
server that may allow an attacker to execute arbitrary code or perform
a denial of service against the remote host.  These vulnerabilities
depend on access to a shared drive, but do not necessarily require
credentials."
 );
 script_set_attribute(attribute:"see_also", value:"https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2010/ms10-054");
 script_set_attribute(
  attribute:"solution",
  value:
"Microsoft has released a set of patches for Windows XP, Vista, 2008, 7,
and 2008 R2."
 );
  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:F/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:"exploit_framework_core", value:"true");

 script_set_attribute(attribute:"vuln_publication_date", value:"2010/08/10");
 script_set_attribute(attribute:"patch_publication_date", value:"2010/08/10");
 script_set_attribute(attribute:"plugin_publication_date", value:"2010/08/23");

 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_set_attribute(attribute:"cpe", value:"cpe:/o:microsoft:windows");
 script_end_attributes();

 script_category(ACT_GATHER_INFO);

 script_copyright(english:"This script is Copyright (C) 2010-2018 Tenable Network Security, Inc.");
 script_family(english:"Windows");

 script_dependencies("samba_detect.nasl", "smb_accessible_shares.nasl");
 script_exclude_keys("SMB/not_windows");
 script_require_keys("SMB/accessible_shares/1");
 script_require_ports(139, 445);
 exit(0);
}


include("audit.inc");
include("global_settings.inc");
include("smb_func.inc");
include("byte_func.inc");
include("misc_func.inc");


if (get_kb_item("SMB/not_windows")) audit(AUDIT_OS_NOT, "Windows");

set_byte_order(BYTE_ORDER_LITTLE_ENDIAN);

#
# added @max_dcount from the original smb_trans2 in smb_func.inc
#
# return server response, starting with the smb header
#
function my_smb_trans2(param, data, max_dcount, max_pcount, command)
{
 local_var header, parameters, dat, packet, ret, pad, trans, p_offset, d_offset, plen, dlen, elen;

 header = smb_header (Command: SMB_COM_TRANSACTION2,
                      Status: nt_status (Status: STATUS_SUCCESS));

 pad = raw_byte (b:0);

 p_offset = 66;
 d_offset = p_offset + strlen (param);

 plen = strlen(param);
 dlen = strlen(data);

 parameters = raw_word (w:plen)   +   # total parameter count
	      raw_word (w:dlen)         +   # total data count
	      raw_word (w:max_pcount)   +   # Max parameter count
	      raw_word (w:max_dcount)   +   # Max data count
	      raw_byte (b:0)            +   # Max setup count
        raw_byte (b:0)            +   # Reserved
	      raw_word (w:0)            +   # Flags
	      raw_dword (d:0)           +   # Timeout
	      raw_word (w:0)            +   # Reserved
	      raw_word (w:plen)         +   # Parameter count
	      raw_word (w:p_offset)     +   # Parameter offset
	      raw_word (w:dlen)         +   # Data count
	      raw_word (w:d_offset)     +   # Data offset
	      raw_byte (b:1)            +   # Setup count
	      raw_byte (b:0)            +   # Reserved
              raw_word (w:command);         # command

 parameters = smb_parameters (data:parameters);

 dat = pad +
       param +
       data;

 dat = smb_data (data:dat);

 packet = netbios_packet (header:header, parameters:parameters, data:dat);

 return smb_sendrecv (data:packet);

}



host    = get_host_ip();
port    =  kb_smb_transport();
if (!get_port_state(port)) audit(AUDIT_PORT_CLOSED, port);
login   =  kb_smb_login();
pass    =  kb_smb_password();
domain  =  kb_smb_domain();

soc = open_sock_tcp(port);
if (!soc) audit(AUDIT_SOCK_FAIL, port);


# init a smb session
session_init(socket:soc, hostname:host);

# protocol negotiate and authentication
if ( smb_login(login:login,password:pass,domain:domain) != 1 )
{
  close(soc);
  audit(AUDIT_FN_FAIL, "smb_login");
}
session_set_authenticated();

#
# get an accessible share
#
accessible_shares = get_kb_item_or_exit("SMB/accessible_shares/1");
shares = get_kb_list("SMB/shares");
if (isnull(shares)) exit(1, "The 'SMB/shares' KB items are missing.");

shares = make_list(shares);

foreach share (shares)
{
  if (share != "IPC$" && share >< accessible_shares) break;
  else share = NULL;
}

if (isnull(share)) exit(1, "No accessible shares were found.");

# connect to the share
if (! smb_tree_connect_and_x(share:share))
{
  close(soc);
  exit(1, "Failed to connect to network share '" + share + "'.");
}


# send Trans2 Query FS Attribute query
fs_query = 3;                   # file system query
parameters = raw_word(w:0x105); # file system Attribute Query

res = my_smb_trans2(param:parameters, data: NULL, max_dcount:0x0F, max_pcount:0, command: fs_query);
close(soc);

if (! res)
{
  exit(1, "No response from the server to an SMB Trans2 request.");
}

# get status code
code = get_header_nt_error_code(header:res);
if (code == STATUS_BUFFER_OVERFLOW)
{
  security_hole(port:port);
}
else if( code == STATUS_INFO_LENGTH_MISMATCH)
{
  audit(AUDIT_HOST_NOT, "affected");
}
else
{
  exit(1, "Unexpected status code (" + code + ").");
}

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

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

Go back to menu.

How to Run


Here is how to run the MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote 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 Windows plugin family.
  6. On the right side table select MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote check) plugin ID 48405.
  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_pool_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: MSKB | Microsoft Knowledge Base: MSFT | Microsoft Security Bulletin:
  • MS10-054
See also: Similar and related Nessus plugins:
  • 48291 - MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214)
  • 108811 - Windows Server 2008 Critical RCE Vulnerabilities (uncredentialed) (PCI/DSS)
  • 49806 - MS10-070: Vulnerability in ASP.NET Could Allow Information Disclosure (2418042) (uncredentialed check)
  • 47556 - MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (uncredentialed check)
  • 46017 - MS10-025: Vulnerability in Microsoft Windows Media Services Could Allow Remote Code Execution (980858) (uncredentialed check)
  • 49286 - MS10-061: Vulnerability in Print Spooler Service Could Allow Remote Code Execution (2347290) (EMERALDTHREAD) (uncredentialed check)

Version


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

Go back to menu.