vBulletin misc.php template Parameter PHP Code Injection - Nessus

Medium   Plugin ID: 17211

This page contains detailed information about the vBulletin misc.php template Parameter PHP Code Injection Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 17211
Name: vBulletin misc.php template Parameter PHP Code Injection
Filename: vbulletin_code_execution.nasl
Vulnerability Published: 2005-02-22
This Plugin Published: 2005-02-24
Last Modification Time: 2022-04-11
Plugin Version: 1.21
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: vbulletin_detect.nasl
Required KB Items [?]: www/vBulletin
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: Medium
Vulnerability Published: 2005-02-22
Patch Published: N/A
CVE [?]: CVE-2005-0511
CPE [?]: cpe:/a:vbulletin:vbulletin

Synopsis

The remote web server contains a PHP script that allows execution of arbitrary PHP code.

Description

The remote version of vBulletin fails to sanitize input to the 'template' parameter of the 'misc.php' script. Provided the 'Add Template Name in HTML Comments' setting in vBulletin is enabled, an unauthenticated attacker may use this flaw to execute arbitrary PHP commands on the remote host.

Solution

Upgrade to vBulletin 3.0.7 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 vBulletin misc.php template Parameter PHP Code Injection vulnerability:

  1. Metasploit: exploit/unix/webapp/php_vbulletin_template
    [vBulletin misc.php Template Name Arbitrary Code Execution]
  2. Exploit-DB: exploits/php/webapps/16896.rb
    [EDB-16896: vBulletin - 'misc.php' Template Name Arbitrary Code 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:H/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:5.1 (Medium)
Impact Subscore:6.4
Exploitability Subscore:4.9
CVSS Temporal Score:4.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:4.2 (Medium)

Go back to menu.

Plugin Source


This is the vbulletin_code_execution.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(17211);
  script_version("1.21");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2005-0511");
  script_bugtraq_id(12622);

  script_name(english:"vBulletin misc.php template Parameter PHP Code Injection");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a PHP script that allows execution of
arbitrary PHP code.");
  script_set_attribute(attribute:"description", value:
"The remote version of vBulletin fails to sanitize input to the
'template' parameter of the 'misc.php' script.  Provided the 'Add
Template Name in HTML Comments' setting in vBulletin is enabled, an
unauthenticated attacker may use this flaw to execute arbitrary PHP
commands on the remote host.");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2005/Feb/542");
  script_set_attribute(attribute:"solution", value:
"Upgrade to vBulletin 3.0.7 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:H/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:'vBulletin misc.php Template Name Arbitrary Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2005/02/22");
  script_set_attribute(attribute:"plugin_publication_date", value:"2005/02/24");

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

  script_dependencies("vbulletin_detect.nasl");
  script_require_keys("www/vBulletin");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80);

  exit(0);
}

# Check starts here
include("global_settings.inc");
include("misc_func.inc");
include("http.inc");

port = get_http_port(default:80);
if ( ! can_host_php(port:port) ) exit(0);


# Test an install.
install = get_kb_item(string("www/", port, "/vBulletin"));
if (isnull(install)) exit(0);
matches = eregmatch(string:install, pattern:"^(.+) under (/.*)$");
if (!isnull(matches)) {
  dir = matches[2];
  r = http_send_recv3(method:"GET",item:dir + "/misc.php?do=page&template={${phpinfo()}}", port:port);
  if (isnull(r)) exit(0);
  res = r[2];
  if ( "<title>phpinfo()</title>" >< res ) security_warning(port);
}

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

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

Go back to menu.

How to Run


Here is how to run the vBulletin misc.php template Parameter PHP Code Injection 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 vBulletin misc.php template Parameter PHP Code Injection plugin ID 17211.
  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 vbulletin_code_execution.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 139457 - vBulletin CVE-2019-16759 Bypass Remote Code Execution (CVE-2020-17496) (direct check)
  • 136613 - vBulletin 'getIndexableContent' SQL Injection (direct check)
  • 130168 - vBulletin 'widget_php' Command Execution

Version


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

Go back to menu.