Vulnerabilities > CVE-2004-0330 - Improper Restriction of Operations Within the Bounds of A Memory Buffer vulnerability in Solarwinds Serv-U File Server

047910
CVSS 10.0 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
low complexity
solarwinds
CWE-119
critical
nessus
exploit available
metasploit

Summary

Buffer overflow in Serv-U ftp before 5.0.0.4 allows remote authenticated users to execute arbitrary code via a long time zone argument to the MDTM command.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Exploit-Db

  • descriptionRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability (1). CVE-2004-0330. Dos exploit for windows platform
    idEDB-ID:23760
    last seen2016-02-02
    modified2004-02-26
    published2004-02-26
    reportersaintjmf
    sourcehttps://www.exploit-db.com/download/23760/
    titleRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability 1
  • descriptionRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability (3). CVE-2004-0330. Dos exploit for windows platform
    idEDB-ID:23762
    last seen2016-02-02
    modified2004-02-26
    published2004-02-26
    reportershaun2k2
    sourcehttps://www.exploit-db.com/download/23762/
    titleRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability 3
  • descriptionRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability (4). CVE-2004-0330. Remote exploit for windows platform
    idEDB-ID:23763
    last seen2016-02-02
    modified2004-02-26
    published2004-02-26
    reporterlion
    sourcehttps://www.exploit-db.com/download/23763/
    titleRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability 4
  • descriptionServ-U FTPD MDTM Overflow. CVE-2004-0330. Remote exploit for windows platform
    idEDB-ID:16715
    last seen2016-02-02
    modified2010-09-20
    published2010-09-20
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/16715/
    titleServ-U FTPD MDTM Overflow
  • descriptionServ-U FTPD 3.x/4.x/5.x (MDTM) Remote Overflow Exploit. CVE-2004-0330. Remote exploit for windows platform
    idEDB-ID:158
    last seen2016-01-31
    modified2004-02-27
    published2004-02-27
    reporterSam
    sourcehttps://www.exploit-db.com/download/158/
    titleServ-U FTPD 3.x/4.x/5.x MDTM Remote Overflow Exploit
  • descriptionRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability (2). CVE-2004-0330. Dos exploit for windows platform
    idEDB-ID:23761
    last seen2016-02-02
    modified2004-02-26
    published2004-02-26
    reportershaun2k2
    sourcehttps://www.exploit-db.com/download/23761/
    titleRhinoSoft Serv-U FTP Server 3/4/5 MDTM Command Time Argument Buffer Overflow Vulnerability 2

Metasploit

descriptionThis is an exploit for the Serv-U\'s MDTM command timezone overflow. It has been heavily tested against versions 4.0.0.4/4.1.0.0/4.1.0.3/5.0.0.0 with success against nt4/2k/xp/2k3. I have also had success against version 3, but only tested 1 version/os. The bug is in all versions prior to 5.0.0.4, but this exploit will not work against versions not listed above. You only get one shot, but it should be OS/SP independent. This exploit is a single hit, the service dies after the shellcode finishes execution.
idMSF:EXPLOIT/WINDOWS/FTP/SERVU_MDTM
last seen2020-05-23
modified2017-07-24
published2005-12-25
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/ftp/servu_mdtm.rb
titleServ-U FTPD MDTM Overflow

Nessus

NASL familyFTP
NASL idFTP_SERVU_MDTM_OVERFLOW.NASL
descriptionThe 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.
last seen2020-06-01
modified2020-06-02
plugin id12080
published2004-02-26
reporterThis script is Copyright (C) 2004-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/12080
titleServ-U MDTM Command Overflow
code
#
# (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 + "."); 

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/83136/servu_mdtm.rb.txt
idPACKETSTORM:83136
last seen2016-12-05
published2009-11-26
reporterspoonm
sourcehttps://packetstormsecurity.com/files/83136/Serv-U-FTPD-MDTM-Overflow.html
titleServ-U FTPD MDTM Overflow

Saint

bid9751
descriptionServ-U FTP Server MDTM timezone buffer overflow
idftp_servu
osvdb4073
titleserv_u_mdtm_timezone
typeremote