Serv-U SITE CHMOD Command Multiple Vulnerabilities - Nessus

High   Plugin ID: 12037

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

Plugin Overview


ID: 12037
Name: Serv-U SITE CHMOD Command Multiple Vulnerabilities
Filename: ftp_servu_overflow.nasl
Vulnerability Published: 2004-01-24
This Plugin Published: 2004-02-02
Last Modification Time: 2022-04-11
Plugin Version: 1.34
Plugin Type: remote
Plugin Family: FTP
Dependencies: find_service1.nasl, ftp_anonymous.nasl, ftpserver_detect_type_nd_version.nasl
Required KB Items [?]: ftp/servu

Vulnerability Information


Severity: High
Vulnerability Published: 2004-01-24
Patch Published: 2004-01-24
CVE [?]: CVE-2004-2111, CVE-2004-2533
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 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.

Solution

Upgrade to Serv-U FTP Server version 4.2 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 SITE CHMOD Command Multiple Vulnerabilities vulnerability:

  1. Metasploit: exploit/windows/ftp/servu_chmod
    [Serv-U FTP Server Buffer Overflow]
  2. Exploit-DB: exploits/windows/remote/18190.rb
    [EDB-18190: RhinoSoft Serv-U FTPd Server < 4.2 - Remote 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:M/Au:S/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:8.5 (High)
Impact Subscore:10.0
Exploitability Subscore:6.8
CVSS Temporal Score:7.0 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.0 (High)

Go back to menu.

Plugin Source


This is the ftp_servu_overflow.nasl nessus plugin source code. This script is Copyright (C) 2004-2022 Astharot

#%NASL_MIN_LEVEL 70300
#
# 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('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(12037);
  script_version("1.34");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  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:"vuln_publication_date", value:"2004/01/24");
  script_set_attribute(attribute:"patch_publication_date", value:"2004/01/24");
  script_set_attribute(attribute:"plugin_publication_date", value:"2004/02/02");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:serv-u:serv-u");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_MIXED_ATTACK);
  script_family(english:"FTP");

  script_copyright(english:"This script is Copyright (C) 2004-2022 Astharot");

  script_dependencies("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 + "."); 

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_overflow.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\ftp_servu_overflow.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/ftp_servu_overflow.nasl

Go back to menu.

How to Run


Here is how to run the Serv-U SITE CHMOD Command Multiple Vulnerabilities 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 SITE CHMOD Command Multiple Vulnerabilities plugin ID 12037.
  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_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a ftp_servu_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_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_overflow.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 50811 - FTP Server Traversal Arbitrary File Access (RETR)
  • 10084 - Multiple FTP Server Command Handling Overflow
  • 12080 - Serv-U MDTM Command Overflow
  • 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

Version


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

Go back to menu.