Microsoft Windows SMB Guessable User Credentials - Nessus

High   Plugin ID: 10404

This page contains detailed information about the Microsoft Windows SMB Guessable User Credentials Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 10404
Name: Microsoft Windows SMB Guessable User Credentials
Filename: smb_login_as_users.nasl
Vulnerability Published: 1999-01-01
This Plugin Published: 2000-05-10
Last Modification Time: 2020-04-27
Plugin Version: 1.63
Plugin Type: local
Plugin Family: Windows
Dependencies: netbios_name_get.nasl, smb_samr_user_enum.nasl, smb_sid2localuser.nasl, smb_sid2user.nasl, snmp_lanman_users.nasl
Required KB Items [?]: SMB/name
Excluded KB Items: global_settings/supplied_logins_only, SMB/any_login

Vulnerability Information


Severity: High
Vulnerability Published: 1999-01-01
Patch Published: N/A
CVE [?]: CVE-1999-0504, CVE-1999-0506
CPE [?]: N/A

Synopsis

Credentials for the remote Windows host can be discovered.

Description

This script attempts to log into the remote host using several login / password combinations.

Solution

Have the affected user(s) choose a good password.

Public Exploits


Target Network Port(s): 139, 445
Target Asset(s): N/A
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 Microsoft Windows SMB Guessable User Credentials vulnerability:

  1. Metasploit: exploit/windows/smb/psexec
    [Microsoft Windows Authenticated Powershell Command Execution]
  2. Metasploit: exploit/windows/local/current_user_psexec
    [PsExec via Current User Token]
  3. Metasploit: auxiliary/scanner/mssql/mssql_login
    [MSSQL Login Utility]
  4. Metasploit: exploit/windows/local/powershell_remoting
    [Powershell Remoting Remote Command Execution]
  5. Metasploit: exploit/windows/smb/psexec
    [Microsoft Windows Authenticated User Code Execution]
  6. Metasploit: auxiliary/scanner/smb/psexec_loggedin_users
    [Microsoft Windows Authenticated Logged In Users Enumeration]
  7. Metasploit: auxiliary/scanner/smb/smb_login
    [SMB Login Check Scanner]
  8. Metasploit: auxiliary/scanner/vnc/vnc_login
    [VNC Authentication Scanner]
  9. Metasploit: exploit/windows/local/wmi
    [Windows Management Instrumentation (WMI) Remote Command Execution]
  10. Exploit-DB: exploits/windows/remote/16374.rb
    [EDB-16374: Microsoft Windows - (Authenticated) User Code Execution (Metasploit)]

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 Score Source [?]: CVE-1999-0504
CVSS V2 Vector: AV:N/AC:L/Au:N/C:P/I:P/A:P
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:NA (None)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.5 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
CVSS Base Score:7.3 (High)
Impact Subscore:3.4
Exploitability Subscore:3.9
CVSS Temporal Score:NA (None)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.3 (High)

Go back to menu.

Plugin Source


This is the smb_login_as_users.nasl nessus plugin source code. This script is Copyright (C) 2000-2020 and is owned by Tenable, Inc. or an Affiliate thereof.

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

include("compat.inc");

if (description)
{
 script_id(10404);
 script_version("1.63");
 script_set_attribute(attribute:"plugin_modification_date", value:"2020/04/27");

 script_cve_id("CVE-1999-0504", "CVE-1999-0506");

 script_name(english:"Microsoft Windows SMB Guessable User Credentials");
 script_summary(english:"Attempts to log into the remote host");

 script_set_attribute(attribute:"synopsis", value:"Credentials for the remote Windows host can be discovered.");
 script_set_attribute(attribute:"description", value:
"This script attempts to log into the remote host using several login /
password combinations.");
 script_set_attribute(attribute:"solution", value:"Have the affected user(s) choose a good password.");
 script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
 script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L");
 script_set_attribute(attribute:"cvss_score_source", value:"CVE-1999-0504");
 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 Windows Authenticated Powershell Command Execution');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

script_set_attribute(attribute:"vuln_publication_date", value:"1999/01/01");
 script_set_attribute(attribute:"plugin_publication_date", value:"2000/05/10");

 script_set_attribute(attribute:"plugin_type", value:"local");
 script_end_attributes();

 script_category(ACT_GATHER_INFO);
 script_copyright(english:"This script is Copyright (C) 2000-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
 script_family(english:"Windows");

 script_dependencies("netbios_name_get.nasl", "smb_sid2user.nasl", "smb_sid2localuser.nasl",
                     "snmp_lanman_users.nasl", "smb_samr_user_enum.nasl");
 script_exclude_keys("SMB/any_login", "global_settings/supplied_logins_only");
 script_require_keys("SMB/name");
 script_require_ports(139, 445);
 script_timeout(0);

 exit(0);
}

include("audit.inc");
include("smb_func.inc");
include("global_settings.inc");
include("data_protection.inc");

 if ( safe_checks() ) exit(0, "This plugin requires safe checks to be disabled.");

if (supplied_logins_only) audit(AUDIT_SUPPLIED_LOGINS_ONLY);
if (get_kb_item("SMB/any_login")) exit(0, "The remote host authenticates users as 'Guest'.");

global_var	port;

function log_in(login, pass, domain)
{
 local_var r, soc;

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

 session_init(socket:soc, hostname:kb_smb_name());
 r = NetUseAdd(login:login, password:pass, domain:domain);
 if ( r == 1 && session_is_guest() ) r = 0;
 NetUseDel();

 if (r == 1)
   return TRUE;

 return(FALSE);
}


#----------------------------------------------------------------#
# 			  main()                                 #
#----------------------------------------------------------------#

port = kb_smb_transport();
if (!get_port_state(port)) audit(AUDIT_PORT_CLOSED, port);

finished = 0;
count = 1;
vuln = "";

okcount = 1;
login = kb_smb_login();
pass  = kb_smb_password();
dom = kb_smb_domain();

if ( login ) set_kb_item(name:"SMB/ValidUsers/0/Login", value:string(login));
if ( pass ) set_kb_item(name:"/tmp/SMB/ValidUsers/0/Password", value:string(pass));

current = "SMB/Users";

if(log_in(login:"nessus"+rand(), pass:"nessus"+rand(), domain:dom))exit(0);


while(!finished)
{
 login = string(get_kb_item(current + count));
 if(!login){
  	if(current == "SMB/LocalUsers/")
	  {
   		finished = 1;
	  }
	else {
	  current = "SMB/LocalUsers/";
	  count = 0;
	}
 }
 else
 {
  if(log_in(login:login, pass:"", domain:dom))
  {
   vuln = vuln + "  - the user '" + data_protection::sanitize_user_enum(users:login)+ "'" + ' has NO password !\n';
   a = "SMB/ValidUsers/" + okcount + "/Login";
   b = "/tmp/SMB/ValidUsers/" + okcount + "/Password";
   if ( login ) set_kb_item(name:a, value:login);
   #set_kb_item(name:b, value:"");
   okcount = okcount + 1;
  }
  else if(log_in(login:login, pass:login, domain:dom))
  {
   login = data_protection::sanitize_user_enum(users:login);
   vuln = vuln + "  - the password for '" + login + "' is '" + login+ "'" + ' !\n';
   a = "SMB/ValidUsers/" + okcount + "/Login";
   b = "/tmp/SMB/ValidUsers/"+ okcount + "/Password";
   if ( login )
   {
    set_kb_item(name:a, value:login);
    set_kb_item(name:b, value:login);
   }
   okcount = okcount + 1;
  }
 }
 count = count + 1;
}

if (strlen(vuln))
{
  if (report_verbosity > 0) security_hole(port:port, extra:vuln);
  else security_hole(port);
}
else audit(AUDIT_HOST_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_login_as_users.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\smb_login_as_users.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/smb_login_as_users.nasl

Go back to menu.

How to Run


Here is how to run the Microsoft Windows SMB Guessable User Credentials 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 Microsoft Windows SMB Guessable User Credentials plugin ID 10404.
  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_login_as_users.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 26918 - Microsoft Windows SMB Blank Administrator Password
  • 100051 - MS Security Advisory 4022344: Security Update for Microsoft Malware Protection Engine
  • 100767 - KB4023307: Security Update for the Windows Uniscribe Remote Code Execution Vulnerability for Microsoft Silverlight 5 (June 2017)
  • 108408 - Security Update for .NET Core (March 2018)
  • 118094 - Microsoft SQL Server Management Studio Multiple vulnerabilities (October 2018)
  • 118978 - Microsoft Exchange Server Elevation of Privilege Vulnerability (November 2018)
  • 12209 - MS04-011: Security Update for Microsoft Windows (835732) (uncredentialed check)
  • 125164 - Security Update for Microsoft ASP.NET Core (DoS) (May 2019)
  • 125217 - Security Update for .NET Core (May 2019)
  • 125225 - Security Update for .NET Core SDK (May 2019)
  • 126630 - Security Updates for Microsoft SQL Server (Uncredentialed Check) (July 2019)
  • 128764 - CredSSP Remote Code Execution Vulnerability March 2018 Security Update
  • 128770 - Security Update for Microsoft ASP.NET Core (Sep 2019)
  • 128771 - Security Update for .NET Core (Sep 2019)
  • 128772 - Security Update for .NET Core SDK (Sep 2019)
  • 131318 - Security Update for Microsoft Visual Studio Code (CVE-2019-1414)
  • 132993 - Security Update for .NET Core (January 2020)
  • 132994 - Security Update for .NET Core SDK (January 2020)
  • 133147 - Internet Explorer Scripting Engine Memory Corruption Vulnerability (CVE-2020-0674) (Deprecated)
  • 133718 - Security Updates for Microsoft SQL Server (Uncredentialed Check) (February 2020)

Version


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

Go back to menu.