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

ManageEngine DeviceExpert 5.6 Java Server ScheduleResultViewer servlet Unauthenticated Remote Directory Traversal Vulnerability

ManageEngine DeviceExpert 5.6 Java Server ScheduleResultViewer servlet Unauthenticated 
Remote Directory Traversal Vulnerability

product homepage: http://www.manageengine.com/products/device-expert/
file tested: ManageEngine_DeviceExpert.exe
tested against: Microsoft Windows Server 2003 r2 sp2

"DeviceExpert is a web?based, multi vendor network change, configuration and 
compliance management (NCCCM) solution for switches, routers, firewalls and 
other network devices. Trusted by thousands of network administrators 
around the world, DeviceExpert helps automate and take total control 
of the entire life cycle of device configuration management."

The mentioned product installs a Java application server
which listen by default on port 6060 (https) for incoming

Without prior authentication, is possible to invoke the
ScheduleResultViewer servlet to disclose every file 
on target system. This can be done through the
FileName argument which suffers of a directory traversal



auth-conf.xml stores the authentication credentials to the
administrative interface (username, hashed password and a salt).
It is also possible to backup the MySQL database tables by cycling
through subfolders.
Theese tables can contain also usernames and passwords of
the configured devices, remember the software functionality,
it supports multiple vendors devices from the following list:

Cisco, HP, Nortel, Juniper, Force10, 3Com, D-link, Foundry, Dell, Aruba, Extreme, ADTRAN, Enterasys, Huawei, Blue Coat, Proxim, NetScreen, NETGEAR, FortiNet, ALAXALA, Brocade, Radware, DAX, H3C, Yamaha, Vanguard, Allied Telesis, Alcatel, Fujitsu, Motorola, Acme Packet, Watch Guard, Canoga Perkins


look at the web.xml located inside C:\ManageEngine\DeviceExpert\webapps\ncm\WEB-INF\ :



now decompile ScheduleResultViewerServlet.class:

package com.adventnet.ncm.client.schedule;

import com.adventnet.ncm.util.NCMServerUtil;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.*;

public class ScheduleResultViewerServlet extends HttpServlet

    public ScheduleResultViewerServlet()
        logger = Logger.getLogger(com/adventnet/ncm/client/schedule/ScheduleResultViewerServlet.getName());

    public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
        FileInputStream in;
        OutputStream out;
        in = null;
        out = null;
            String fileName = request.getParameter("FileName"); //<--------------------------------------
            } else
            File file = new File((new StringBuilder()).append(NCMServerUtil.SERVER_HOME).append(FS).append(fileName).toString()); //<-----------------------
            in = new FileInputStream(file);
            out = response.getOutputStream(); //<---------------------
            byte buf[] = new byte[1024];
            for(int count = 0; (count = in.read(buf)) >= 0;)
                out.write(buf, 0, count); //<-----------------

        catch(Exception ex)
            logger.log(Level.SEVERE, "Exception while processing request in ScheduleResultViewerServlet", ex);
            throw new ServletException(ex);
        if(in != null)
        if(out != null)
        break MISSING_BLOCK_LABEL_221;
        Exception exception;
        if(in != null)
        if(out != null)
        throw exception;

    Logger logger;
    private static final String FS = System.getProperty("file.separator");


'FileName' is taken from the request parameter without sanitization then
is passed to the File object. File content is showed to the remote user.

I think this is a huge vulnerability because this could open the path to
the equipments of an entire network.

As attachment, proof of concept code, which backup the underlying Mysql
database. You could also choose to add your own file to the list,
launch from the command line, place inside a writable folder.

poc: http://retrogod.altervista.org/9sg_me_poc.htm