exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Merethis Centreon 2.3.1 Code Execution

Merethis Centreon 2.3.1 Code Execution
Posted Nov 8, 2011
Authored by Christophe de la Fuente | Site trustwave.com

The Centreon supervision and monitoring tool provided by Merethis permits remote code execution from the command help web page allowing an attacker to execute arbitrary commands in the context of the webserver hosting the application. The system also uses a one-way hash without a salt. Versions 2.3.1 and below are affected.

tags | exploit, remote, web, arbitrary, code execution
SHA-256 | 8baa1a03e20514db0ebdff56296a1f3d2b0ea0473b7d740b7747c685e31fb6df

Merethis Centreon 2.3.1 Code Execution

Change Mirror Download
Trustwave's SpiderLabs Security Advisory TWSL2011-017:
Multiple Vulnerabilities in Merethis Centreon


Published: 2011-11-04
Version: 1.0

Vendor: Merethis (http://www.merethis.com and http://www.centreon.com)
Product: Centreon
Version affected: 2.3.1 and prior

Product description:
Centreon is network supervision and monitoring tool that is based upon
the Nagios open source monitoring engine. Centreon can be used as a
Nagios GUI and it can provide such features as real time system
monitoring, performance management and system management.

Credit: Christophe De La Fuente of Trustwave SpiderLabs

Finding 1: Remote Command Execution

Centreon supervision and monitoring tool provided by Merethis permits
remote code execution from the command help web page allowing an
attacker to execute arbitrary commands in the context of the webserver
hosting the application. Any account that has been granted the access
to "Configuration > Nagios > Checks" is able to execute commands.

The following Proof of Concept (PoC) executes the command
'cat /etc/passwd':


Finding 2: One-Way Hash Without a Salt

The following code at lines 329-349 from
shows the insertContactInDB() function inserting the MD5 or SHA1
password hash in the database without using a salt:

$rq = "INSERT INTO `contact` ( " .
"`contact_id` , `timeperiod_tp_id` , `timeperiod_tp_id2` ,
`contact_name` , " . "`contact_alias` , `contact_autologin_key` ,
`contact_passwd` , `contact_lang` , `contact_template_id`, " .
"`contact_host_notification_options` ,
`contact_service_notification_options` , " . "`contact_email` ,
`contact_pager` , `contact_comment` , `contact_oreon`,
`contact_register`, `contact_enable_notifications` , " .
"`contact_admin` , `contact_type_msg`, `contact_activate`,
`contact_auth_type`, " . "`contact_ldap_dn`, `contact_location`,
`contact_address1`, `contact_address2`, " . "`contact_address3`,
`contact_address4`, `contact_address5`, `contact_address6`)" .
"VALUES ( ";
$rq .= "NULL, "; isset($ret["timeperiod_tp_id"]) && $ret["timeperiod_tp_id"]
!= NULL ? $rq .= "'".$ret["timeperiod_tp_id"]."', ": $rq .= "NULL, ";
isset($ret["timeperiod_tp_id2"]) && $ret["timeperiod_tp_id2"] != NULL ? $rq
.= "'".$ret["timeperiod_tp_id2"]."', ": $rq .= "NULL, ";
isset($ret["contact_name"]) && $ret["contact_name"] != NULL ? $rq .=
"'".htmlentities($ret["contact_name"], ENT_QUOTES, "UTF-8")."', ": $rq .=
"NULL, ";---isset($ret["contact_alias"]) && $ret["contact_alias"] != NULL ?
$rq .= "'".htmlentities($ret["contact_alias"], ENT_QUOTES, "UTF-8")."', ":
$rq .= "NULL, "; isset($ret["contact_autologin_key"]) &&
$ret["contact_autologin_key"] != NULL ? $rq .=
"'".htmlentities($ret["contact_autologin_key"], ENT_QUOTES)."', ": $rq .=
"NULL, "; if ($encryptType == 1)
isset($ret["contact_passwd"]) && $ret["contact_passwd"] != NULL ? $rq .=
"'".md5($ret["contact_passwd"])."', ": $rq .= "NULL, ";
else if ($encryptType == 2)
isset($ret["contact_passwd"]) && $ret["contact_passwd"] != NULL ? $rq .=
"'".sha1($ret["contact_passwd"])."', ": $rq .= "NULL, ";
isset($ret["contact_passwd"]) && $ret["contact_passwd"] != NULL ? $rq .=
"'".md5($ret["contact_passwd"])."', ": $rq .= "NULL, ";

The combination of unsalted hashes and Finding 1 allows an attacker to
recover passwords for all accounts. The following example illustrates
this attack.

The following php code will dump the hashes of all users:

<?php require_once ("/etc/centreon/centreon.conf.php"); require_once "$classdir/centreonDB.class.php"; $p=new CentreonDB(); $r=$p->query("SELECT contact_passwd from centreon.contact"); while ($w=&$r->fetchRow()) {echo $w["contact_passwd"] . "<br>";} ?>

To upload and execute this code on the server, one method is to convert
the above php code to hexadecimal and use the remote code execution
method outlined in Finding 1 to create a server-side php file. The
length of the URL accepted in this case is limited, so the file must
be broken into three parts. The following requests create the php
file "test.php":




Execution of http://example.domain/centreon/test.php will provide
the unsalted hashes. Using rainbow tables, these passwords can be
reversed, the time and size of rainbow table required dependent on
the complexity of the passwords involved.

Remediation Steps:
Customers should upgrade to version 2.3.2 in order to remediate these

Revision History:
10/19/11 - Vulnerability Disclosed
11/02/11 - Patch released
11/04/11 - Advisory Published

1. http://www.merethis.com
2. http://www.centreon.com

About Trustwave: Trustwave is the leading provider of on-demand and
subscription-based information security and payment card industry
compliance management solutions to businesses and government entities
throughout the world. For organizations faced with today's challenging
data security and compliance environment, Trustwave provides a unique
approach with comprehensive solutions that include its flagship
TrustKeeper compliance management software and other proprietary
security solutions. Trustwave has helped thousands of organizations --
ranging from Fortune 500 businesses and large financial institutions
to small and medium-sized retailers--manage compliance and secure their
network infrastructure, data communications and critical information
assets. Trustwave is headquartered in Chicago with offices throughout
North America, South America, Europe, Africa, China and Australia.
For more information, visit https://www.trustwave.com

About Trustwave's SpiderLabs: SpiderLabs(R) is the advanced security
team at Trustwave focused on application security, incident response,
penetration testing, physical security and security research. The team
has performed over a thousand incident investigations, thousands of
penetration tests and hundreds of application security tests globally.
In addition, the SpiderLabs Research team provides intelligence through
bleeding-edge research and proof of concept tool development to enhance
Trustwave's products and services.

Disclaimer: The information provided in this advisory is provided "as is"
without warranty of any kind. Trustwave disclaims all warranties,
either express or implied, including the warranties of merchantability
and fitness for a particular purpose. In no event shall Trustwave or
its suppliers be liable for any damages whatsoever including direct,
indirect, incidental, consequential, loss of business profits or
special damages, even if Trustwave or its suppliers have been advised
of the possibility of such damages. Some states do not allow the
exclusion or limitation of liability for consequential or incidental
damages so the foregoing limitation may not apply.

This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    0 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    0 Files
  • 16
    Apr 16th
    0 Files
  • 17
    Apr 17th
    0 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags


packet storm

© 2022 Packet Storm. All rights reserved.

Security Services
Hosting By