編輯器 Getshell - Fckeditor 2.4.3

編輯器 Getshell - Fckeditor 2.4.3


作者 : Noth 

前言 :  

Fckeditor 是舊版的編輯器 xD  現今都改用 ckeditor,不過還是在滲透的過程中很常遇到這種舊版的編輯器,在 Hitcon Zeroday 被分類為已知使用漏洞元件( Using Knows Vulnerability Components ),筆者這一篇主要分享解析漏洞原理及實戰 Getshell,小夥伴們快上車囉 ! 

內文 : 

下載 fckedior 2.4.3 源代碼

https://download.cksource.com/FCKeditor/FCKeditor/2.4.3/

 開啟 Xampp 

把解壓縮的檔案放在 htdocs 目錄底下

D:\xampp\htdocs


 攻擊思路 (查看 Fckeditor 版本)

http://127.0.0.1/fckeditor/editor/dialog/fck_about.html
http://127.0.0.1/FCKeditor/_whatsnew.html

 


測試上傳點 :

http://127.0.0.1/fckeditor/editor/filemanager/browser/default/connectors/test.html


 在上傳之前我們必須將功能點打開

D:\xampp\htdocs\fckeditor\editor\filemanager\browser\default\connectors\php

將 $Config['Enabled'] 更改為 True

回到上傳功能點,並在本機桌面創建 test.php 文件 (內容為 <?php phpinfo();?>)


沒辦法上傳,但透過後綴名加空格就可以輕鬆繞過


直接攔接上傳封包,將 test.php 文件名加空白鍵且將 Content-Type 改成 

image/png

成功上傳

檢查文件路徑


訪問上傳檔名

http://127.0.0.1/userfiles/file/test.php

新生成的目錄 ( /userfiles/file/ ),可以清楚看到我們上傳的文件

代碼解析:

URL: php/connector.php?Command=FileUpload&Type=File&CurrentFolder=/

上傳點功能路徑

跟蹤進去 connector.php 文件中的 Command 參數。

D:\xampp\htdocs\fckeditor\editor\filemanager\browser\default\connectors\php

看到 $sCommand 變數以GET方式傳遞由 Commnad 參數傳遞的值,繼續跟蹤 

$sCommand 變數,第 87 行當 $sCommand 變數被賦予得值是 FileUpload 時執

行下列程式碼。

進一步繼續跟蹤 FileUpload 函式 (此定義兩個參數),在 commands.php 文件中。

D:\xampp\htdocs\fckeditor\editor\filemanager\browser\default\connectors\php

第 179 行 $arDenied 變數被賦予值為黑名單。

繼續追蹤黑名單文件在 config.php 中。

D:\xampp\htdocs\fckeditor\editor\filemanager\browser\default\connectors\php

第 45 行黑名單清單!但這時可以使用 Windows 特性繞過限制(副檔名後面加空白)。


Reference : 

https://www.secpulse.com/archives/116338.html

https://lipeilipei.top/2020/05/07/%E7%BC%96%E8%BE%91%E5%99%A8%E6%8B%BFwebshell%20-%20FCKeditor%202.4.3/

https://www.cnblogs.com/thespace/p/12361183.html

留言

熱門文章