Vulnerabilities > CVE-2006-0565 - Code Injection vulnerability in Gerrit VAN Aaken Loudblog 0.1/0.2/0.3

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
gerrit-van-aaken
CWE-94
nessus
exploit available

Summary

PHP remote file include vulnerability in inc/backend_settings.php in Loudblog 0.4 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the $GLOBALS[path] parameter.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Manipulating User-Controlled Variables
    This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An attacker can override environment variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the attacker can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.

Exploit-Db

descriptionLoudBlog <= 0.4 (path) Arbitrary Remote Inclusion Exploit. CVE-2006-0565. Webapps exploit for php platform
idEDB-ID:1467
last seen2016-01-31
modified2006-02-03
published2006-02-03
reporterrgod
sourcehttps://www.exploit-db.com/download/1467/
titleLoudBlog <= 0.4 path Arbitrary Remote Inclusion Exploit

Nessus

NASL familyCGI abuses
NASL idLOUDBLOG_CMD_FILE_INCLUDES.NASL
descriptionThe remote host is running Loudblog, a PHP application for publishing podcasts and similar media files. The installed version of Loudblog fails to validate user input to the
last seen2020-06-01
modified2020-06-02
plugin id20861
published2006-02-05
reporterThis script is Copyright (C) 2006-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/20861
titleLoudblog backend_settings.php Multiple Parameter Remote File Inclusion
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description) {
  script_id(20861);
  script_version("1.18");

  script_cve_id("CVE-2006-0565");
  script_bugtraq_id(16495);

  script_name(english:"Loudblog backend_settings.php Multiple Parameter Remote File Inclusion");
  script_summary(english:"Checks for remote file include vulnerability in Loudblog's backend_settings.php");
 
 script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a PHP script that is prone to a remote
file include vulnerability." );
 script_set_attribute(attribute:"description", value:
"The remote host is running Loudblog, a PHP application for publishing
podcasts and similar media files. 

The installed version of Loudblog fails to validate user input to the
'GLOBALS[path]' and 'language' parameters before using them in the
'loudblog/inc/backend_settings.php' script in a PHP 'include'
function.  Provide PHP's 'register_globals' setting is enabled, an
unauthenticated attacker can exploit this flaw to run arbitrary code,
possibly taken from third-party hosts, subject to the privileges of
the web server user id." );
 script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/423947/30/0/threaded" );
 script_set_attribute(attribute:"see_also", value:"http://loudblog.de/forum/viewtopic.php?id=576" );
 script_set_attribute(attribute:"solution", value:
"Upgrade to Loudblog 0.41 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: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/02/05");
 script_set_attribute(attribute:"vuln_publication_date", value: "2006/02/03");
 script_cvs_date("Date: 2018/11/15 20:50:17");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();


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

  script_copyright(english:"This script is Copyright (C) 2006-2018 Tenable Network Security, Inc.");

  script_dependencies("http_version.nasl");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80);
  script_require_keys("www/PHP");
  exit(0);
}


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

port = get_http_port(default:80, embedded: 0, php: 1);

# Loop through directories.
if (thorough_tests) dirs = list_uniq(make_list("/loudblog", "/podcast", "/podcasts", cgi_dirs()));
else dirs = make_list(cgi_dirs());

foreach dir (dirs) {
  # Grab index.php.
  res = http_get_cache(item:string(dir, "/index.php"), port:port, exit_on_fail: 1);

  # If ...
  if (
    # there's a logo for Loudblog or...
    egrep(pattern:">Powered by <[^>]+>Loudblog<", string:res) ||
    # it hasn't been installed yet.
    ">Install Loudblog now!<" >< res
  ) {
    # Try to exploit the flaw to read '/loudblog/inc/id3/write.php',
    # which will die with an error message.
    postdata = string(
      "language=../inc/id3/write"
    );
    url = string(
      dir, "/loudblog/inc/backend_settings.php?",
      "GLOBALS[path]=../.."
    );
    w = http_send_recv3(method:"POST", port: port, item: url,
      exit_on_fail: 1,
      content_type: "application/x-www-form-urlencoded",
      data: postdata);
    res = w[2];

    # There's a problem if we get a message about including getid3.php.
    if ("getid3.php MUST be included before calling" >< res) {
      security_hole(port);
      exit(0);
    }
  }
}