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

FCKEditor 2.6.8文件上传和CKFinder/FCKEditor DoS漏洞

[复制链接]
跳转到指定楼层
楼主
发表于 2012-12-10 10:20:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
感谢生生不息在freebuf社区”分享团”里给出线索,才有了本文' A, x$ N/ G4 Q2 v6 S: c
! Z% q# r/ O0 y9 C# q
原帖:http://club.freebuf.com/?/question/129#reply12
  h5 Y  K! {) c; G$ T8 a. \
( \3 n( \# L) N. VFCKEditor 2.6.8文件上传漏洞2 C# B- N" [7 h" \2 ^6 Z
: f, w$ L5 t1 P# J- M" I' D1 l8 Q, p
Exploit-db上原文如下:
; r, R6 @! T; \$ i7 ?  x" ^- L2 F
, m, c* f+ k6 R( R5 y. m- Title: FCKEditor 2.6.8 ASP Version File Upload Protection bypass
7 J- _1 m: ~8 C* f. y: s5 k- Credit goes to: Mostafa Azizi, Soroush Dalili
! j6 ~3 m7 T) D3 @: r  O/ C/ `- Link:http://sourceforge.net/projects/fckeditor/files/FCKeditor/" g+ H' `+ D. H3 M1 O: t
- Description:
3 O4 b) i: G: Q" |& lThere is no validation on the extensions when FCKEditor 2.6.8 ASP version is4 ?2 I5 L" Z7 x, C/ G* t
dealing with the duplicate files. As a result, it is possible to bypass
/ v, x) h$ ]4 [$ a* Ithe protection and upload a file with any extension.
! u# t" o! A- f; C! M* l! Z" i% G- Reference: http://soroush.secproject.com/blog/2012/11/file-in-the-hole/2 J! r7 e* t7 a
- Solution: Please check the provided reference or the vendor website.
. q: |6 v2 {7 O% Y2 }2 `" A" I+ x: X. `8 |& ?+ ~& B
- PoC:http://www.youtube.com/v/1VpxlJ5 ... ;rel=0&vq=hd720* g5 _7 P% C. V. B( U" ?" p) E( m" J
"; W% J  ?! w6 b3 h! E- e
Note: Quick patch for FCKEditor 2.6.8 File Upload Bypass:6 k/ m* f) U( F# t
: H, e6 E) R" {6 r- ^  C/ _* ~: z& \
In “config.asp”, wherever you have:
6 J3 a: n3 f6 M9 H! f! r& Z      ConfigAllowedExtensions.Add    “File”,”Extensions Here”- Y  k: V/ b9 }
Change it to:# \1 D' v1 G; m3 @3 A* f" g
      ConfigAllowedExtensions.Add    “File”,”^(Extensions Here)$”在视频(需翻墙)里,我们可以看的很清楚:
0 J1 ]$ }( L3 W7 `4 _" U
* x( V5 Y; B  [1.首先,aspx是禁止上传的" g, U9 r  b6 V# j. H0 J
2.使用%00截断(url decode),第一次上传文件名会被转成_符号2 _! S. ?# o2 ~) t

- D5 @5 ^: m4 ^& I6 i$ b% b% c& m. W/ ]7 d5 M' u4 ^

) E0 _  k% R9 a1 J; N6 d9 O  q接下来,我们进行第二次上传时,奇迹就发生了
7 b# p" H% r; D* j9 Z
8 i; m' p6 u5 M! g$ n/ G8 w3 |. k
, V+ c! F9 H' f, F; [: j/ y% g9 M. H4 m- a" r
代码层面分析可以看下http://lanu.sinaapp.com/ASPVBvbscript/121.html
) j- G- G' U" v. z: [" F
, F* n: d9 ?# q# w) v
% z: C% x. \6 M- p* A
* K3 U* g: P- R* JCKFinder/FCKEditor DoS漏洞. k( o% p- a+ o* U3 Q

; B4 P' U' e3 N/ I6 ]& ]. H2 c相比上个上传bug,下面这个漏洞个人觉得更有意思
$ o6 N, g8 w" q' D4 V& j
; ?: K* _- c+ j. ^
: i! _$ E/ ]4 t) p+ e2 t
. |6 F4 d' ?0 g; ]! U) Z. gCKFinder是一个强大而易于使用的Web浏览器的Ajax文件管理器。 其简单的界面使得它直观,快速学习的各类用户,从高级人才到互联网初学者。 3 B3 _8 |! m& m- r# R, R+ A) _
/ j* l3 |* l! Q- t/ r1 k
CKFinder ASP版本是这样处理上传文件的:
+ u9 o5 E5 q' R' I" C
5 C4 R& J) T4 C6 d6 {1 {  ?( p) d当上传文件名已存在时,会进行迭代重命名,比如file(1).ext存在了,会尝试重命名为file(2).ext……直到不重复为止。
7 H! ], e4 }& _: a9 G9 q* k
2 s( c# F3 @5 l& {! ^0 L* D" @那么现在有趣的事情来了——windows是禁止”con”作为文件名的(关于这个问题我印象中很久以前,win也有过con文件名漏洞,有兴趣可以确认下)
8 _( d- A+ M. |/ W
. J5 ^7 ^" O; r) z( Ddos方法也应运而生!
, O' W! \( P; ?& P1 }6 z( r3 d, G+ }
9 M2 x+ T. I7 k2 \+ W
8 j  ^$ K9 }. N3 U  I; n" Q8 v* W  M/ x6 T1 Q& h, P
1.上传Con.pdf.txt4 q/ o0 ]6 i- ]
2.CKFinder认为“Con.pdf.txt” 已被占用,于是开始尝试Con.pdf(1).txt,Con.pdf(2).txt……Con.pdf(MaxInt).txt从而对服务器形成致命dos。# u/ r: {( ^  ]8 }: Q" g4 @5 m& n3 O

4 Q6 N. w: A) ?2 N6 @4 G
回复

使用道具 举报

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

本版积分规则

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