FCKeditor漏洞利用
来源:互联网 发布:led改字软件 编辑:程序博客网 时间:2024/04/29 22:40
2006-02-09日milw0rm公布了FCKEditor的一个上传漏洞。FCKEditor是一款有多个语
言版本的(asp,cgi,aspx,php,cfm,...)的在线编辑的class,很多web系统都使用了这
个class。其实这个东西的漏洞,国内早有人挖过,比如asp版(nb文章系统由于使用这个
导致的上传漏洞),这里我们看看php版本的:
/editor/filemanager/browser/default/connectors/php/config.php
行35-36:
$Config['AllowedExtensions']['File'] = array() ; //允许的上穿类型
$Config['DeniedExtensions']['File'] = array('php','php3','php5','phtml','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg','cgi') ;//禁止上传的类型
我们看$Config['DeniedExtensions']['File']里禁止的类型显然不够,我们可以上传php2、php4、inc、pwml、asa、cer ...等等。我们在看看具体的upfile函数
/editor/filemanager/browser/default/connectors/php/commands.php
function FileUpload( $resourceType, $currentFolder )
{
.......................
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ; //得到文件的后缀(以.为标志取最后1个)
global $Config ;
$arAllowed = $Config['AllowedExtensions'][$resourceType] ;
$arDenied = $Config['DeniedExtensions'][$resourceType] ;
if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) ) //判断合法后缀
{
$iCounter = 0 ;
while ( true )
{
$sFilePath = $sServerDir . $sFileName ;
.......................
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
//上传 注意它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension为后缀
//导致在win下在上传文件后面加个.来突破[未测试]
........................
}
为什么说这个漏洞为"意识漏洞"呢?如果我们把AllowedExtensions/DeniedExtensions的设置"反"一下:
$Config['AllowedExtensions']['File'] = array('rar','zip') ; //允许的上穿类型
$Config['DeniedExtensions']['File'] = array() ;//禁止上传的类型
把设置DeniedExtensions改为设置AllowedExtensions,就不会出现上面的漏洞了,不过这样在某些情况下,照样可以突破,问题还是出在这里:
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
//上传 注意它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension为后缀
在apache下,因为"apache文件名解析缺陷漏洞"而出现漏洞[未测试]。
小结:
其实很多web程序员都有这个"意识漏洞",在过滤上传文件类型时,不应该‘被动’的去过滤非法后缀,应该是‘主动’过滤允许上传的类型。
- FCKeditor漏洞利用集锦
- FCKeditor漏洞利用
- Fckeditor漏洞利用总结
- Fckeditor漏洞利用总结
- Fckeditor漏洞利用总结
- fckeditor jsp 漏洞利用
- fckeditor asp 漏洞利用
- Fckeditor漏洞利用总结
- fckeditor php 漏洞利用
- Fckeditor漏洞利用总结
- Fckeditor漏洞利用总结
- FCKeditor漏洞所有利用页面
- php+apache fckeditor漏洞利用
- Fckeditor漏洞利用方法总结
- Fckeditor jsp版漏洞利用方法:
- 分享一些关于Fckeditor漏洞利用总结
- FCKeditor(FCK)上传漏洞利用原理详解
- Fckeditor常见漏洞的挖掘与利用整理汇总
- 跟我学XSL(二)
- 安装 Flash Player 9 ActiveX 控件注册失败的解决办法
- Z02的连接类
- 研究生开题与论文阅读要求
- Z02的DAO类
- FCKeditor漏洞利用
- 中国IT培训行业老大级人物
- PB 的编译选项介绍
- 在Ubuntu中定制Compiz融合特效
- 给我的VC6打补丁
- Fedora yum安装/更新加速方法
- 桑塔纳操作系统
- Fckeditor <=2.4.2 For php 任意上传文件漏洞
- gcc内联汇编