MiniUPnP < 1.4 Multiple Vulnerabilities - Nessus

Critical   Plugin ID: 64377

This page contains detailed information about the MiniUPnP < 1.4 Multiple Vulnerabilities Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 64377
Name: MiniUPnP < 1.4 Multiple Vulnerabilities
Filename: miniupnpd_1_4.nasl
Vulnerability Published: 2009-05-16
This Plugin Published: 2013-01-31
Last Modification Time: 2018-11-15
Plugin Version: 1.13
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies: http_version.nasl, upnp_search.nasl

Vulnerability Information


Severity: Critical
Vulnerability Published: 2009-05-16
Patch Published: 2009-10-30
CVE [?]: CVE-2013-0229, CVE-2013-0230
CPE [?]: cpe:/a:miniupnp_project:miniupnpd

Synopsis

A network service running on the remote host has multiple vulnerabilities.

Description

According to its banner, the version of MiniUPnP running on the remote host is prior to 1.4. It is, therefore, affected by the following vulnerabilities :

- An out-of-bounds read error exists in the ProcessSSDPRequest() function in file minissdp.c that allows an unauthenticated, remote attacker to cause a denial of service condition via a specially crafted M-SEARCH request. (CVE-2013-0229)

- A stack-based buffer overflow condition exists in the ExecuteSoapAction() function in the SOAPAction handler, due to improper validation of user-supplied input. An unauthenticated, remote attacker can exploit this, via a long quoted method, to cause a denial of service condition or the execution of arbitrary code. (CVE-2013-0230)

Solution

Upgrade to MiniUPnP version 1.4 or later.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): Services/www, upnp/server
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the MiniUPnP < 1.4 Multiple Vulnerabilities vulnerability:

  1. Metasploit: exploit/linux/upnp/miniupnpd_soap_bof
    [MiniUPnPd 1.0 Stack Buffer Overflow Remote Code Execution]
  2. Metasploit: auxiliary/dos/upnp/miniupnpd_dos
    [MiniUPnPd 1.4 Denial of Service (DoS) Exploit]
  3. Metasploit: auxiliary/scanner/upnp/ssdp_msearch
    [UPnP SSDP M-SEARCH Information Discovery]
  4. Exploit-DB: exploits/hardware/dos/37517.pl
    [EDB-37517: INFOMARK IMW-C920W MiniUPnPd 1.0 - Denial of Service]
  5. Exploit-DB: exploits/linux/remote/25975.rb
    [EDB-25975: MiniUPnPd 1.0 - Remote Stack Buffer Overflow Remote Code Execution (Metasploit)]
  6. Exploit-DB: exploits/multiple/remote/36839.py
    [EDB-36839: MiniUPnPd 1.0 (MIPS) - Remote Stack Overflow Remote Code Execution for AirTies RT Series]
  7. GitHub: https://github.com/lochiiconnectivity/vulnupnp
    [CVE-2013-0229: Discover uPNP devices vulnerable to CVE-2013-0229 / CVE-2013-0230 / CVE-2012-5958 / ...]
  8. GitHub: https://github.com/lochiiconnectivity/vulnupnp
    [CVE-2013-0230: Discover uPNP devices vulnerable to CVE-2013-0229 / CVE-2013-0230 / CVE-2012-5958 / ...]

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)
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 miniupnpd_1_4.nasl nessus plugin source code. This script is Copyright (C) 2013-2018 Tenable Network Security, Inc.

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

include("compat.inc");

if (description)
{
  script_id(64377);
  script_version("1.13");
  script_cvs_date("Date: 2018/11/15 20:50:22");

  script_cve_id("CVE-2013-0229", "CVE-2013-0230");
  script_bugtraq_id(57607, 57608);
  script_xref(name:"EDB-ID", value:"25975");
  script_xref(name:"EDB-ID", value:"36839");
  script_xref(name:"EDB-ID", value:"37517");

  script_name(english:"MiniUPnP < 1.4 Multiple Vulnerabilities");
  script_summary(english:"Checks the miniupnp version.");

  script_set_attribute(attribute:"synopsis", value:
"A network service running on the remote host has multiple
vulnerabilities.");
  script_set_attribute(attribute:"description", value:
"According to its banner, the version of MiniUPnP running on the remote
host is prior to 1.4. It is, therefore, affected by the following
vulnerabilities :

  - An out-of-bounds read error exists in the
    ProcessSSDPRequest() function in file minissdp.c that
    allows an unauthenticated, remote attacker to cause a
    denial of service condition via a specially crafted
    M-SEARCH request. (CVE-2013-0229)

  - A stack-based buffer overflow condition exists in the
    ExecuteSoapAction() function in the SOAPAction handler,
    due to improper validation of user-supplied input. An
    unauthenticated, remote attacker can exploit this, via a
    long quoted method, to cause a denial of service
    condition or the execution of arbitrary code.
    (CVE-2013-0230)");
  # https://blog.rapid7.com/2013/01/29/security-flaws-in-universal-plug-and-play-unplug-dont-play/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?46d66d2f");
  script_set_attribute(attribute:"see_also", value:"https://help.rapid7.com/?community");
  # https://help.rapid7.com/?community
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?d381943f");
  script_set_attribute(attribute:"solution", value:
"Upgrade to MiniUPnP version 1.4 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: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:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'MiniUPnPd 1.0 Stack Buffer Overflow Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2009/05/16");
  script_set_attribute(attribute:"patch_publication_date", value:"2009/10/30"); # miniupnpd 1.4 released
  script_set_attribute(attribute:"plugin_publication_date", value:"2013/01/31");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:miniupnp_project:miniupnpd");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Gain a shell remotely");

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

  script_dependencies("upnp_search.nasl", "http_version.nasl");
  script_require_ports("upnp/server", "Services/www");

  exit(0);
}

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

global_var fix, vuln;
fix = '1.4';
vuln = FALSE;

##
# Checks if the given server banner is from a vulnerable
# version of miniupnpd.  If so, a reporting function is
# called
#
# @param port port number of the service being tested
# @param server server banner advertised on "port"
# @param proto the protocol the port is accessible by (tcp or udp)
##
function _check_miniupnp_version(port, server, proto)
{
  local_var ver, report, banner;
  server = chomp(server);
  ver = eregmatch(string:server, pattern:'miniupnpd/([0-9.]+)', icase:TRUE);

  if (!isnull(ver) && ver_compare(ver:ver[1], fix:fix, strict:FALSE) < 0)
  {
    vuln = TRUE;

    banner = ereg_replace(string:server, pattern:'SERVER: *(.+)', replace:"\1", icase:TRUE);
    report =
      '\n  Server banner : ' + banner +
      '\n  Installed version : ' + ver[1] +
      '\n  Fixed version : ' + fix + '\n';

    security_report_v4(port:port,
                       proto:proto,
                       severity:SECURITY_HOLE,
                       extra:report);
  }
}

# check the server string retrieved via UDP 1900 by upnp_search.nasl
servers = get_kb_list('upnp/server');
foreach(server in servers) _check_miniupnp_version(port:1900, server:server, proto:'udp');

# check any server strings retrieved via HTTP
www_ports = get_kb_list('Services/www');

foreach port (www_ports)
{
  server = http_server_header(port:port);
  if (isnull(server)) continue;

  _check_miniupnp_version(port:port, server:server, proto:'tcp');
}

if (!vuln)
  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/miniupnpd_1_4.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\miniupnpd_1_4.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/miniupnpd_1_4.nasl

Go back to menu.

How to Run


Here is how to run the MiniUPnP < 1.4 Multiple Vulnerabilities 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 Gain a shell remotely plugin family.
  6. On the right side table select MiniUPnP < 1.4 Multiple Vulnerabilities plugin ID 64377.
  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 miniupnpd_1_4.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 125607 - Debian DLA-1811-1 : miniupnpd security update

Version


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

Go back to menu.