Mercury Mail ph Server Remote Overflow - Nessus

High   Plugin ID: 20812

This page contains detailed information about the Mercury Mail ph 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: 20812
Name: Mercury Mail ph Server Remote Overflow
Filename: mercury_ph_overflow.nasl
Vulnerability Published: 2005-12-16
This Plugin Published: 2006-01-27
Last Modification Time: 2018-07-14
Plugin Version: 1.18
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies: find_service2.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2005-12-16
Patch Published: 2006-01-01
CVE [?]: CVE-2005-4411
CPE [?]: N/A

Synopsis

The remote ph service is affected by a buffer overflow vulnerability.

Description

The remote host is running the Mercury Mail Transport System, a free suite of server products for Windows and Netware associated with Pegasus Mail.

The remote installation of Mercury includes a ph server that is vulnerable to buffer overflow attacks. By leveraging this issue, an unauthenticated, remote attacker is able to crash the remote service and possibly execute arbitrary code remotely.

Solution

Install the Jan 2006 Mercury/32 Security patches for MercuryW and MercuryH.

Public Exploits


Target Network Port(s): 105
Target Asset(s): Services/ph
Exploit Available: True (Metasploit Framework, Exploit-DB, Core Impact)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Mercury Mail ph Server Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/misc/mercury_phonebook
    [Mercury/32 PH Server Module 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/16419.rb
    [EDB-16419: Mercury/32 < 4.01b - PH Server Module 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:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)

Go back to menu.

Plugin Source


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

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

include("compat.inc");

if (description)
{
  script_id(20812);
  script_version("1.18");
  script_cvs_date("Date: 2018/07/14  1:59:35");

  script_cve_id("CVE-2005-4411");
  script_bugtraq_id(16396);
  script_xref(name:"EDB-ID", value:"1375");

  script_name(english:"Mercury Mail ph Server Remote Overflow");
  script_summary(english:"Checks for a buffer overflow vulnerability in Mercury ph Server");

  script_set_attribute(attribute:"synopsis", value:"The remote ph service is affected by a buffer overflow vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote host is running the Mercury Mail Transport System, a free
suite of server products for Windows and Netware associated with
Pegasus Mail.

The remote installation of Mercury includes a ph server that is
vulnerable to buffer overflow attacks. By leveraging this issue, an
unauthenticated, remote attacker is able to crash the remote service
and possibly execute arbitrary code remotely.");
  script_set_attribute(attribute:"see_also", value:"http://www.pmail.com/newsflash.htm#whfix");
  script_set_attribute(attribute:"see_also", value:"http://www.pmail.com/patches.htm");
  script_set_attribute(attribute:"solution", value:
"Install the Jan 2006 Mercury/32 Security patches for MercuryW and
MercuryH.");
  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: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:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Mercury/32 PH Server Module Buffer Overflow');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2005/12/16");
  script_set_attribute(attribute:"patch_publication_date", value:"2006/01/01");
  script_set_attribute(attribute:"plugin_publication_date", value:"2006/01/27");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_end_attributes();

  script_category(ACT_MIXED_ATTACK);
  script_family(english:"Gain a shell remotely");
  script_copyright(english:"This script is Copyright (C) 2006-2018 Tenable Network Security, Inc.");

  script_dependencies("find_service2.nasl");
  script_require_ports("Services/ph", 105);

  exit(0);
}

include("global_settings.inc");

port = get_kb_item("Services/ph");
if (!port) port = 105;
if (!get_tcp_port_state(port)) exit(0);


# Open a connection.
soc = open_sock_tcp(port);
if (soc) {
  # If safe checks are enabled...
  if (safe_checks() || report_paranoia < 2 ) {
    # Try to pull out the version number from the HELP.
    send(socket:soc, data:string("HELP\r\n"));
    res = recv(socket:soc, length:1024);
    if (res == NULL) exit(0);

    # nb: the banner with the patch applied reports "Mercury Simple PH Server v4.1 beta 6".
    if (egrep(pattern:" Mercury Simple PH Server v([0-3]\.|4\.0(0|1($|[ab])))", string:res)) {
      report = string(
        "Nessus has determined the flaw exists with the application\n",
        "simply by looking at the version in its banner.\n"
      );
      security_hole(port:port, extra:report);
    }
  }
  # Otherwise...
  else {
    # Try to crash the service.
    send(socket:soc, data:string(crap(1000), "\r\n"));
    res = recv(socket:soc, length:256);

    # Try to reconnect if we didn't get anything back.
    if (res == NULL) {
      soc2 = open_sock_tcp(port);
      if (soc2) close(soc2);
      else {
        security_hole(port);
        exit(0);
      }
    }
  }

  close(soc);
}

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

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

Go back to menu.

How to Run


Here is how to run the Mercury Mail ph 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 ph Server Remote Overflow plugin ID 20812.
  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_ph_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 24785 - Mercury IMAP Server LOGIN Command Remote Overflow
  • 26067 - Mercury IMAP Server SEARCH Command Remote Buffer Overflow
  • 15867 - Mercury Mail Remote IMAP 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_ph_overflow.nasl version 1.18. For more plugins, visit the Nessus Plugin Library.

Go back to menu.