又见fckeditor 's

admin 2017年4月29日02:34:41评论234 views字数 2313阅读7分42秒阅读模式
摘要

今天终于回到家了。。 文/superhei
以前发过一个fckeditor的上传文件漏洞:http://superhei.blogbus.com/logs/2006/02/1916091.html
我们看看新版本2.4的,还是被动过滤:

今天终于回到家了。。

文/superhei
以前发过一个fckeditor的上传文件漏洞:http://superhei.blogbus.com/logs/2006/02/1916091.html
我们看看新版本2.4的,还是被动过滤:

config.php:

$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') ;

字典越来越大啊 又见fckeditor  's 。我们先测试先以前的exp
上穿aa.php. 这样的文件结果变成了 aa_php. 看来还有其他变化啊:

function FileUpload( $resourceType, $currentFolder )
{
$sErrorNumber = '0' ;
$sFileName = '' ;

……….
// Replace dots in the name with underscores (only one dot can be there… security issue).
if ( $Config['ForceSingleExtension'] ) //多了个$Config['ForceSingleExtension']的配置 默认是ture
$sFileName = preg_replace( '///.(?![^.]*$)/', '_', $sFileName ) ; //这里替换了文件名里多余的. 即:1.1.php–>1_1.php

$sOriginalFileName = $sFileName ;

// Get the extension.
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ; //替换后取后缀,因为上面的替换所以保证了文件名里只有一个. 即:1_1.php—>php

$arAllowed = $Config['AllowedExtensions'][$resourceType] ;
$arDenied = $Config['DeniedExtensions'][$resourceType] ;

if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) )//判断
{
………….

if ( is_file( $sFilePath ) )

{
$iCounter++ ;
$sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ;

/*
这里判断有没有相同的文件名,如果有这改为在后缀前加一个(n). 如:_phs–>(1)._phs
那么我们可以利用产生的这个(n).不呢?答案是:NO 因为我们提交_php 经过
// Get the extension.
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ;
这里时strrpos($sFileName, '.')为空所以 还是:_php–>php 这个是没有办法通过上面的判断语句的
*/

$sErrorNumber = '201' ;

}
else
{
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;

通过上面的分析,好象没办法了?。呵呵 我们可以不用.嘛,在win下还有一个空格呢 又见fckeditor  's 提交1.php+空格 就可以过去所有的拉 hoho
不过空格只支持win系统 *nix是不支持的[1.php和1.php+空格是2个不同的文件]

最后说明下,默认fckeditor是不让上传文件的:config.php:

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

最后bs下fckeditor,为了被动的过滤,费了多少事啊 最后还是有问题!意识问题!!!??

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2017年4月29日02:34:41
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   又见fckeditor 'shttps://cn-sec.com/archives/49408.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息