Mercury Mail Remote IMAP Server Remote Overflow - Nessus

High   Plugin ID: 15867

This page contains detailed information about the Mercury Mail Remote IMAP Server Remote Overflow Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 15867
Name: Mercury Mail Remote IMAP Server Remote Overflow
Filename: mercury_mail_stack.nasl
Vulnerability Published: 2004-11-29
This Plugin Published: 2004-11-30
Last Modification Time: 2018-11-15
Plugin Version: 1.17
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies: find_service2.nasl
Excluded KB Items [?]: imap/false_imap

Vulnerability Information


Severity: High
Vulnerability Published: 2004-11-29
Patch Published: N/A
CVE [?]: CVE-2004-1211
CPE [?]: N/A

Synopsis

The remote IMAP server has multiple buffer overflow vulnerabilities.

Description

The remote host is running Mercury Mail server, an IMAP server for Windows.

According to its banner, the version of Mercury Mail running on the remote host has multiple stack-based buffer overflow vulnerabilities. A remote, authenticated attacker could exploit these issues to crash the service or execute arbitrary code.

Solution

Upgrade to the latest version of this software.

Public Exploits


Target Network Port(s): 143
Target Asset(s): Services/imap
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 Mercury Mail Remote IMAP Server Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/imap/mercury_rename
    [Mercury/32 v4.01a IMAP RENAME Buffer Overflow]
  2. Exploit-DB: exploits/windows/remote/1375.pl
    [EDB-1375: Mercury Mail Transport System 4.01b - PH SERVER Remote Overflow]
  3. Exploit-DB: exploits/windows/remote/16484.rb
    [EDB-16484: Mercury/32 Mail Server 4.01a - IMAP RENAME Buffer Overflow (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 V2 Vector [?]: AV:N/AC:L/Au:S/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:9.0 (High)
Impact Subscore:10.0
Exploitability Subscore:8.0
CVSS Temporal Score:7.4 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.4 (High)

Go back to menu.

Plugin Source


This is the mercury_mail_stack.nasl nessus plugin source code. This script is Copyright (C) 2004-2018 Tenable Network Security, Inc.

#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");


if(description)
{
 script_id(15867);
 script_version ("1.17");

 script_cve_id("CVE-2004-1211");
 script_bugtraq_id(11775, 11788);
  script_xref(name:"EDB-ID", value:"1375");
 script_xref(name:"Secunia", value:"13348");

 script_name(english:"Mercury Mail Remote IMAP Server Remote Overflow");
 script_summary(english:"Checks for version of Mercury Mail");

 script_set_attribute(
   attribute:"synopsis",
   value:"The remote IMAP server has multiple buffer overflow vulnerabilities."
 );
 script_set_attribute(attribute:"description",  value:
"The remote host is running Mercury Mail server, an IMAP server for
Windows.

According to its banner, the version of Mercury Mail running on the
remote host has multiple stack-based buffer overflow vulnerabilities.
A remote, authenticated attacker could exploit these issues to crash
the service or execute arbitrary code." );
 script_set_attribute(
   attribute:"see_also",
   value:"https://seclists.org/fulldisclosure/2004/Dec/45"
 );
 script_set_attribute(
   attribute:"see_also",
   value:"https://seclists.org/fulldisclosure/2004/Dec/116"
 );
 script_set_attribute(
   attribute:"solution",
   value:"Upgrade to the latest version of this software."
 );
 script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:C/I:C/A:C");
 script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
 script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
 script_set_attribute(attribute:"exploit_available", value:"true");
 script_set_attribute(attribute:"metasploit_name", value:'Mercury/32 v4.01a IMAP RENAME Buffer Overflow');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
 script_cwe_id(119);
 script_set_attribute(attribute:"plugin_publication_date", value: "2004/11/30");
 script_set_attribute(attribute:"vuln_publication_date", value: "2004/11/29");
 script_cvs_date("Date: 2018/11/15 20:50:22");
 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_end_attributes();

 script_category(ACT_GATHER_INFO);
 script_family(english:"Gain a shell remotely");

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

 script_dependencie("find_service2.nasl");
 script_require_ports("Services/imap", 143);
 script_exclude_keys("imap/false_imap");

 exit(0);
}

#
# The script code starts here
#

include("imap_func.inc");
port = get_kb_item("Services/imap");
if(!port) port = 143;

banner = get_imap_banner(port:port);
if ( ! banner ) exit(0);

if(egrep(pattern:"^\* OK.*IMAP4rev1 Mercury/32 v([0-3]\..*|4\.(00.*|01[^b-z].*))server ready.*", string:banner))
{
  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/mercury_mail_stack.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\mercury_mail_stack.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/mercury_mail_stack.nasl

Go back to menu.

How to Run


Here is how to run the Mercury Mail Remote IMAP Server Remote Overflow 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 Gain a shell remotely plugin family.
  6. On the right side table select Mercury Mail Remote IMAP Server Remote Overflow plugin ID 15867.
  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 mercury_mail_stack.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: Secunia Advisory: CWE | Common Weakness Enumeration:
  • CWE-119 (Weakness) Improper Restriction of Operations within the Bounds of a Memory Buffer
See also: Similar and related Nessus plugins:
  • 24785 - Mercury IMAP Server LOGIN Command Remote Overflow
  • 26067 - Mercury IMAP Server SEARCH Command Remote Buffer Overflow
  • 20812 - Mercury Mail ph Server Remote Overflow
  • 24910 - TestDirector (TD) for Mercury Quality Center SPIDERLib.Loader ActiveX Control (Spider90.ocx) ProgColor Property Overflow (2)
  • 24909 - TestDirector (TD) for Mercury Quality Center SPIDERLib.Loader ActiveX Control (Spider90.ocx) ProgColor Property Overflow
  • 25928 - Mercury SMTP Server AUTH CRAM-MD5 Remote Buffer Overflow
  • 24327 - Mercury LoadRunner Agent server_ip_name Field Remote Buffer Overflow
  • 46255 - HP Mercury LoadRunner Agent Remote Command Execution

Version


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

Go back to menu.