F5 Networks rsync RCE - Nessus

High   Plugin ID: 78427

This page contains detailed information about the F5 Networks rsync RCE Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 78427
Name: F5 Networks rsync RCE
Filename: f5_rsync_rce.nasl
Vulnerability Published: 2014-08-28
This Plugin Published: 2014-10-14
Last Modification Time: 2018-07-11
Plugin Version: 1.5
Plugin Type: remote
Plugin Family: Misc.
Dependencies: rsync_writeable.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2014-08-28
Patch Published: 2014-08-28
CVE [?]: CVE-2014-2927
CPE [?]: cpe:/h:f5:big-ip

Synopsis

The remote host is running a rsync daemon that allows a user to upload arbitrary files.

Description

The rsync daemon on the remote F5 Networks host is affected by an authentication bypass vulnerability when configured in failover mode. An unauthenticated, remote attacker can exploit this, via a cmi request to the ConfigSync IP address, to read or write arbitrary files.

Nessus was able to confirm that a module on the remote rsync daemon allows writing files to the root of the file system. An attacker can overwrite '/root/.ssh/authorized_keys' and obtain ssh access, allowing the execution of arbitrary code with the privileges of the root user.

Solution

Disable the rsync daemon.

Public Exploits


Target Network Port(s): 873
Target Asset(s): Services/rsyncd
Exploit Available: True (Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the F5 Networks rsync RCE vulnerability:

  1. Exploit-DB: exploits/hardware/remote/34465.txt
    [EDB-34465: F5 Big-IP - rsync Access]
  2. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/34465.pdf
    [EDB-34465]

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

Go back to menu.

Plugin Source


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

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

include("compat.inc");

if (description)
{
  script_id(78427);
  script_version("1.5");
  script_cvs_date("Date: 2018/07/11 17:09:26");

  script_cve_id("CVE-2014-2927");
  script_bugtraq_id(69461);
  script_xref(name:"EDB-ID", value:"34465");

  script_name(english:"F5 Networks rsync RCE");
  script_summary(english:"Checks for writeable rsync modules.");

  script_set_attribute(attribute:"synopsis", value:
"The remote host is running a rsync daemon that allows a user to upload
arbitrary files.");
  script_set_attribute(attribute:"description", value:
"The rsync daemon on the remote F5 Networks host is affected by an
authentication bypass vulnerability when configured in failover mode.
An unauthenticated, remote attacker can exploit this, via a cmi
request to the ConfigSync IP address, to read or write arbitrary
files.

Nessus was able to confirm that a module on the remote rsync daemon
allows writing files to the root of the file system. An attacker can
overwrite '/root/.ssh/authorized_keys' and obtain ssh access, allowing
the execution of arbitrary code with the privileges of the root user.");
  # http://support.f5.com/kb/en-us/solutions/public/15000/200/sol15236.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?c5d7c6b5");
  # http://www.security-assessment.com/files/documents/advisory/F5_Unauthenticated_rsync_access_to_Remote_Root_Code_Execution.pdf
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?7c390e25");
  script_set_attribute(attribute:"solution", value:
"Disable the rsync daemon.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/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:"2014/08/28");
  script_set_attribute(attribute:"patch_publication_date", value:"2014/08/28");
  script_set_attribute(attribute:"plugin_publication_date", value:"2014/10/14");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/h:f5:big-ip");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Misc.");

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

  script_dependencies("rsync_writeable.nasl");
  script_require_ports("Services/rsyncd", 873);

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");
include("byte_func.inc");
include("string.inc");
include("rsync.inc");

port = get_service(svc:"rsyncd", default:873, exit_on_fail:TRUE);

modules = get_kb_list_or_exit("rsyncd/" + port + "/writeable/*");

cmi = FALSE;
csync = FALSE;

if (!isnull(modules))
{
  foreach module (modules)
  {
    name = base64_decode(str:module);
    if (name == "cmi") cmi = TRUE;
    else if (name == "csync") csync = TRUE;
  }
}

if (!cmi && !csync) audit(AUDIT_LISTEN_NOT_VULN, "Rsync daemon", port);

# connect and get a file to ensure this is F5
csync_version_file = NULL;
cmi_version_file = NULL;

if (cmi)
{
  soc = rsync_init(port:port);
  if (soc)
  {
    version_file = rsync_get_file(socket:soc, module:"cmi", file_name:"VERSION");
    if ("Product: BIG-IP" >< version_file ||
        "Product: EM" >< version_file ||
        "Product: BIG-IQ" >< version_file)
    {
      cmi_version_file = version_file;
    }
    close(soc);
  }
}

if (csync)
{
  soc = rsync_init(port:port, exit_if_fail:TRUE);
  if (soc)
  {
    version_file = rsync_get_file(socket:soc, module:"csync", file_name:"VERSION");
    if (
      "Product: BIG-IP" >< version_file ||
      "Product: EM" >< version_file ||
      "Product: BIG-IQ" >< version_file
    ) csync_version_file = version_file;

    close(soc);
  }
}

if (!isnull(cmi_version_file) || !isnull(csync_version_file))
{
  if (report_verbosity > 0)
  {
    report = "";
    if (!isnull(cmi_version_file))
    {
      report += 
        '\n' + "Nessus was able to download VERSION from the writeable 'cmi' Rsync module: " +
        '\n' +
        '\n' + cmi_version_file;
    }
    if (!isnull(csync_version_file))
    {
      report += 
        '\n' + "Nessus was able to download VERSION from the writeable 'csync' Rsync module :" +
        '\n' + 
        '\n' + csync_version_file;
    }

    security_hole(port:port, extra:report);
  }
  else security_hole(port);
  exit(0);
}
else audit(AUDIT_HOST_NOT, "F5 Networks");

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

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

Go back to menu.

How to Run


Here is how to run the F5 Networks rsync RCE 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 Misc. plugin family.
  6. On the right side table select F5 Networks rsync RCE plugin ID 78427.
  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 f5_rsync_rce.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 148022 - F5 BIG-IP RCE (CVE-2021-22986)
  • 10820 - F5 Device Default Support Password

Version


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

Go back to menu.