##################################################################################
#
#  This script was written by David Maciejak <david dot maciejak at kyxar dot fr>
#
#  Ref : lion
#
#
# Updated: 03/12/2009 Antu Sanadi <santu@secpod.com>
#
# This script is released under the GNU GPLv2
#################################################################################

if(description)
{
  script_id(14584);
  script_cve_id("CVE-2004-1643");
  script_bugtraq_id(11065);
  script_version ("$Revision: 7592 $");
  script_tag(name:"cvss_base", value:"5.0");
  script_tag(name:"risk_factor", value:"Medium");
  script_name("WS FTP server DoS");
  desc = "
  According to its version number, the remote WS_FTP server is vulnerable to
  a remote denial of service.

  There is an error in the parsing of file paths.  Exploitation of this flaw
  may cause a vulnerable system to use a large amount of CPU resources.

  Successful exploitation requires that the user has been authenticated.

  ** OpenVAS only checked the version number in the server banner

  Solution : Upgrade to the latest version of this software.
  Risk factor : Medium";

  script_description(desc);
  script_summary("Check WS_FTP server version");
  script_category(ACT_GATHER_INFO);
  script_copyright("This script is Copyright (C) 2004 David Maciejak");
  script_family("FTP");
  script_dependencie("find_service.nes", "secpod_ftp_anonymous.nasl");
  script_require_ports("Services/ftp", 21);
  exit(0);
}


include ("ftp_func.inc");

port = get_kb_item("Services/ftp");
if(!port){
  port = 21;
}

if(! get_port_state(port)){
  exit(0);
}

banner = get_ftp_banner(port);
if(!banner){
  exit(0);
}

# check for the WS_FTP Server 5.0.2 and prior
if(egrep(pattern:"WS_FTP Server ([0-4]\.|5\.[0-2][^0-9])", string:banner)){
  security_warning(port);
}
