MERCUR Messaging IMAP Service Multiple Command Remote Overflow - Nessus

Critical   Plugin ID: 21116

This page contains detailed information about the MERCUR Messaging IMAP Service Multiple Command 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: 21116
Name: MERCUR Messaging IMAP Service Multiple Command Remote Overflow
Filename: mercur_imap_buffer_overflow.nasl
Vulnerability Published: 2006-03-16
This Plugin Published: 2006-03-22
Last Modification Time: 2018-11-15
Plugin Version: 1.19
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies: find_service1.nasl

Vulnerability Information


Severity: Critical
Vulnerability Published: 2006-03-16
Patch Published: N/A
CVE [?]: CVE-2006-1255
CPE [?]: N/A

Synopsis

The remote IMAP server is affected by a remote buffer overflow vulnerability.

Description

The remote host is running MERCUR Messaging Server / Mailserver, a commercial messaging application for Windows.

The IMAP server component of this software fails to properly copy overly-long arguments to LOGIN and SELECT commands, which can be exploited to crash the server and possibly to execute arbitrary code remotely.

Note that the services run by default with LOCAL SYSTEM privileges, which means that an unauthenticated attacker can potentially gain complete control of the affected host.

Solution

No patch information at this time. Filter access to the IMAP4 Service, so that it can be used by trusted sources only.

Public Exploits


Target Network Port(s): 143
Target Asset(s): Services/imap
Exploit Available: True (Metasploit Framework, Exploit-DB, Immunity Canvas)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the MERCUR Messaging IMAP Service Multiple Command Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/imap/mercur_login
    [Mercur Messaging 2005 IMAP Login Buffer Overflow]
  2. Metasploit: exploit/windows/imap/mercur_imap_select_overflow
    [Mercur v5.0 IMAP SP3 SELECT Buffer Overflow]
  3. Exploit-DB: exploits/windows/remote/16476.rb
    [EDB-16476: Mercur MailServer 5.0 - IMAP SP3 SELECT Buffer Overflow (Metasploit)]
  4. Exploit-DB: exploits/windows/remote/16481.rb
    [EDB-16481: Mercur Messaging 2005 - IMAP Login Buffer Overflow (Metasploit)]
  5. Immunity Canvas: CANVAS

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:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.3 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.3 (High)

Go back to menu.

Plugin Source


This is the mercur_imap_buffer_overflow.nasl nessus plugin source code. This script is Copyright (C) 2006-2018 Ferdy Riphagen

# Script Written By Ferdy Riphagen 
# <f[dot]riphagen[at]nsec[dot]nl>
#
# Script distributed under the GNU GPLv2 License.
#

# Changes by Tenable:
# - Revised plugin title (8/5/09)
# - Changed plugin family (8/17/09)


include("compat.inc");

if (description) {
 script_id(21116);
 script_version("1.19");

 script_cve_id("CVE-2006-1255"); 
 script_bugtraq_id(17138);

 script_name(english:"MERCUR Messaging IMAP Service Multiple Command Remote Overflow");
 script_summary(english:"Checks for buffer overflows in Mercur Mailserver/Messaging IMAP Services");

 script_set_attribute(attribute:"synopsis", value:
"The remote IMAP server is affected by a remote buffer overflow
vulnerability." );
 script_set_attribute(attribute:"description", value:
"The remote host is running MERCUR Messaging Server / Mailserver, a
commercial messaging application for Windows. 

The IMAP server component of this software fails to properly copy
overly-long arguments to LOGIN and SELECT commands, which can be
exploited to crash the server and possibly to execute arbitrary code
remotely. 

Note that the services run by default with LOCAL SYSTEM privileges,
which means that an unauthenticated attacker can potentially gain
complete control of the affected host." );
 script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2006/Mar/1111" );
 script_set_attribute(attribute:"solution", value:
"No patch information at this time. 
 
Filter access to the IMAP4 Service, so that it can be used by trusted
sources only." );
  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: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:'Mercur Messaging 2005 IMAP Login Buffer Overflow');
  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:'CANVAS');
 script_set_attribute(attribute:"plugin_publication_date", value: "2006/03/22");
 script_set_attribute(attribute:"vuln_publication_date", value: "2006/03/16");
 script_cvs_date("Date: 2018/11/15 20:50:22");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();


 script_category(ACT_DENIAL);
 script_family(english:"Gain a shell remotely");
 script_copyright(english:"This script is Copyright (C) 2006-2018 Ferdy Riphagen");
 script_dependencies("find_service1.nasl");
 script_require_ports("Services/imap", 143);
 exit(0);
}

include("imap_func.inc");
include("global_settings.inc");

port = get_kb_item("Services/imap");
if (!port) port = 143;
if (!get_port_state(port)) exit(0);

banner = get_imap_banner(port:port);
#debug_print("The remote IMAP banner is: ", banner, "\r\n");
if (banner && "MERCUR IMAP4" >< banner) {
  soc = open_sock_tcp(port);
  if (!soc) exit(0);

  exp = string("a0 LOGIN ", crap(data:raw_string(0x41), length:300), "\r\n");
  send(socket:soc, data:exp);

  recv = recv(socket:soc, length:1024);
  #debug_print("Response: ", recv, "\r\n");
  close(soc);

  soc = open_sock_tcp(port);
  if (soc) {
   send(socket:soc, data:string("a1 CAPABILITY \r\n"));
   recv2 = recv(socket:soc, length:1024);
   #debug_print("Response2: ", recv2, "\r\n");
   close(soc);
  }

  if (!soc || (!strlen(recv2))) { 
   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/mercur_imap_buffer_overflow.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\mercur_imap_buffer_overflow.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/mercur_imap_buffer_overflow.nasl

Go back to menu.

How to Run


Here is how to run the MERCUR Messaging IMAP Service Multiple Command 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 MERCUR Messaging IMAP Service Multiple Command Remote Overflow plugin ID 21116.
  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 mercur_imap_buffer_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 25118 - MERCUR Messaging IMAP Server NTLM Authentication NTLMSSP Argument Remote Overflow
  • 11642 - Helix Servers View Source Plug-in RTSP Parser Overflow
  • 11943 - rsync < 2.5.7 Unspecified Remote Heap Overflow
  • 12285 - Unreal Engine Secure Query Remote Overflow
  • 14243 - Medal of Honor Multiple Remote Overflows
  • 14361 - Netscape NSS Library SSLv2 Challenge Overflow
  • 15867 - Mercury Mail Remote IMAP Server Remote Overflow
  • 16232 - VERITAS Backup Exec Agent Browser Registration Request Remote Overflow
  • 16274 - ngIRCd < 0.8.2 Lists_MakeMask() Remote Overflow DoS
  • 17158 - Knox Arkeia Backup Client Type 77 Request Processing Buffer Remote Overflow
  • 17326 - Sentinel License Manager lservnt Service Remote Buffer Overflow
  • 18257 - BakBone NetVault < 7.1.2 / 7.3.1 Multiple Remote Overflows
  • 18403 - Hummingbird InetD LPD Component (Lpdw.exe) Data Overflow
  • 18524 - Novell ZENworks Multiple Remote Pre-Authentication Overflows
  • 19428 - Novell eDirectory Server iMonitor Multiple Remote Overflows
  • 20318 - Novell NetMail IMAP Agent Long Verb Arguments Remote Overflow
  • 20336 - Qualcomm WorldMail Multiple IMAP Command Remote Overflow
  • 20812 - Mercury Mail ph Server Remote Overflow
  • 21243 - Novell GroupWise Messenger Accept Language Remote Overflow
  • 21580 - freeSSHd Key Exchange Algorithm String Remote Overflow
  • 23736 - AT-TFTP Server Filename Handling Remote Overflow
  • 24327 - Mercury LoadRunner Agent server_ip_name Field Remote Buffer Overflow
  • 24680 - Trend Micro ServerProtect TmRpcSrv.dll RPC Request Multiple Overflows
  • 24785 - Mercury IMAP Server LOGIN Command Remote Overflow
  • 24903 - IBM Lotus Domino IMAP Server (nimap.exe) CRAM-MD5 Authentication Remote Overflow
  • 25084 - Novell Groupwise WebAccess GWINTER.EXE Base64 Decoding Remote Overflow
  • 25118 - MERCUR Messaging IMAP Server NTLM Authentication NTLMSSP Argument Remote Overflow
  • 25662 - IBM Tivoli Storage Manager Multiple Remote Overflows
  • 25935 - SIDVault < 2.0f LDAP Server Malformed Search Request Buffer Overflow
  • 26067 - Mercury IMAP Server SEARCH Command Remote Buffer Overflow
  • 40862 - Wyse Thin Client hagent.exe Unspecified Buffer Overflow
  • 54943 - IBM Tivoli Directory Server SASL Bind Request Buffer Overflow (uncredentialed check)
  • 55544 - Novell File Reporter Engine RECORD Element Tag Parsing Overflow (uncredentialed check)
  • 55907 - HP iNode Management Center Buffer Overflow (HPSB3C02687) (remote check)
  • 57462 - FreeBSD 'telnetd' Daemon Remote Buffer Overflow

Version


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

Go back to menu.