老洞复现 | FCKeditor V2.4.3 php版文件上传

admin 2022年5月30日17:44:30评论988 views字数 3450阅读11分30秒阅读模式
老洞复现 | FCKeditor V2.4.3 php版文件上传
0x00 前言
小黑之前写了个upload-labs靶场系列,其中第一篇《上传靶场upload-labs搭建及使用》提到刷完原版后会继续刷国光版和开普勒版。

现在这两个版本我也看过了,国光版除去页面ui和细节上的不同,其余基本和原版是一样的。开普勒版的前20关也一样,不过后面多了4个新的自创关卡。

本文即开普勒版的第21关,也就是它第一个自创关卡的内容。

搭环境的过程就省略了,开普勒版没有像原版一样提供集成环境,建议使用新版的phpstudy自行搭建。访问主页面需要php7以上版本,选择关卡后,还需要在php7和5之间反复横跳。

此关需要php5.3及以下版本。

0x01 后缀加空格绕过
老洞复现 | FCKeditor V2.4.3 php版文件上传
进入关卡,很简洁的页面。

老洞复现 | FCKeditor V2.4.3 php版文件上传
根据提示访问路径后发现是fckeditor的测试上传页。

老洞复现 | FCKeditor V2.4.3 php版文件上传

再访问根目录下的_whatsnew.html获得版本信息。

或者可以访问editor/dialog/fck_about.html来获取。

老洞复现 | FCKeditor V2.4.3 php版文件上传
在测试上传页修改Connector选项为php,然后直接上传php文件,用burp抓包在文件名最后加空格,即可绕过FCK编辑器File类型上传文件的黑名单限制。

老洞复现 | FCKeditor V2.4.3 php版文件上传
提示这个就是上传成功了。

老洞复现 | FCKeditor V2.4.3 php版文件上传
至于文件被上传到哪里了,可以访问下面这个链接获取路径:
/editor/filemanager/browser/default/connectors/php/connector.php?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/

老洞复现 | FCKeditor V2.4.3 php版文件上传
根据获取到的路径直接访问文件即可。

不是所有fck都是这个测试上传页路径,大家可以把下面这些加进扫目录的字典里。当然有时实在没有测试上传页也可以对着上传接口直接构造上传请求,收集到的上传接口也在下面了。
FCKeditor/editor/filemanager/browser/default/connectors/test.htmlFCKeditor/editor/filemanager/upload/test.htmlFCKeditor/editor/filemanager/connectors/test.htmlFCKeditor/editor/filemanager/connectors/uploadtest.html
FCKeditor/_samples/default.htmlFCKeditor/_samples/asp/sample01.aspFCKeditor/_samples/asp/sample02.aspFCKeditor/_samples/asp/sample03.aspFCKeditor/_samples/asp/sample04.aspFCKeditor/_samples/default.htmlFCKeditor/editor/fckeditor.htmFCKeditor/editor/fckdialog.html
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/FCKeditor/editor/filemanager/browser/default/connectors/php/connector.php?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector.jsp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com/fckeditor/editor/filemanager/connectors/php/connector.phpFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com/fckeditor/editor/filemanager/connectors/asp/connector.aspFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com/fckeditor/editor/filemanager/connectors/aspx/connector.aspxFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com/fckeditor/editor/filemanager/connectors/jsp/connector.jsp
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.aspFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jspfckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.Aspxfckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php

0x02 其他方法
后缀加空格的绕过方式只局限于windows,fck其他版本还有很多getshell的方式,但测试了一下,这个环境目前就只有这一个方法能用。

不过不妨碍小黑在这里把找到的其他方法给大家分享一下:

1、Apache+linux 环境下在上传文件后面加个.突破

2、上传时选Media类型,没有任何限制

3、上传两次shell.php.jpg,虽然第一次会被修改为shell_php.abc,但第二次上传的会被重命名为shell.php(1).abc,然后就可以用apache的多后缀解析漏洞了。

4、冷门后缀绕过:asa、cer、php2、php4、inc、pwml、pht 

5、任意目录浏览:
/editor/filemanager/browser/default/connectors/php/connector.php?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=e:/

0x03 后记
老洞复现 | FCKeditor V2.4.3 php版文件上传
VX公众号:《小黑的安全笔记》
白盒没什么好分析的,就是一个简单的黑名单后缀过滤,忘了去除文件名首尾的空格,刷过原版upload-labs就不难理解。

对于这关有价值的地方在于可以引导你去收集fck相关的漏洞信息和路径信息,以后在项目中遇到这个编辑器会比较眼熟一点。

顺便对自己的路径字典查漏补缺,毕竟这种编辑器类资产有时不进后台是很难关联到的,如果能直接扫出来可能会节省不少时间。
END.

喵,点个赞再走吧~

原文始发于微信公众号(小黑的安全笔记):老洞复现 | FCKeditor V2.4.3 php版文件上传

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年5月30日17:44:30
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   老洞复现 | FCKeditor V2.4.3 php版文件上传https://cn-sec.com/archives/1065576.html

发表评论

匿名网友 填写信息