Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp) - Nessus

Critical   Plugin ID: 118145

This page contains detailed information about the Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 118145
Name: Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp)
Filename: cisco_prime_infrastructure_tftp_upload_rce.nasl
Vulnerability Published: 2018-10-03
This Plugin Published: 2018-10-16
Last Modification Time: 2019-11-01
Plugin Version: 1.6
Plugin Type: remote
Plugin Family: CISCO
Dependencies: cisco_prime_infrastructure_detect.nbin, tftpd_detect.nasl
Required KB Items [?]: installed_sw/Prime Infrastructure, Services/udp/tftp

Vulnerability Information


Severity: Critical
Vulnerability Published: 2018-10-03
Patch Published: 2018-10-03
CVE [?]: CVE-2018-15379
CPE [?]: cpe:/a:cisco:prime_infrastructure

Synopsis

The remote Cisco Prime Infrastructure application running on the remote host is affected by multiple vulnerabilities.

Description

The Cisco Prime Infrastructure application running on the remote host is affected by an arbitrary file upload flaw, which could lead to a remote code execution vulnerability. This is due to incorrect permissions for various system folders, which a file could be uploaded to via TFTP. The commands in that file could then executes at the privilege level of the user prime or root.

Solution

Upgrade to Cisco Prime Infrastructure version 3.3.1 Update 02, 3.4.1, or later.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp) vulnerability:

  1. Metasploit: exploit/linux/http/cisco_prime_inf_rce
    [Cisco Prime Infrastructure Unauthenticated 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.

Risk Information


CVSS Score Source [?]: CVE-2018-15379
CVSS V2 Vector: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:9.1 (Critical)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.1 (Critical)

Go back to menu.

Plugin Source


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

#
# (C) Tenable Network Security, Inc.
#
include("compat.inc");

if (description)
{
  script_id(118145);
  script_version("1.6");
  script_cvs_date("Date: 2019/11/01");

  script_cve_id("CVE-2018-15379");
  script_xref(name:"CISCO-SA", value:"cisco-sa-20181003-pi-tftp");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvk24890");

  script_name(english:"Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp)");
  script_summary(english:"Attempts to detect the vulnerability.");

  script_set_attribute(attribute:"synopsis", value:
"The remote Cisco Prime Infrastructure application running on the
remote host is affected by multiple vulnerabilities.");
  script_set_attribute(attribute:"description", value:
"The Cisco Prime Infrastructure application running on the remote host
is affected by an arbitrary file upload flaw, which could lead to a
remote code execution vulnerability. This is due to incorrect
permissions for various system folders, which a file could be uploaded
to via TFTP. The commands in that file could then executes at the
privilege level of the user prime or root.");
  # https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20181003-pi-tftp
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?35ef295a");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Cisco Prime Infrastructure version 3.3.1 Update 02, 3.4.1,
or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  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:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2018-15379");

  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:'Cisco Prime Infrastructure Unauthenticated Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2018/10/03");
  script_set_attribute(attribute:"patch_publication_date", value:"2018/10/03");
  script_set_attribute(attribute:"plugin_publication_date", value:"2018/10/16");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:cisco:prime_infrastructure");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"CISCO");

  script_copyright(english:"This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("cisco_prime_infrastructure_detect.nbin", "tftpd_detect.nasl");
  script_require_keys("installed_sw/Prime Infrastructure", "Services/udp/tftp");

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("http.inc");
include("misc_func.inc");
include("install_func.inc");

# Make sure PI is detected
appname = "Prime Infrastructure";
get_install_count(app_name:appname, exit_if_zero:TRUE);
port = get_http_port(default:443);
install = get_single_install(
  app_name:appname,
  port:port,
  exit_if_unknown_ver:FALSE);

ver = install["version"];

# cisco-sa-20181003-pi-tftp suggests versions prior to 3.2 are not affected
if(ver != UNKNOWN_VER &&
   ! empty_or_null((match = pregmatch(pattern:"([0-9.]+)", string:ver))) &&
   ver_compare(ver:match[1], fix:"3.2", strict:FALSE) == -1
)
{
  audit(AUDIT_HOST_NOT, "affected. Cisco Prime Infrastructure version is " + ver);
}

# Not affected if no TFTP server is detected (i.e., 3.2 FIPS)
if(! get_kb_item("Services/udp/tftp")) 
  audit(AUDIT_HOST_NOT, "affected. A TFTP server is not running on the remote host");
# Other files that can be used for testing:
#   poap_script.py.md5
#   prime-wsa-apache-server.crt
file = "poap_script.py";
res = http_send_recv3(
  method : "GET",
  port   : port,
  item   : "/swimtemp/" + file,
  exit_on_fail : TRUE
);

if (res[0] =~ "^HTTP/.+ 200")
{
  extra = "Nessus was able to detect the issue with the following request : " +
    '\n\n' + http_last_sent_request();

  security_report_v4(
    port       : port,
    severity   : SECURITY_HOLE,
    extra      : extra
  );
}
else if (res[0] =~ "^HTTP/.+ 404")
{
  audit(AUDIT_HOST_NOT , "affected");
}
# Unexpected HTTP status
else
{
  audit(AUDIT_RESP_BAD , port, "an HTTP request. HTTP response status: " + res[0]);
}

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

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

Go back to menu.

How to Run


Here is how to run the Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp) 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 CISCO plugin family.
  6. On the right side table select Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp) plugin ID 118145.
  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 cisco_prime_infrastructure_tftp_upload_rce.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


Cisco Bug ID: Cisco Security Advisory: See also: Similar and related Nessus plugins:
  • 118088 - Cisco Prime Infrastructure TFTP Arbitrary File Upload and Command Execution Vulnerability (cisco-sa-20181003-pi-tftp)
  • 126640 - Cisco Data Center Network Manager Arbitrary File Upload and Remote Code Execution Vulnerability

Version


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

Go back to menu.