Serv-U MDTM Command Overflow - Nessus

High   Plugin ID: 12080

This page contains detailed information about the Serv-U MDTM Command Overflow Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 12080
Name: Serv-U MDTM Command Overflow
Filename: ftp_servu_mdtm_overflow.nasl
Vulnerability Published: 2004-02-25
This Plugin Published: 2004-02-26
Last Modification Time: 2018-11-15
Plugin Version: 1.25
Plugin Type: remote
Plugin Family: FTP
Dependencies: ftp_anonymous.nasl, ftpserver_detect_type_nd_version.nasl
Required KB Items [?]: ftp/servu

Vulnerability Information


Severity: High
Vulnerability Published: 2004-02-25
Patch Published: 2004-02-25
CVE [?]: CVE-2004-0330
CPE [?]: cpe:/a:serv-u:serv-u

Synopsis

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

Description

The remote host is running Serv-U FTP server.

There is a bug in the way this server handles arguments to the MDTM requests that could allow an attacker to trigger a buffer overflow in this server and disable it remotely or potentially execute arbitrary code on the host.

Solution

Upgrade to Serv-U 5.0.0.4 or later.

Public Exploits


Target Network Port(s): 21
Target Asset(s): Services/ftp
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 Serv-U MDTM Command Overflow vulnerability:

  1. Metasploit: exploit/windows/ftp/servu_mdtm
    [Serv-U FTPD MDTM Overflow]
  2. Exploit-DB: exploits/windows/remote/16715.rb
    [EDB-16715: RhinoSoft Serv-U FTPd Server - MDTM 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 ftp_servu_mdtm_overflow.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(12080);
 script_cve_id("CVE-2004-0330");
 script_bugtraq_id(9751);
 script_xref(name:"Secunia", value:"10989");
 script_version ("1.25");
 
 script_name(english:"Serv-U MDTM Command Overflow");
 script_summary(english:"Serv-U Stack Overflow");

 script_set_attribute(attribute:"synopsis", value:
"The remote FTP server is affected by a buffer overflow vulnerability." );
 script_set_attribute(attribute:"description", value:
"The remote host is running Serv-U FTP server.

There is a bug in the way this server handles arguments to the MDTM 
requests that could allow an attacker to trigger a buffer overflow 
in this server and disable it remotely or potentially execute 
arbitrary code on the host." );
 script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2004/Feb/646" );
 script_set_attribute(attribute:"solution", value:
"Upgrade to Serv-U 5.0.0.4 or later." );
 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:'Serv-U FTPD MDTM Overflow');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
 script_set_attribute(attribute:"plugin_publication_date", value: "2004/02/26");
 script_set_attribute(attribute:"patch_publication_date", value: "2004/02/25");
 script_set_attribute(attribute:"vuln_publication_date", value: "2004/02/25");
 script_cvs_date("Date: 2018/11/15 20:50:22");
 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_set_attribute(attribute:"cpe",value:"cpe:/a:serv-u:serv-u");
 script_end_attributes();

 script_category(ACT_MIXED_ATTACK);
 script_family(english:"FTP");
 
 script_copyright(english:"This script is Copyright (C) 2004-2018 Tenable Network Security, Inc.");
		  
 script_dependencie("ftpserver_detect_type_nd_version.nasl", "ftp_anonymous.nasl");
 script_require_keys("ftp/servu");
 script_require_ports("Services/ftp", 21);

 exit(0);
}

include("audit.inc");
include("misc_func.inc");
include("global_settings.inc");
include("ftp_func.inc");

port = get_ftp_port(default: 21);

banner = get_ftp_banner(port:port);
if ( ! banner ) exit(0, "Unable to grab FTP banner for server on port " + port + ".");

matches = eregmatch(
  pattern:"^.*Serv-U FTP( |-Server | Server )v[ ]*(([0-9a-z-]+\.)+[0-9a-z]+)(.*$|$)", 
  string:banner, 
  icase:TRUE
);
if(isnull(matches) || isnull(matches[2]))
  exit(0, "Remote FTP server on port " + port + " is not Serv-U FTP.");

version = matches[2];

login = get_kb_item("ftp/login");
password = get_kb_item("ftp/password");

if (!login || safe_checks()) {
  if(egrep(pattern:"Serv-U FTP[- ]Server v([0-3]|4\.[0-2])($|[^0-9])", string:banner)) {
    if(report_verbosity > 0)
   { 
     report =
     '\n  Installed Version : ' + version + 
     '\n  Fixed Version     : 5.0.0.4' +
     '\n' + 
     '\nNote that Nessus has determined the vulnerability exists on the remote' +
     '\nhost simply by looking at the software\'s banner.  To really check for' + 
     '\nthe vulnerability, disable safe_checks and re-run the scan.\n';
     security_hole(port:port, extra:report);
   }
   else security_hole(port);
   exit(0);
 }
 else audit(AUDIT_LISTEN_NOT_VULN, "Serv-U FTP", port, version); 
}
login = get_kb_item("ftp/login");
password = get_kb_item("ftp/password");

if(login)
{
 soc = open_sock_tcp(port);
 if (!soc) exit(1, "Failed to open a socket on port "+port+".");
 
 to = get_read_timeout();

 if (! ftp_authenticate(socket:soc, user:login,pass:password))
   exit(1, "Could not log into the remote FTP server on port "+port+".");
 crp = crap(data:"a", length:2000);
 req = string("MDTM  ", crp, "\r\n");
 send(socket:soc, data:req);
 
 vuln = TRUE;
 
 for (i=0; i<5; i++)
 {
   r = recv_line(socket:soc, length:4096, timeout:to);
   if(r)
   {
     vuln = FALSE;
     break;
   }
   sleep(1);
 }
 ftp_close(socket: soc);

 if(vuln)
 {
  if(report_verbosity > 0)
  {
    report =
    '\nNessus confirmed the vulnerability since it failed to receive any' +
    '\ndata from the server after 5 attempts post exploitation.\n';
    security_hole(extra:report, port:port);
  }
  else security_hole(port);
  exit(0);
 }
 else audit(AUDIT_LISTEN_NOT_VULN, "Serv-U FTP", port, version); 
}
else exit(0, "No login credentials available to test vulnerability for " + 
             "FTP server on port " + port + "."); 

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

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

Go back to menu.

How to Run


Here is how to run the Serv-U MDTM Command 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 FTP plugin family.
  6. On the right side table select Serv-U MDTM Command Overflow plugin ID 12080.
  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 ftp_servu_mdtm_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: Secunia Advisory: See also: Similar and related Nessus plugins:
  • 50811 - FTP Server Traversal Arbitrary File Access (RETR)
  • 10084 - Multiple FTP Server Command Handling Overflow
  • 12037 - Serv-U SITE CHMOD Command Multiple Vulnerabilities
  • 53847 - FTP Service AUTH TLS Plaintext Command Injection
  • 11112 - FTP Server Traversal Arbitrary File Access
  • 146308 - Serv-U FTP Server < 15.2.2 Hotfix 1 Arbitrary File Read/Write
  • 151646 - Serv-U FTP Server <= 15.2.3 Hotfix 1 Memory Escape Vulnerability
  • 34398 - Serv-U 7.x < 7.3.0.1 Multiple Remote Vulnerabilities (DoS, Traversal)
  • 36035 - Serv-U < 8.0.0.1 Multiple Vulnerabilities (DoS, Traversal)
  • 42934 - Serv-U < 9.1.0.0
  • 32032 - Red Hat Administration Server (redhat-ds-admin) Multiple Remote Vulnerabilities
  • 25424 - SNMPc Management Server Login Packet Remote DoS
  • 77704 - Usermin 'miniserv.pl' Arbitrary File Disclosure
  • 108549 - Webmin < 1.250 miniserv.pl Remote Code Execution
  • 21785 - Webmin 'miniserv.pl' Arbitrary File Disclosure
  • 20343 - Webmin 'miniserv.pl' 'username' Parameter Format String
  • 14195 - 4D WebStar Pre-authentication FTP Overflow
  • 15628 - Ability FTP Server Multiple Command Remote Buffer Overflows
  • 11205 - WarFTPd CWD/MKD Command Overflow
  • 11207 - WarFTPd USER/PASS Command Remote Overflow
  • 24021 - Easy File Sharing FTP Server PASS Command Overflow
  • 18627 - GlobalSCAPE Secure FTP Server User Input Overflow
  • 18402 - Hummingbird InetD FTP Component (ftpdw.exe) Command Overflow
  • 40825 - MS09-053: Microsoft IIS FTPd NLST Command Remote Buffer Overflow (975191) (uncredentialed check)
  • 18142 - Intersoft NetTerm Netftpd USER Command Remote Overflow
  • 17718 - ProFTPD < 1.3.1rc1 mod_ctrls Module pr_ctrls_recv_request Function Local Overflow
  • 51366 - ProFTPD < 1.3.3d 'mod_sql' Buffer Overflow
  • 70446 - ProFTPD TELNET IAC Escape Sequence Remote Buffer Overflow
  • 15704 - SlimFTPd Multiple Command Handling Overflow
  • 15857 - WS_FTP Server Multiple Command Remote Overflow DoS

Version


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

Go back to menu.