Fckeditor <= 2.4.2 的任意文件上传漏洞代码解析

本文介绍了Fckeditor <= 2.4.2版本中的一个任意文件上传漏洞,通过分析`config.php`和`upload.php`源码,揭示了Media类型上传时的限制缺失,允许上传任意文件。通过构造特定HTML代码,可以成功上传PHP文件到`userfilesMedia`目录,存在安全隐患。
摘要由CSDN通过智能技术生成

无聊,看了下fckeditor的漏洞,发现有网友已经提出Fckeditor <= 2.4.2 的任意文件上传漏洞了,抱着好奇心看了一下源码,将漏洞复现,并讲解源码。

首先打开fckeditor\editor\filemanager\upload\php\config.php  配置fck。

我配置的信息如下  你们可以自己修改

<span style="font-family:Microsoft YaHei;font-size:14px;"><?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 PHP File Uploader.
 */

global $Config ;

// SECURITY: You must explicitelly enable this "uploader".
$Config['Enabled'] = true ;

// Set if the file type must be considere in the target path.
// Ex: /userfiles/image/ or /userfiles/file/
$Config['UseFileType'] = "/userfiles/file/" ;

// Path to uploaded 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'] = 'E:\\wamp\\www\\test\\fck\\242\\userfiles\\' ;

// Due to security issues with Apache modules, it is reccomended to leave the
// following setti
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值