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

047910
CVSS 8.5 - HIGH
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
SINGLE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
solarwinds
CWE-119
nessus
exploit available
metasploit

Summary

Stack-based buffer overflow in the site chmod command in Serv-U FTP Server before 4.2 allows remote attackers to execute arbitrary code via a long filename.

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

  • descriptionServ-U 4.x "site chmod" Remote Buffer Overflow Exploit. CVE-2004-2111. Remote exploit for windows platform
    idEDB-ID:822
    last seen2016-01-31
    modified2004-01-30
    published2004-01-30
    reporterSkylined
    sourcehttps://www.exploit-db.com/download/822/
    titleServ-U 4.x "site chmod" Remote Buffer Overflow Exploit
  • descriptionRhinoSoft Serv-U FTP Server 3/4 MDTM Command Stack Overflow Vulnerability (2). CVE-2004-2111. Remote exploit for windows platform
    idEDB-ID:23592
    last seen2016-02-02
    modified2004-01-25
    published2004-01-25
    reporter[email protected]
    sourcehttps://www.exploit-db.com/download/23592/
    titleRhinoSoft Serv-U FTP Server 3/4 MDTM Command Stack Overflow Vulnerability 2
  • descriptionServ-U FTP Server. CVE-2004-2111. Remote exploit for windows platform
    idEDB-ID:18190
    last seen2016-02-02
    modified2011-12-02
    published2011-12-02
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/18190/
    titleServ-U FTP Server < 4.2 - Buffer Overflow
  • descriptionServ-U FTPD 3.x/4.x "SITE CHMOD" Command Remote Exploit. CVE-2004-2111. Remote exploit for windows platform
    idEDB-ID:149
    last seen2016-01-31
    modified2004-01-27
    published2004-01-27
    reporterlion
    sourcehttps://www.exploit-db.com/download/149/
    titleServ-U FTPD 3.x/4.x "SITE CHMOD" Command Remote Exploit
  • descriptionRhinoSoft Serv-U FTP Server 3/4 MDTM Command Stack Overflow Vulnerability (1). CVE-2004-2111. Remote exploit for windows platform
    idEDB-ID:23591
    last seen2016-02-02
    modified2004-01-24
    published2004-01-24
    reportermandragore
    sourcehttps://www.exploit-db.com/download/23591/
    titleRhinoSoft Serv-U FTP Server 3/4 MDTM Command Stack Overflow Vulnerability 1

Metasploit

descriptionThis module exploits a stack buffer overflow in the site chmod command in versions of Serv-U FTP Server prior to 4.2. You must have valid credentials to trigger this vulnerability. Exploitation also leaves the service in a non-functional state.
idMSF:EXPLOIT/WINDOWS/FTP/SERVU_CHMOD
last seen2020-01-15
modified2017-07-24
published2011-11-30
referenceshttps://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-2111
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/ftp/servu_chmod.rb
titleServ-U FTP Server Buffer Overflow

Nessus

NASL familyFTP
NASL idFTP_SERVU_OVERFLOW.NASL
descriptionThe remote host is running Serv-U FTP Server. There is a bug in the way the server handles arguments to the SITE CHMOD requests that could allow an attacker to trigger a buffer overflow or corrupt memory in the server and disable it remotely or to potentially execute arbitrary code on the host. Note that successful exploitation requires access to a writable directory and will result in code running with Administrator or SYSTEM privileges by default.
last seen2020-06-01
modified2020-06-02
plugin id12037
published2004-02-02
reporterThis script is Copyright (C) 2004-2018 Astharot
sourcehttps://www.tenable.com/plugins/nessus/12037
titleServ-U SITE CHMOD Command Multiple Vulnerabilities
code
#
# Written by Astharot <[email protected]>
# 
# Changes by Tenable:
# - Revised plugin title, enhanced description (2/03/2009)
# - Modernized plugin, check for server response multiple times before finding vulnerable (6/28/2013)


include("compat.inc");

if(description)
{
 script_id(12037);
 script_version ("1.33");

 script_cve_id("CVE-2004-2111", "CVE-2004-2533");
 script_bugtraq_id(9483, 9675);
 
 script_name(english:"Serv-U SITE CHMOD Command Multiple Vulnerabilities");
	     
 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 the server handles arguments to the SITE
CHMOD requests that could allow an attacker to trigger a buffer 
overflow or corrupt memory in the server and disable it remotely 
or to potentially execute arbitrary code on the host. 

Note that successful exploitation requires access to a writable
directory and will result in code running with Administrator or SYSTEM
privileges by default." );
 script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2004/Jan/249" );
 script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2004/Feb/918" );
 script_set_attribute(attribute:"solution", value:
"Upgrade to Serv-U FTP Server version 4.2 or later." );
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/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 FTP Server Buffer Overflow');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
script_set_attribute(attribute:"plugin_publication_date", value: "2004/02/02");
 script_set_attribute(attribute:"vuln_publication_date", value: "2004/01/24");
 script_cvs_date("Date: 2018/11/15 20:50:22");
 script_set_attribute(attribute:"patch_publication_date", value: "2004/01/24");
 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_set_attribute(attribute:"cpe",value:"cpe:/a:serv-u:serv-u");
 script_end_attributes();
 
 script_summary(english:"Serv-U Stack Overflow");
 script_category(ACT_MIXED_ATTACK);
 script_family(english:"FTP");
 
 script_copyright(english:"This script is Copyright (C) 2004-2018 Astharot");
		  
 script_dependencie("find_service1.nasl", "ftpserver_detect_type_nd_version.nasl", "ftp_anonymous.nasl");
 script_require_keys("ftp/servu");
 script_require_ports("Services/ftp", 21);

 exit(0);
}

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-1])($|[^0-9])", string:banner)) {
    if(report_verbosity > 0)
   { 
     report =
     '\n  Installed Version : ' + version + 
     '\n  Fixed Version     : 4.2' +
     '\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 exit(0, "The Serv-U FTP " +version+ " install listening on port " + port + " is not affected.");
}


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("SITE CHMOD 0666  ", 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 exit(0, "The Serv-U FTP " +version+ " install listening on port " + port + " is not affected.");
}
else exit(0, "No login credentials available to test vulnerability for " + 
             "FTP server on port " + port + "."); 

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/107462/servu_chmod.rb.txt
idPACKETSTORM:107462
last seen2016-12-05
published2011-12-02
reporterThe Light Cosine
sourcehttps://packetstormsecurity.com/files/107462/Serv-U-FTP-Server-Buffer-Overflow.html
titleServ-U FTP Server Buffer Overflow

Saint

bid9675
descriptionServ-U FTP site chmod buffer overflow
idftp_servu
osvdb3713
titleserv_u_site_chmod
typeremote

Seebug

bulletinFamilyexploit
descriptionNo description provided by source.
idSSV:26003
last seen2017-11-19
modified2011-12-02
published2011-12-02
reporterRoot
sourcehttps://www.seebug.org/vuldb/ssvid-26003
titleServ-U FTP Server &lt; 4.2 Buffer Overflow