MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (uncredentialed check) - Nessus
Critical Plugin ID: 47556This page contains detailed information about the MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (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: 47556
Name: MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (uncredentialed check)
Filename: smb_kb971468.nasl
Vulnerability Published: 2010-02-09
This Plugin Published: 2010-09-13
Last Modification Time: 2018-11-15
Plugin Version: 1.17
Plugin Type: remote
Plugin Family: Windows
Dependencies:
smb_accessible_shares.nasl, smb_nativelanman.nasl
Required KB Items [?]: SMB/accessible_shares/1
Excluded KB Items: SMB/not_windows
Vulnerability Information
Severity: Critical
Vulnerability Published: 2010-02-09
Patch Published: 2010-02-09
CVE [?]: CVE-2010-0020, CVE-2010-0021, CVE-2010-0022, CVE-2010-0231
CPE [?]: cpe:/o:microsoft:windows, x-cpe:/a:microsoft:windows:smbsvr
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 2000, XP, 2003, 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-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (uncredentialed check) vulnerability:
- Exploit-DB: exploits/windows/dos/12273.py
[EDB-12273: Microsoft Windows 7/2008 R2 - SMB Client Trans2 Stack Overflow (MS10-020) (PoC)] - Exploit-DB: exploits/windows/remote/15266.txt
[EDB-15266: Microsoft Windows - NTLM Weak Nonce (MS10-012)] - GitHub: https://github.com/Al1ex/WindowsElevation
[CVE-2010-0020] - GitHub: https://github.com/Amnesthesia/EHAPT-Group-Project
[CVE-2010-0020] - GitHub: https://github.com/Ascotbe/Kernelhub
[CVE-2010-0020] - GitHub: https://github.com/uroboros-security/SMB-CVE
[CVE-2010-0020] - GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
[CVE-2010-0020] - GitHub: https://github.com/Amnesthesia/EHAPT-Group-Project
[CVE-2010-0021] - GitHub: https://github.com/aRustyDev/C844
[CVE-2010-0021] - GitHub: https://github.com/uroboros-security/SMB-CVE
[CVE-2010-0021] - GitHub: https://github.com/Amnesthesia/EHAPT-Group-Project
[CVE-2010-0022] - GitHub: https://github.com/uroboros-security/SMB-CVE
[CVE-2010-0022] - GitHub: https://github.com/Amnesthesia/EHAPT-Group-Project
[CVE-2010-0231] - GitHub: https://github.com/uroboros-security/SMB-CVE
[CVE-2010-0231]
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_kb971468.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(47556);
script_version("1.17");
script_cvs_date("Date: 2018/11/15 20:50:28");
script_cve_id(
"CVE-2010-0020",
"CVE-2010-0021",
"CVE-2010-0022",
"CVE-2010-0231"
);
script_bugtraq_id(38049, 38051, 38054, 38085);
script_xref(name:"MSFT", value:"MS10-012");
script_xref(name:"MSKB", value:"971468");
script_name(english:"MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (uncredentialed check)");
script_summary(english:"Remote check for MS10-012 (SMB vulnerabilities)");
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-012");
script_set_attribute(
attribute:"solution",
value:
"Microsoft has released a set of patches for Windows 2000, XP, 2003,
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_cwe_id(20, 94, 264, 310, 362);
script_set_attribute(attribute:"vuln_publication_date", value:"2010/02/09");
script_set_attribute(attribute:"patch_publication_date", value:"2010/02/09");
script_set_attribute(attribute:"plugin_publication_date", value:"2010/09/13");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_set_attribute(attribute:"cpe", value:"x-cpe:/a:microsoft:windows:smbsvr");
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("smb_nativelanman.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("smb_func.inc");
include("byte_func.inc");
include("global_settings.inc");
include("misc_func.inc");
if (get_kb_item("SMB/not_windows")) audit(AUDIT_OS_NOT, "Windows");
host = get_host_ip();
port = kb_smb_transport();
login = kb_smb_login();
pass = kb_smb_password();
domain = kb_smb_domain();
#
# modified the original smb_trans2 in smb_func.inc
# return server response, starting with the smb header
#
function my_smb_trans2 (param, data, 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:1000) + # 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);
}
if ( ! get_port_state(port) ) exit(0, "Port "+port+" is not open.");
soc = open_sock_tcp(port);
if ( ! soc )
{
exit(1, "Failed to open a socket on port "+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);
exit(1, "smb_login() failed.");
}
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 a TRANS2 FIND_FIRST2 query
pattern = crap(data:"a", length:0x7c3);
cmd_find_first2 = 1;
parameters = raw_word (w:0x16) + # Default search : include HIDDEN/SYSTEM/DIRECTORY
raw_word (w:0xDFFF) + # Max buffer search count
raw_word (w:6) + # Close if EOS is reached / RESUME
raw_word (w:260) + # Default level of interest
raw_dword (d:0) + # Storage type
cstring (string:pattern);
res = my_smb_trans2 (param:parameters, data:NULL, max_pcount:18, command:cmd_find_first2);
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_NO_SUCH_FILE)
{
security_hole(port:port);
}
else if( code == STATUS_INVALID_PARAMETER)
{
exit(0, "The host is 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_kb971468.nasl
- Windows:
C:\ProgramData\Tenable\Nessus\nessus\plugins\smb_kb971468.nasl
- Mac OS X:
/Library/Nessus/run/lib/nessus/plugins/smb_kb971468.nasl
Go back to menu.
How to Run
Here is how to run the MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (uncredentialed check) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):
- Click to start a New Scan.
- Select Advanced Scan.
- Navigate to the Plugins tab.
- On the top right corner click to Disable All plugins.
- On the left side table select Windows plugin family.
- On the right side table select MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468) (uncredentialed check) plugin ID 47556.
- Specify the target on the Settings tab and click to Save the scan.
- 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_kb971468.nasl -t <IP/HOST>
Run the plugin with audit trail message on the console:
/opt/nessus/bin/nasl -a smb_kb971468.nasl -t <IP/HOST>
Run the plugin with trace script execution written to the console (useful for debugging):
/opt/nessus/bin/nasl -T - smb_kb971468.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_kb971468.nasl -t <IP/HOST>
Go back to menu.
References
BID | SecurityFocus Bugtraq ID: MSKB | Microsoft Knowledge Base: MSFT | Microsoft Security Bulletin:
- MS10-012
- CWE-20 (Weakness) Improper Input Validation
- CWE-94 (Weakness) Improper Control of Generation of Code ('Code Injection')
- CWE-264 (Category) Permissions, Privileges, and Access Controls
- CWE-310 (Category) Cryptographic Issues
- CWE-362 (Weakness) Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
- https://www.tenable.com/plugins/nessus/47556
- https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2010/ms10-012
- https://vulners.com/nessus/SMB_KB971468.NASL
- 44422 - MS10-012: Vulnerabilities in SMB Could Allow Remote Code Execution (971468)
- 108811 - Windows Server 2008 Critical RCE Vulnerabilities (uncredentialed) (PCI/DSS)
- 49806 - MS10-070: Vulnerability in ASP.NET Could Allow Information Disclosure (2418042) (uncredentialed check)
- 46017 - MS10-025: Vulnerability in Microsoft Windows Media Services Could Allow Remote Code Execution (980858) (uncredentialed check)
- 48405 - MS10-054: Vulnerabilities in SMB Server Could Allow Remote Code Execution (982214) (remote 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_kb971468.nasl version 1.17. For more plugins, visit the Nessus Plugin Library.
Go back to menu.