搜索
查看: 551|回复: 0

discuz某插件设计缺陷可前台getshell

[复制链接]
susftp 该用户已被删除
发表于 2015-10-5 21:33:41 | 显示全部楼层 |阅读模式
原文地址http://0day5.com/archives/3467-----------------------------------------------------------

#插件信息:
http://addon.discuz.com/?@dc_mall.plugin
官方安装量3000+ (已经不少了吧)

#测试环境:
PHP 版本为: 5.2.9-2
magic_quotes_gpc = off

dc_mall.inc.php(漏洞文件)

  1. <?php

  2. if(!defined('IN_DISCUZ')) {

  3.         exit('Access Denied');

  4. }

  5. $_lang = lang('plugin/dc_mall');

  6. $action = $_GET['action'] ? $_GET['action'] : 'index';

  7. $version ='Ver 1.1.1';

  8. $cvar = $_G['cache']['plugin']['dc_mall'];

  9. $file = DISCUZ_ROOT.'./source/plugin/dc_mall/module/index/'.$action.'.inc.php';//action参数未过滤直接传入$file 后面的用%00截断即可包含任意文件



  10. if (!file_exists($file)||!$cvar['open']) showmessage('undefined_action');

  11. $usercredit = getuserprofile('extcredits'.$cvar['credit']);

  12. $mallnav = C::t('#dc_mall#dc_mall_sort')->getdata();

  13. $sortid = dintval($_GET['sortid']);

  14. if(empty($mallnav[$sortid]))$sortid=0;

  15. @include $file;

  16. $croppath = DISCUZ_ROOT.'./source/plugin/dc_mall/data/cron.php';

  17. $cronupdate = @include $croppath;

  18. if(TIMESTAMP-$cronupdate['timestamp']>$cvar['autotime']*60){

  19.         require_once DISCUZ_ROOT.'./source/plugin/dc_mall/cache/cache_mallinfo.php';

  20.         build_cache_plugin_mallinfo();

  21.         $configdata = 'return '.var_export(array('timestamp'=>TIMESTAMP), true).";\n\n";

  22.         if($fp = @fopen($croppath, 'wb')) {

  23.                 fwrite($fp, "<?php\n//plugin mall temp upgrade check file, DO NOT modify me!\n//Identify: ".md5($configdata)."\n\n$configdata?>");

  24.                 fclose($fp);

  25.         }

  26. }

  27. include template('dc_mall:index/'.$action);

  28. ?>
复制代码

#包含测试

前台上传带马图片,在直接用包含就成功。

局限性太大了。。



您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表