EMail Security Virtual Appliance learn-msg.cgi Remote Code Execution - Nessus

High   Plugin ID: 61996

This page contains detailed information about the EMail Security Virtual Appliance learn-msg.cgi 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: 61996
Name: EMail Security Virtual Appliance learn-msg.cgi Remote Code Execution
Filename: esva_learnmsg_rce.nasl
Vulnerability Published: 2012-08-10
This Plugin Published: 2012-09-06
Last Modification Time: 2021-01-19
Plugin Version: 1.5
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: esva_detect.nasl
Required KB Items [?]: www/esva
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: High
Vulnerability Published: 2012-08-10
Patch Published: N/A
CVE [?]: N/A
CPE [?]: N/A

Synopsis

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

Description

The version of EMail Security Virtual Appliance installed on the remote host is affected by a code execution vulnerability in the 'id' parameter of the 'learn-msg.cgi' script. By exploiting this flaw, a remote, unauthenticated attacker could execute arbitrary commands on the remote host subject to the privileges of the web server hosting the affected application.

Note the installed version is also likely affected by a similar vulnerability in the 'release-msg.cgi' script, though Nessus has not tested for this.

Solution

There is no known solution at this time.

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 EMail Security Virtual Appliance learn-msg.cgi Remote Code Execution vulnerability:

  1. Metasploit: exploit/linux/http/esva_exec
    [E-Mail Security Virtual Appliance learn-msg.cgi Command Injection]
  2. Exploit-DB: exploits/linux/remote/20551.pl
    [EDB-20551: E-Mail Security Virtual Appliance (ESVA) - Remote Execution]
  3. D2 Elliot: e-mail_security_virtual_appliance_2.0.5_rce.html
    [E-Mail Security Virtual Appliance 2.0.5 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:P/I:P/A:P/E:POC/RL:U/RC:ND
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.8 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.8 (Medium)

Go back to menu.

Plugin Source


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

  script_bugtraq_id(55050);
  script_xref(name:"EDB-ID", value:"20551");

  script_name(english:"EMail Security Virtual Appliance learn-msg.cgi Remote Code Execution");
  script_summary(english:"Attempts to execute the id command");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts an application that is affected by a remote
code execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of EMail Security Virtual Appliance installed on the remote
host is affected by a code execution vulnerability in the 'id' parameter
of the 'learn-msg.cgi' script.  By exploiting this flaw, a remote,
unauthenticated attacker could execute arbitrary commands on the remote
host subject to the privileges of the web server hosting the affected
application. 

Note the installed version is also likely affected by a similar
vulnerability in the 'release-msg.cgi' script, though Nessus has not
tested for this.");
  script_set_attribute(attribute:"solution", value:"There is no known solution 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:POC/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:"d2_elliot_name", value:"E-Mail Security Virtual Appliance 2.0.5 RCE");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'E-Mail Security Virtual Appliance learn-msg.cgi Command Injection');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/08/10");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/09/06");
  
  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_end_attributes();

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

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

  script_dependencies("esva_detect.nasl");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_keys("www/esva");
  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:'esva', port:port, exit_on_fail:TRUE);
base_url = build_url(qs:install['dir'], port:port);

cmd = 'id';
http_check_remote_code(
  port:port,
  unique_dir:'/cgi-bin',
  check_request:'/learn-msg.cgi?id=|'+cmd+';',
  check_result:'uid=[0-9]+.*gid=[0-9]+.*',
  extra_check:'<meta http-equiv="refresh" content="0;URL=/learned.html">',
  command:cmd
);
audit(AUDIT_WEB_APP_NOT_AFFECTED, 'EMail Security Virtual Appliance', base_url);

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

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

Go back to menu.

How to Run


Here is how to run the EMail Security Virtual Appliance learn-msg.cgi 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 EMail Security Virtual Appliance learn-msg.cgi Remote Code Execution plugin ID 61996.
  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 esva_learnmsg_rce.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 61431 - Atmail Email Server WebAdmin Control Panel dbconfig.ini Information Disclosure
  • 18293 - Woltlab Burning Board verify_email Function SQL Injection
  • 79271 - Cisco Email Security Appliance Telnet Remote Code Execution (cisco-sa-20120126-ironport)
  • 139575 - Cisco Webex Meetings User Email Address Information Disclosure (cisco-sa-webex-mAkmV4qc)
  • 35095 - Fedora 8 : roundcubemail-0.2-4.beta.fc8 (2008-11220)
  • 35098 - Fedora 9 : roundcubemail-0.2-4.beta.fc9 (2008-11234)
  • 95780 - Fedora 24 : roundcubemail (2016-60753c3dcd)
  • 95783 - Fedora 23 : roundcubemail (2016-b4896f20b3)
  • 95688 - Fedora 25 : roundcubemail (2016-d361d188d9)
  • 104688 - Fedora 26 : roundcubemail (2017-1560290881)
  • 105977 - Fedora 27 : roundcubemail (2017-cbc49efae8)
  • 53534 - IBM Lotus Domino iCalendar Email Address ORGANIZER:mailto Header Remote Overflow
  • 73832 - McAfee Email Gateway OpenSSL Information Disclosure (SB10071) (Heartbleed)
  • 76579 - McAfee Email Gateway OpenSSL Multiple Vulnerabilities (SB10075)
  • 79123 - McAfee Email Gateway GNU Bash Code Injection (SB10085) (Shellshock)
  • 22413 - MyReview Admin.php email Parameter SQL Injection
  • 31192 - Nukedit utilities/login.asp email Parameter SQL Injection
  • 88163 - openSUSE Security Update : roundcubemail (openSUSE-2016-80)
  • 88164 - openSUSE Security Update : roundcubemail (openSUSE-2016-81)
  • 88397 - openSUSE Security Update : roundcubemail (openSUSE-2016-84)
  • 74188 - Open Web Analytics owa_email_address SQL Injection
  • 33277 - SurgeMail IMAP Service APPEND Command Remote DoS
  • 25929 - SurgeMail IMAP Server SEARCH Command Remote Buffer Overflow
  • 73758 - Websense Email Security Heartbeat Information Disclosure (Heartbleed)

Version


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

Go back to menu.