ProFTPD < 1.3.0a Multiple Vulnerabilities - Nessus

Critical   Plugin ID: 27055

This page contains detailed information about the ProFTPD < 1.3.0a 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: 27055
Name: ProFTPD < 1.3.0a Multiple Vulnerabilities
Filename: proftpd_1_3_0_a.nasl
Vulnerability Published: 2006-11-10
This Plugin Published: 2007-10-15
Last Modification Time: 2018-11-15
Plugin Version: 1.24
Plugin Type: remote
Plugin Family: FTP
Dependencies: ftpserver_detect_type_nd_version.nasl
Required KB Items [?]: ftp/proftpd, Settings/ParanoidReport

Vulnerability Information


Severity: Critical
Vulnerability Published: 2006-11-10
Patch Published: N/A
CVE [?]: CVE-2006-5815, CVE-2006-6170, CVE-2006-6171
CPE [?]: cpe:/a:proftpd:proftpd

Synopsis

The remote FTP server is affected by several vulnerabilities.

Description

The remote host is using ProFTPD, a free FTP server for Unix and Linux.

According to its banner, the version of ProFTPD installed on the remote host is earlier than 1.3.0a. As such, it may be affected by one or more of the following vulnerabilities :

- An off-by-one string manipulation flaw exists in the 'sreplace' function. (CVE-2006-5815)

- A buffer overflow exists in the 'tls_x509_name_oneline' function of the mod_tls module involving the data length argument. (CVE-2006-6170)

- An off-by-two buffer overflow exists due to a failure to properly set the buffer size limit when 'CommandBufferSize' is specified in the configuration file, an issue which is disputed by the developers. (CVE-2006-6171)

An attacker may be able to leverage this issue to crash the affected service or execute arbitrary code remotely, subject to the privileges under which the application operates.

Solution

Upgrade to ProFTPD version 1.3.0a or later.

Public Exploits


Target Network Port(s): 21
Target Asset(s): Services/ftp
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the ProFTPD < 1.3.0a Multiple Vulnerabilities vulnerability:

  1. Metasploit: exploit/linux/ftp/proftp_sreplace
    [ProFTPD 1.2 - 1.3.0 sreplace Buffer Overflow (Linux)]
  2. Exploit-DB: exploits/linux/remote/16852.rb
    [EDB-16852: ProFTPd 1.2 < 1.3.0 (Linux) - 'sreplace' Remote Buffer Overflow (Metasploit)]
  3. GitHub: https://github.com/mudongliang/LinuxFlaw/tree/master/CVE-2006-5815
    [CVE-2006-5815]

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:L/Au:N/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.3 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.3 (High)

Go back to menu.

Plugin Source


This is the proftpd_1_3_0_a.nasl nessus plugin source code. This script is Copyright (C) 2007-2018 Tenable Network Security, Inc.

#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(27055);
  script_version("1.24");
  script_cvs_date("Date: 2018/11/15 20:50:22");

  script_cve_id("CVE-2006-5815", "CVE-2006-6170", "CVE-2006-6171");
  script_bugtraq_id(20992);

  script_name(english:"ProFTPD < 1.3.0a Multiple Vulnerabilities");
  script_summary(english:"Checks version number in FTP banner");

  script_set_attribute(attribute:"synopsis", value:"The remote FTP server is affected by several vulnerabilities.");
  script_set_attribute(attribute:"description", value:
"The remote host is using ProFTPD, a free FTP server for Unix and
Linux.

According to its banner, the version of ProFTPD installed on the
remote host is earlier than 1.3.0a. As such, it may be affected by one
or more of the following vulnerabilities :

  - An off-by-one string manipulation flaw exists in the
    'sreplace' function.  (CVE-2006-5815)

  - A buffer overflow exists in the 'tls_x509_name_oneline'
    function of the mod_tls module involving the data
    length argument. (CVE-2006-6170)

  - An off-by-two buffer overflow exists due to a failure
    to properly set the buffer size limit when
    'CommandBufferSize' is specified in the configuration
    file, an issue which is disputed by the developers.
    (CVE-2006-6171)

An attacker may be able to leverage this issue to crash the affected
service or execute arbitrary code remotely, subject to the privileges
under which the application operates.");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2006/Nov/315");
  script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/452760/30/0/threaded");
  script_set_attribute(attribute:"solution", value:"Upgrade to ProFTPD version 1.3.0a or later.");
  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: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:'ProFTPD 1.2 - 1.3.0 sreplace Buffer Overflow (Linux)');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_cwe_id(119);

  script_set_attribute(attribute:"vuln_publication_date", value:"2006/11/10");
  script_set_attribute(attribute:"plugin_publication_date", value:"2007/10/15");

  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_GATHER_INFO);
  script_family(english:"FTP");

  script_copyright(english:"This script is Copyright (C) 2007-2018 Tenable Network Security, Inc.");

  script_dependencies("ftpserver_detect_type_nd_version.nasl");
  script_require_keys("ftp/proftpd", "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);

# Check the version number in the banner.
banner = get_ftp_banner(port:port);
if (banner && "ProFTPD " >< banner)
{
  # Grab the version.
  ver = NULL;

  pat = "^[0-9]{3}[ -]ProFTPD ([0-9][^ ]+) Server";
  matches = egrep(pattern:pat, string:banner);
  foreach match (split(matches))
  {
    match = chomp(match);
    item = eregmatch(pattern:pat, string:match);
    if (!isnull(item))
    {
      ver = item[1];
      break;
    }
  }

  if (ver && ver =~ "^(0\.|1\.([0-2]\.|3\.0($|rc)))")
  {
    report = strcat('\nThe banner reports this is ProFTPD version ', ver, '.\n' );
    security_hole(port:port, extra:report);
  }
}

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/proftpd_1_3_0_a.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\proftpd_1_3_0_a.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/proftpd_1_3_0_a.nasl

Go back to menu.

How to Run


Here is how to run the ProFTPD < 1.3.0a 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 ProFTPD < 1.3.0a Multiple Vulnerabilities plugin ID 27055.
  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 proftpd_1_3_0_a.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a proftpd_1_3_0_a.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - proftpd_1_3_0_a.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 proftpd_1_3_0_a.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: CWE | Common Weakness Enumeration:
  • CWE-119 (Weakness) Improper Restriction of Operations within the Bounds of a Memory Buffer
See also: Similar and related Nessus plugins:
  • 23757 - Debian DSA-1222-2 : proftpd - several vulnerabilities
  • 23952 - FreeBSD : proftpd -- remote code execution vulnerabilities (3f851b22-89fb-11db-a937-003048116330)
  • 23762 - GLSA-200611-26 : ProFTPD: Remote execution of arbitrary code
  • 24602 - Mandrake Linux Security Advisory : proftpd (MDKSA-2006:217-1)
  • 24660 - Slackware 10.0 / 10.1 / 10.2 / 11.0 / 8.1 / 9.0 / 9.1 : proftpd (SSA:2006-335-02)
  • 17718 - ProFTPD < 1.3.1rc1 mod_ctrls Module pr_ctrls_recv_request Function Local Overflow
  • 106750 - ProFTPD 1.3.1 SQL injection protection bypass
  • 50989 - ProFTPD Compromised Source Packages Trojaned Distribution
  • 50544 - ProFTPD < 1.3.3c Multiple Vulnerabilities
  • 51366 - ProFTPD < 1.3.3d 'mod_sql' Buffer Overflow
  • 56956 - ProFTPD < 1.3.3g / 1.3.4 Response Pool Use-After-Free Code Execution
  • 84215 - ProFTPD mod_copy Information Disclosure
  • 106754 - ProFTPD 1.3.4d / 1.3.5rc3 Denial of Service
  • 106755 - ProFTPD < 1.3.5b / 1.3.6x < 1.3.6rc2 weak Diffie-Hellman key
  • 106756 - ProFTPD < 1.3.5e / 1.3.6x < 1.3.6rc5 AllowChrootSymlinks bypass
  • 77986 - GNU Bash Environment Variable Handling Code Injection via ProFTPD (Shellshock)
  • 34265 - ProFTPD Command Truncation Cross-Site Request Forgery
  • 132749 - ProFTPD 'mod_copy' Arbitrary File Copy Vulnerability (Remote)
  • 70446 - ProFTPD TELNET IAC Escape Sequence Remote Buffer Overflow
  • 35690 - ProFTPD Username Variable Substitution SQL Injection

Version


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

Go back to menu.