PHP < 4.4.5 Multiple Vulnerabilities - Nessus

High   Plugin ID: 24906

This page contains detailed information about the PHP < 4.4.5 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: 24906
Name: PHP < 4.4.5 Multiple Vulnerabilities
Filename: php_4_4_5.nasl
Vulnerability Published: 2007-02-09
This Plugin Published: 2007-04-02
Last Modification Time: 2022-04-11
Plugin Version: 1.27
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: php_version.nasl
Required KB Items [?]: www/PHP

Vulnerability Information


Severity: High
Vulnerability Published: 2007-02-09
Patch Published: N/A
CVE [?]: CVE-2006-4625, CVE-2007-0905, CVE-2007-0906, CVE-2007-0907, CVE-2007-0908, CVE-2007-0909, CVE-2007-0910, CVE-2007-0988, CVE-2007-1286, CVE-2007-1376, CVE-2007-1378, CVE-2007-1379, CVE-2007-1380, CVE-2007-1700, CVE-2007-1701, CVE-2007-1777, CVE-2007-1825, CVE-2007-1835, CVE-2007-1884, CVE-2007-1885, CVE-2007-1886, CVE-2007-1887, CVE-2007-1890
CPE [?]: cpe:/a:php:php

Synopsis

The remote web server uses a version of PHP that is affected by multiple flaws.

Description

According to its banner, the version of PHP installed on the remote host is older than 4.4.5. Such versions may be affected by several issues, including buffer overflows, format string vulnerabilities, arbitrary code execution, 'safe_mode' and 'open_basedir' bypasses, and clobbering of super-globals.

Solution

Upgrade to PHP version 4.4.5 or later.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: No exploit is required

Here's the list of publicly known exploits and PoCs for verifying the PHP < 4.4.5 Multiple Vulnerabilities vulnerability:

  1. Metasploit: exploit/multi/php/php_unserialize_zval_cookie
    [PHP 4 unserialize() ZVAL Reference Counter Overflow (Cookie)]
  2. Exploit-DB: exploits/php/remote/9939.rb
    [EDB-9939: PHP < 4.5.0 - Unserialize Overflow (Metasploit)]
  3. Exploit-DB: exploits/multiple/remote/16310.rb
    [EDB-16310: PHP 4 - Unserialize() ZVAL Reference Counter Overflow (Cookie) (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:C
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 php_4_4_5.nasl nessus plugin source code. This script is Copyright (C) 2007-2022 Tenable Network Security, Inc.

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

if (NASL_LEVEL < 3000) exit(0);

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

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

  script_cve_id(
    "CVE-2006-4625",
    "CVE-2007-0905",
    "CVE-2007-0906",
    "CVE-2007-0907",
    "CVE-2007-0908",
    "CVE-2007-0909",
    "CVE-2007-0910",
    "CVE-2007-0988",
    "CVE-2007-1286",
    "CVE-2007-1376",
    "CVE-2007-1378",
    "CVE-2007-1379",
    "CVE-2007-1380",
    "CVE-2007-1700",
    "CVE-2007-1701",
    "CVE-2007-1777",
    "CVE-2007-1825",
    "CVE-2007-1835",
    "CVE-2007-1884",
    "CVE-2007-1885",
    "CVE-2007-1886",
    "CVE-2007-1887",
    "CVE-2007-1890"
  );
  script_bugtraq_id(
    22496,
    22805,
    22806,
    22833,
    22862,
    23119,
    23120,
    23169,
    23219,
    23233,
    23234,
    23235,
    23236
  );

  script_name(english:"PHP < 4.4.5 Multiple Vulnerabilities");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server uses a version of PHP that is affected by
multiple flaws.");
  script_set_attribute(attribute:"description", value:
"According to its banner, the version of PHP installed on the remote
host is older than 4.4.5.  Such versions may be affected by several
issues, including buffer overflows, format string vulnerabilities,
arbitrary code execution, 'safe_mode' and 'open_basedir' bypasses, and
clobbering of super-globals.");
  script_set_attribute(attribute:"see_also", value:"http://www.php.net/releases/4_4_5.php");
  script_set_attribute(attribute:"solution", value:
"Upgrade to PHP version 4.4.5 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:C");

  script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
  script_set_attribute(attribute:"exploit_available", value:"false");
  script_set_attribute(attribute:"metasploit_name", value:'PHP 4 unserialize() ZVAL Reference Counter Overflow (Cookie)');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_cwe_id(20, 399);

  script_set_attribute(attribute:"vuln_publication_date", value:"2007/02/09");
  script_set_attribute(attribute:"plugin_publication_date", value:"2007/04/02");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:php:php");
  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) 2007-2022 Tenable Network Security, Inc.");

  script_dependencies("php_version.nasl");
  script_require_keys("www/PHP");
  script_require_ports("Services/www", 80);

  exit(0);
}


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

port = get_http_port(default:80, php:TRUE);

php = get_php_from_kb(
  port : port,
  exit_on_fail : TRUE
);

version = php["ver"];
source = php["src"];

backported = get_kb_item('www/php/'+port+'/'+version+'/backported');

if (report_paranoia < 2 && backported)
  audit(AUDIT_BACKPORT_SERVICE, port, "PHP "+version+" install");

if (version =~ "^3\." ||
    version =~ "^4\.[0-3]\." ||
    version =~ "^4\.4\.[0-4]($|[^0-9])"
)
{
  if (report_verbosity > 0)
  {
    report =
      '\n  Version source     : '+source +
      '\n  Installed version  : '+version+
      '\n  Fixed version      : 4.4.5\n';
    security_hole(port:port, extra:report);
  }
  else security_hole(port);
  exit(0);
}
else audit(AUDIT_LISTEN_NOT_VULN, "PHP", port, version);

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

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

Go back to menu.

How to Run


Here is how to run the PHP < 4.4.5 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 CGI abuses plugin family.
  6. On the right side table select PHP < 4.4.5 Multiple Vulnerabilities plugin ID 24906.
  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 php_4_4_5.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: CWE | Common Weakness Enumeration:
  • CWE-20 (Weakness) Improper Input Validation
  • CWE-399 (Category) Resource Management Errors
See also: Similar and related Nessus plugins:
  • 25043 - CentOS 3 / 4 : php (CESA-2007:0155)
  • 25099 - Debian DSA-1282-1 : php4 - several vulnerabilities
  • 25100 - Debian DSA-1283-1 : php5 - several vulnerabilities
  • 78215 - F5 Networks BIG-IP : Multiple PHP vulnerabilities (SOL7859)
  • 27759 - Fedora 7 : php-5.2.4-1.fc7 (2007-2215)
  • 24887 - GLSA-200703-21 : PHP: Multiple vulnerabilities
  • 25340 - GLSA-200705-19 : PHP: Multiple vulnerabilities
  • 26942 - GLSA-200710-02 : PHP: Multiple vulnerabilities
  • 24570 - Mandrake Linux Security Advisory : php (MDKSA-2006:185)
  • 67471 - Oracle Linux 3 / 4 : php (ELSA-2007-0155)
  • 31649 - PHP 5.x < 5.2 Multiple Vulnerabilities
  • 25368 - PHP < 5.2.3 Multiple Vulnerabilities
  • 25067 - RHEL 2.1 : php (RHSA-2007:0154)
  • 25068 - RHEL 3 / 4 : php (RHSA-2007:0155)
  • 29375 - SuSE 10 Security Update : PHP (ZYPP Patch Number 2152)
  • 27147 - openSUSE 10 Security Update : apache2-mod_php5 (apache2-mod_php5-2153)
  • 27391 - openSUSE 10 Security Update : php5 (php5-3745)
  • 27392 - openSUSE 10 Security Update : php5 (php5-3753)
  • 29552 - SuSE 10 Security Update : PHP5 (ZYPP Patch Number 3754)
  • 27942 - Ubuntu 5.04 / 5.10 / 6.06 LTS : php4, php5 vulnerabilities (USN-362-1)

Version


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

Go back to menu.