Nagios Core history.cgi Multiple Parameter Buffer Overflow - Nessus

High   Plugin ID: 63563

This page contains detailed information about the Nagios Core history.cgi Multiple Parameter Buffer Overflow Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 63563
Name: Nagios Core history.cgi Multiple Parameter Buffer Overflow
Filename: nagios_core_344.nasl
Vulnerability Published: 2012-12-09
This Plugin Published: 2013-01-16
Last Modification Time: 2022-04-11
Plugin Version: 1.12
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: nagios_core_detect.nasl
Required KB Items [?]: Settings/ParanoidReport
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: High
Vulnerability Published: 2012-12-09
Patch Published: 2013-01-12
CVE [?]: CVE-2012-6096
CPE [?]: cpe:/a:nagios:nagios

Synopsis

The remote web server hosts an application affected by a buffer overflow vulnerability.

Description

The remote web server hosts a version of Nagios Core that is affected by a buffer overflow vulnerability. By sending a specially crafted request using the 'host_name' or 'svc_description' parameter to 'history.cgi', a remote attacker may be able to execute arbitrary code or trigger a denial of service condition.

Solution

Upgrade to Nagios Core 3.4.4 or later.

Public Exploits


Target Network Port(s): 80, 443
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, Core Impact)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Nagios Core history.cgi Multiple Parameter Buffer Overflow vulnerability:

  1. Metasploit: exploit/unix/webapp/nagios3_history_cgi
    [Nagios3 history.cgi Host Command Execution]
  2. Exploit-DB: exploits/multiple/remote/24084.py
    [EDB-24084: Nagios3 - 'history.cgi' Remote Command Execution]
  3. Exploit-DB: exploits/linux/remote/24159.rb
    [EDB-24159: Nagios3 - 'history.cgi' Host Command Execution (Metasploit)]

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:P/I:P/A:P/E:F/RL:OF/RC:ND
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)

Go back to menu.

Plugin Source


This is the nagios_core_344.nasl nessus plugin source code. This script is Copyright (C) 2013-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

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

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

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

  script_cve_id("CVE-2012-6096");
  script_bugtraq_id(56879);
  script_xref(name:"EDB-ID", value:"24084");

  script_name(english:"Nagios Core history.cgi Multiple Parameter Buffer Overflow");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts an application affected by a buffer
overflow vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote web server hosts a version of Nagios Core that is affected
by a buffer overflow vulnerability.  By sending a specially crafted
request using the 'host_name' or 'svc_description' parameter to
'history.cgi', a remote attacker may be able to execute arbitrary code
or trigger a denial of service condition.");
  script_set_attribute(attribute:"see_also", value:"https://pastebin.com/FJUNyTaj");
  script_set_attribute(attribute:"see_also", value:"https://www.nagios.org/projects/nagios-core/history/3x/");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Nagios Core 3.4.4 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:F/RL:OF/RC:ND");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Nagios3 history.cgi Host Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/12/09");
  script_set_attribute(attribute:"patch_publication_date", value:"2013/01/12");
  script_set_attribute(attribute:"plugin_publication_date", value:"2013/01/16");

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

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

  script_copyright(english:"This script is Copyright (C) 2013-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("nagios_core_detect.nasl");
  script_require_keys("Settings/ParanoidReport");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80, 443);

  exit(0);
}

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

if (report_paranoia < 2) audit(AUDIT_PARANOID);

port = get_http_port(default:80);

install = get_install_from_kb(appname:"nagios_core", port:port, exit_on_fail:TRUE);
dir = install['dir'];
version = install['ver'];
location = build_url(qs:dir + '/', port:port);

if (version == UNKNOWN_VER) audit(AUDIT_UNKNOWN_WEB_APP_VER, "Nagios Core", location);

item = eregmatch(pattern:"([0-9.]*[0-9])", string:version);
if (isnull(item[1]) || item[1] == "") exit(1, "Failed to parse the version string ('"+version+"').");

fix = "3.4.4";
if (ver_compare(ver:item[1], fix:fix, strict:FALSE) == -1)
{
  if (report_verbosity > 0)
  {
    report =
      '\n  URL               : ' + location +
      '\n  Installed version : ' + version +
      '\n  Fixed version     : 3.4.4' +
      '\n';
    security_hole(port:port, extra:report);
  }
  else security_hole(port);
  exit(0);
}
else audit(AUDIT_WEB_APP_NOT_AFFECTED, "Nagios Core", location, version);

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

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

Go back to menu.

How to Run


Here is how to run the Nagios Core history.cgi Multiple Parameter Buffer Overflow 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 Nagios Core history.cgi Multiple Parameter Buffer Overflow plugin ID 63563.
  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 nagios_core_344.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 64439 - Debian DSA-2616-1 : nagios3 - buffer overflow in CGI scripts
  • 65696 - Debian DSA-2653-1 : icinga - buffer overflow
  • 63658 - Fedora 18 : nagios-3.4.4-1.fc18 (2013-0732)
  • 63659 - Fedora 16 : nagios-3.4.4-1.fc16 (2013-0752)
  • 63660 - Fedora 17 : nagios-3.4.4-1.fc17 (2013-0753)
  • 63470 - FreeBSD : nagios -- buffer overflow in history.cgi (97c22a94-5b8b-11e2-b131-000c299b62e1)
  • 79976 - GLSA-201412-23 : Nagios: Multiple vulnerabilities
  • 74997 - openSUSE Security Update : nagios (openSUSE-SU-2013:0140-1)
  • 75020 - openSUSE Security Update : icinga (openSUSE-SU-2013:0169-1)
  • 75069 - openSUSE Security Update : icinga (openSUSE-SU-2013:0206-1)
  • 64926 - SuSE 11.2 Security Update : nagios (SAT Patch Number 7328)
  • 64927 - SuSE 10 Security Update : nagios (ZYPP Patch Number 8460)
  • 67293 - Fedora 18 : nagios-3.5.0-5.fc18 (2013-10950)
  • 66361 - Nagios NRPE nrpe.c Arbitrary Command Execution
  • 73757 - Nagios NRPE Command Argument Processing Enabled
  • 154935 - Nagios XI < 5.6.6 RCE
  • 157377 - Nagios XI 5.7.5 Command Injection
  • 150056 - Nagios XI < 5.7 Code Injection
  • 153612 - Nagios XI < 5.8.5 Multiple Vulnerabilities
  • 76311 - Ericom AccessNow Server < 3.3.1.4095 Stack-Based Buffer Overflow
  • 69348 - PHP 5.5.x < 5.5.1 xml.c Buffer Overflow
  • 109579 - PHP 7.2.x < 7.2.5 Stack Buffer Overflow
  • 110557 - VX Search HTTP POST Request Handling Remote Stack Buffer Overflow
  • 25681 - SAP DB / MaxDB Web Server DBM_INTERN_TEST Event Buffer Overflow
  • 25117 - XAMPP ADOdb mssql_connect Remote Buffer Overflow

Version


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

Go back to menu.