查看: 12602|回复: 0

mac cms拿shell第二弹

[复制链接]
发表于 2015-9-18 11:45:00 | 显示全部楼层 |阅读模式
90sec@Joseph
一切还是源自论坛的一个好友,昨晚审计出了一个写入shell但总感觉不过瘾又进行深入了一下cms
QQ截图20150917094914.png
看着蛋疼的后台也阻挡不我要拿下shell脚步
[PHP] 纯文本查看 复制代码
$m = be('get','m');
$xmlpath = MAC_ROOT ."/inc/config/timmingset.xml";
$doc = new DOMDocument();
$doc -> formatOutput = true;
$doc -> load($xmlpath);
$xmlnode = $doc -> documentElement;
$timmingnodes = $xmlnode->getElementsByTagName("timming");
 
foreach($timmingnodes as $timmingnode){
        $tname = $timmingnode->getElementsByTagName("name")->item(0)->nodeValue;
    $tdes = $timmingnode->getElementsByTagName("des")->item(0)->nodeValue;
    $tstatus = $timmingnode->getElementsByTagName("status")->item(0)->nodeValue;
    $tfile = $timmingnode->getElementsByTagName("file")->item(0)->nodeValue;
    $tparamets = $timmingnode->getElementsByTagName("paramets")->item(0)->nodeValue;
    $tweeks = $timmingnode->getElementsByTagName("weeks")->item(0)->nodeValue;
    $thours = $timmingnode->getElementsByTagName("hours")->item(0)->nodeValue;
    $truntime = $timmingnode->getElementsByTagName("runtime")->item(0)->nodeValue;
     
    if(!empty($truntime)) { $oldweek= date('w',$truntime); $oldhours= date('H',$truntime); }
    $curweek= date('w',time()) ;        $curhours= date("H",time());
     
        if(strlen($oldhours)==1 && intval($oldhours) <10){ $oldhours= '0'.$oldhours; }
        if(strlen($curhours)==1 && intval($curhours) <10){ $curhours= substr($curhours,1,1); }
        if( (!empty($m) && $tname==$m) || ($tstatus==1 && ( empty($truntime) || ($oldweek."-".$oldhours) != ($curweek."-".$curhours) && strpos($tweeks,$curweek)>-1 && strpos($thours,$curhours)>-1)) ) {
                $timmingnode->getElementsByTagName("runtime")->item(0)->nodeValue = time();
                $doc -> save($xmlpath);
                $p = array();
            $m = $tparamets;
            $par = explode('-',$m);
            $parlen = count($par);
            $ac = $par[0];
             
            $colnum = array('id','pg');
            if($parlen>=2){
                    $method = $par[1];
                     for($i=2;$i<$parlen;$i+=2){
                    $p[$par[$i]] = in_array($par[$i],$colnum) ? intval($par[$i+1]) : urldecode($par[$i+1]);
                }
            }
            if($p['pg']<1){ $p['pg']=1; }
            unset($colnum);
            $db = new AppDb($MAC['db']['server'],$MAC['db']['user'],$MAC['db']['pass'],$MAC['db']['name']);
                include(MAC_ROOT."/inc/timming/".$tfile);
        }

我简单的说明一下代码的意思,打开xml并解析然后赋值与指定变量,最后判断我们请求的参数m是否与xml中的名称匹配,如果匹配则进入if进行文件包含。
图案说明
QQ截图20150917095747.png

我这里拿txt试试,jpg神马的不用我说了

QQ截图20150917095852.png
QQ截图20150917095835.png

评分

参与人数 1i币 +5 收起 理由
蓝颜 + 5

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

指导单位

江苏省公安厅

江苏省通信管理局

浙江省台州刑侦支队

DEFCON GROUP 86025

旗下站点

邮箱系统

应急响应中心

红盟安全

联系我们

官方QQ群:112851260

官方邮箱:security#ihonker.org(#改成@)

官方核心成员

Archiver|手机版|小黑屋| ( 沪ICP备2021026908号 )

GMT+8, 2025-3-7 15:36 , Processed in 0.033312 second(s), 16 queries , Gzip On, MemCache On.

Powered by ihonker.com

Copyright © 2015-现在.

  • 返回顶部