what you don't know can hurt you

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
MD5 | a6b0f2282a375e29d3f39931335be4e4

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.


RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

June 2019

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

Top Authors In Last 30 Days

File Tags


packet storm

© 2019 Packet Storm. All rights reserved.

Security Services
Hosting By