Cacti Local File Inclusion Vulnerability - Nessus

High   Plugin ID: 18546

This page contains detailed information about the Cacti Local File Inclusion Vulnerability Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 18546
Name: Cacti Local File Inclusion Vulnerability
Filename: cacti_086e.nasl
Vulnerability Published: 2005-06-22
This Plugin Published: 2005-06-22
Last Modification Time: 2022-04-11
Plugin Version: 1.31
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: cacti_detect.nasl
Required KB Items [?]: www/cacti

Vulnerability Information


Severity: High
Vulnerability Published: 2005-06-22
Patch Published: 2005-06-22
CVE [?]: CVE-2005-1524, CVE-2005-1525, CVE-2005-1526
CPE [?]: cpe:/a:cacti:cacti

Synopsis

The remote web server is running a PHP application that is affected by a local file inclusion vulnerability.

Description

The Cacti application running on the remote web server is affected by a local file inclusion vulnerability due to improperly validating user-supplied input to the 'config[include_path]' parameter in 'config_settings.php'. A remote attacker can exploit this to execute arbitrary PHP code.

Solution

Upgrade to Cacti 0.8.6e or later.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Cacti Local File Inclusion Vulnerability vulnerability:

  1. Metasploit: exploit/unix/webapp/cacti_graphimage_exec
    [Cacti graph_view.php Remote Command Execution]

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.

Risk Information


CVSS V2 Vector [?]: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:H/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.5 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.5 (Medium)

Go back to menu.

Plugin Source


This is the cacti_086e.nasl nessus plugin source code. This script is Copyright (C) 2005-2022 Tenable Network Security, Inc.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

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

  script_cve_id("CVE-2005-1524", "CVE-2005-1525", "CVE-2005-1526");
  script_bugtraq_id(
    14027,
    14028,
    14030,
    14042,
    14128,
    14129
  );

  script_name(english:"Cacti Local File Inclusion Vulnerability");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server is running a PHP application that is affected by
a local file inclusion vulnerability.");
  script_set_attribute(attribute:"description", value:
"The Cacti application running on the remote web server is affected by
a local file inclusion vulnerability due to improperly validating
user-supplied input to the 'config[include_path]' parameter in
'config_settings.php'. A remote attacker can exploit this to execute
arbitrary PHP code.");
  script_set_attribute(attribute:"see_also", value:"http://www.cacti.net/release_notes_0_8_6e.php");
  script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/403174/30/0/threaded");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Cacti 0.8.6e or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:H/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:'Cacti graph_view.php Remote Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2005/06/22");
  script_set_attribute(attribute:"patch_publication_date", value:"2005/06/22");
  script_set_attribute(attribute:"plugin_publication_date", value:"2005/06/22");

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

  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");

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

  script_dependencies("cacti_detect.nasl");
  script_require_keys("www/cacti");
  script_require_ports("Services/www", 80);

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");
include("http.inc");
include("webapp_func.inc");

get_install_count(app_name:'cacti', exit_if_zero:TRUE);

port = get_http_port(default:80, php:TRUE);
install = get_install_from_kb(appname:'cacti', port:port, exit_on_fail:TRUE);


  # Try to exploit one of the file include flaws.
  dir = install['dir'];
  r = http_send_recv3(
    method:"GET",
    port: port,
    item:string(dir, "/include/config_settings.php?", "config[include_path]=/etc/passwd%00"),
    exit_on_fail:TRUE
  );

  res = r[2];

  # There's a problem if we get the password file.
  if (egrep(string:res, pattern:"root:.+:0:[01]:")) {
    security_hole(port);
    exit(0);
  }
  else audit(AUDIT_WEB_APP_NOT_AFFECTED, 'Cacti', build_url(qs:dir, 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/cacti_086e.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\cacti_086e.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/cacti_086e.nasl

Go back to menu.

How to Run


Here is how to run the Cacti Local File Inclusion Vulnerability 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 CGI abuses plugin family.
  6. On the right side table select Cacti Local File Inclusion Vulnerability plugin ID 18546.
  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 cacti_086e.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 81601 - Cacti < 0.8.6e Multiple Vulnerabilities
  • 23963 - Cacti cmd.php Multiple Parameter SQL Injection Arbitrary Command Execution
  • 23964 - Cacti copy_cacti_user.php template_user Variable SQL Injection
  • 82187 - Debian DLA-40-1 : cacti security update
  • 22573 - Debian DSA-1031-1 : cacti - several vulnerabilities
  • 44819 - Debian DSA-1954-1 : cacti - insufficient input sanitising
  • 77287 - Debian DSA-3007-1 : cacti - security update
  • 44878 - Fedora 12 : cacti-0.8.7e-3.fc12 (2009-12560)
  • 43602 - Fedora 11 : cacti-0.8.7e-3.fc11 (2009-12575)
  • 134435 - Fedora 31 : cacti / cacti-spine (2020-10fe60d68b)
  • 134354 - Fedora 30 : cacti / cacti-spine (2020-552e4e7879)
  • 138865 - Fedora 31 : cacti / cacti-spine (2020-7dddce530c)
  • 138866 - Fedora 32 : cacti / cacti-spine (2020-8a15713da2)
  • 42874 - FreeBSD : cacti -- XSS issues (04104985-d846-11de-84e4-00215af774f0)
  • 139112 - FreeBSD : Cacti -- multiple vulnerabilities (cd2dc126-cfe4-11ea-9172-4c72b94353b5)
  • 135111 - FreeBSD : cacti -- multiple vulnerabilities (e2b564fc-7462-11ea-af63-38d547003487)
  • 21231 - GLSA-200604-07 : Cacti: Multiple vulnerabilities in included ADOdb
  • 92349 - GLSA-201607-05 : Cacti: Multiple vulnerabilities
  • 136215 - GLSA-202004-16 : Cacti: Multiple vulnerabilities
  • 138926 - GLSA-202007-03 : Cacti: Multiple vulnerabilities
  • 138985 - openSUSE Security Update : cacti / cacti-spine (openSUSE-2020-1060)
  • 136073 - openSUSE Security Update : cacti / cacti-spine (openSUSE-2020-558)
  • 43025 - openSUSE Security Update : cacti (cacti-1627)

Version


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

Go back to menu.