MailCarrier < 3.0.1 SMTP EHLO Command Remote Overflow - Nessus

High   Plugin ID: 15902

This page contains detailed information about the MailCarrier < 3.0.1 SMTP EHLO 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: 15902
Name: MailCarrier < 3.0.1 SMTP EHLO Command Remote Overflow
Filename: mailcarrier_smtp_overflow.nasl
Vulnerability Published: 2004-10-26
This Plugin Published: 2004-12-03
Last Modification Time: 2018-11-15
Plugin Version: 1.19
Plugin Type: remote
Plugin Family: SMTP problems
Dependencies: smtpserver_detect.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2004-10-26
Patch Published: N/A
CVE [?]: CVE-2004-1638
CPE [?]: N/A

Synopsis

The remote SMTP server is affected by a remote command execution vulnerability.

Description

The target is running at least one instance of MailCarrier in which the SMTP service suffers from a buffer overflow vulnerability. By sending an overly long EHLO command, a remote attacker can crash the SMTP service and execute arbitrary code on the target.

Solution

Upgrade to MailCarrier 3.0.1 or greater.

Public Exploits


Target Network Port(s): 25
Target Asset(s): Services/smtp
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 MailCarrier < 3.0.1 SMTP EHLO Command Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/smtp/mailcarrier_smtp_ehlo
    [TABS MailCarrier v2.51 SMTP EHLO Overflow]
  2. Exploit-DB: exploits/windows/remote/16822.rb
    [EDB-16822: TABS MailCarrier 2.51 - SMTP EHLO 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 mailcarrier_smtp_overflow.nasl nessus plugin source code. This script is Copyright (C) 2004-2018 George A. Theall

#
# This script was written by George A. Theall, <[email protected]>.
#
# See the Nessus Scripts License for details.
#

# Changes by Tenable:
# - Revised plugin title, output formatting (9/13/09)


include("compat.inc");

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

  script_cve_id("CVE-2004-1638");
  script_bugtraq_id(11535);

  script_name(english:"MailCarrier < 3.0.1 SMTP EHLO Command Remote Overflow");
 
 script_set_attribute(attribute:"synopsis", value:
"The remote SMTP server is affected by a remote command execution
vulnerability." );
 script_set_attribute(attribute:"description", value:
"The target is running at least one instance of MailCarrier in which 
the SMTP service suffers from a buffer overflow vulnerability.  By 
sending an overly long EHLO command, a remote attacker can crash the 
SMTP service and execute arbitrary code on the target." );
 script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2004/Oct/283" );
 script_set_attribute(attribute:"solution", value:
"Upgrade to MailCarrier 3.0.1 or greater." );
 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:"metasploit_name", value:'TABS MailCarrier v2.51 SMTP EHLO Overflow');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

 script_set_attribute(attribute:"plugin_publication_date", value: "2004/12/03");
 script_set_attribute(attribute:"vuln_publication_date", value: "2004/10/26");
 script_cvs_date("Date: 2018/11/15 20:50:24");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();

  script_summary(english:"Checks for SMTP Buffer Overflow Vulnerability in MailCarrier");
  script_category(ACT_DESTRUCTIVE_ATTACK);
  script_copyright(english:"This script is Copyright (C) 2004-2018 George A. Theall");
  script_family(english:"SMTP problems");
  script_dependencie("smtpserver_detect.nasl");
  script_require_ports("Services/smtp", 25);
  exit(0);
}

include("global_settings.inc");
include("misc_func.inc");
include("smtp_func.inc");

host = get_host_name();
port = get_service(svc:"smtp", default: 25, exit_on_fail: 1);
if (get_kb_item('SMTP/'+port+'/broken')) exit(0);

debug_print("searching for SMTP Buffer Overflow vulnerability in MailCarrier on ", host, ":", port, ".\n");

banner = get_smtp_banner(port:port);
debug_print("banner =>>", banner, "<<.\n");
if ("TABS Mail Server" >!< banner) exit(0);

soc = open_sock_tcp(port);
if (!soc) exit(1);

# It's MailCarrier and the port's open so try to overflow the buffer.
#
# nb: this just tries to overflow the buffer and crash the service
#     rather than try to run an exploit, like what muts published
#     as a PoC on 10/23/2004. I've verified that buffer sizes of
#     1032 (from the TABS LABS update alert) and 4095 (from 
#     smtp_overflows.nasl) don't crash the service in 2.5.1 while
#     one of 5100 does so that what I use here.
c = 'EHLO ' + crap(length:5100, data:"NESSUS") + '\r\n';
debug_print("C: ", c);
send(socket:soc, data:c);
repeat {
  s = recv_line(socket: soc, length:32768);
  debug_print("S: ", s);
}
until (s !~ '^[0-9][0-9][0-9]-');
if (!s) {
  close(soc);
  debug_print("trying to reopen socket.\n");
  if (service_is_dead(port: port, exit: 1) > 0)
    security_hole(port);
  exit(0);
}
smtp_close(socket: soc);

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

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

Go back to menu.

How to Run


Here is how to run the MailCarrier < 3.0.1 SMTP EHLO 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 SMTP problems plugin family.
  6. On the right side table select MailCarrier < 3.0.1 SMTP EHLO Command Remote Overflow plugin ID 15902.
  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 mailcarrier_smtp_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 30123 - Citadel SMTP makeuserkey Function RCPT TO Command Remote Overflow
  • 11889 - Exchange XEXCH50 Remote Buffer Overflow
  • 107149 - Exim < 4.90.1 Buffer Overflow RCE Vulnerability
  • 129470 - Exim 4.92.x < 4.92.3 Heap Buffer Overflow
  • 51179 - Exim string_format Function Remote Overflow
  • 22314 - Ipswitch IMail Server SMTP Service Crafted RCPT String Remote Overflow
  • 53534 - IBM Lotus Domino iCalendar Email Address ORGANIZER:mailto Header Remote Overflow
  • 12065 - ASN.1 Multiple Integer Overflows (SMTP check)
  • 25928 - Mercury SMTP Server AUTH CRAM-MD5 Remote Buffer Overflow
  • 11499 - Sendmail < 8.12.9 NOCHAR Control Value prescan Overflow
  • 11316 - Sendmail headers.c crackaddr Function Address Field Handling Remote Overflow
  • 11838 - Sendmail < 8.12.10 prescan() Function Remote Overflow
  • 11593 - SLMail < 5.1.0.4433 Multiple Command Remote Overflows

Version


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

Go back to menu.