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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2012-12-10 10:20:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
感谢生生不息在freebuf社区”分享团”里给出线索,才有了本文
) j3 M0 M. f5 s# @/ W9 o% L% z* E* n
, O1 d9 [% @0 W% `原帖:http://club.freebuf.com/?/question/129#reply12, g2 e" p; C5 l2 u

$ q7 K$ L+ ?6 r  L% y, X/ N; Z1 {FCKEditor 2.6.8文件上传漏洞& v! X1 h, i1 S' }4 a* U

, K. I; G4 r; P4 b# ?Exploit-db上原文如下:
8 g0 |) l' y/ o% M/ O. U1 m: x, ?* G3 l
- Title: FCKEditor 2.6.8 ASP Version File Upload Protection bypass# H7 b4 T- T/ @( ]0 c
- Credit goes to: Mostafa Azizi, Soroush Dalili" Z/ R8 R( S: \; T9 j' ^! t4 \
- Link:http://sourceforge.net/projects/fckeditor/files/FCKeditor/
, G7 `' L3 ~& w1 d- Description:/ j0 I+ {/ k' J: a. {; w6 c6 m
There is no validation on the extensions when FCKEditor 2.6.8 ASP version is8 L2 \, f! E8 @% O$ W$ O$ A: P
dealing with the duplicate files. As a result, it is possible to bypass. ], b  F4 N4 @- E6 S' X: J2 K
the protection and upload a file with any extension.2 e* i/ `* A* S- u/ P! }
- Reference: http://soroush.secproject.com/blog/2012/11/file-in-the-hole/" k3 A- n$ m) i, |
- Solution: Please check the provided reference or the vendor website.# X3 c7 u! l9 ]3 X5 v

* T& z# O" \4 z8 H5 _- PoC:http://www.youtube.com/v/1VpxlJ5 ... ;rel=0&vq=hd720
! I- s8 b/ ]. [" r4 |& W( e! Y' A"# Z) {! g+ W  T/ U$ U% |" t) O* K
Note: Quick patch for FCKEditor 2.6.8 File Upload Bypass:
8 [" W3 i. O/ o: l4 U5 M8 ~  l: K  l) L/ g2 b3 @
In “config.asp”, wherever you have:9 f4 A! Z3 p5 w' R! E
      ConfigAllowedExtensions.Add    “File”,”Extensions Here”
( N7 S3 U7 |. D8 r+ jChange it to:
; q) {4 ?" [7 J9 D" @. V* D" ~      ConfigAllowedExtensions.Add    “File”,”^(Extensions Here)$”在视频(需翻墙)里,我们可以看的很清楚:6 E# g5 `" x- p2 W. K4 s
& f* W$ m& R2 d' _$ S- Z) A2 n
1.首先,aspx是禁止上传的
/ f4 x' y6 k- \( }) K2.使用%00截断(url decode),第一次上传文件名会被转成_符号9 A) m1 [3 A: ]' \/ [) g2 a1 H
' e- U1 Y8 f# @" J7 e

5 J  G( _+ D% t( n- z. U3 S. I) }0 S  d* k' e1 }7 Y7 }
接下来,我们进行第二次上传时,奇迹就发生了5 Z9 J3 m: m, ?( _( ^
5 |& @, C9 J7 a$ h

, P$ a1 W0 x2 h
$ d+ m  ]7 |0 c  B) K  _代码层面分析可以看下http://lanu.sinaapp.com/ASPVBvbscript/121.html
8 q- {: I4 ~; c
' u& `1 \1 _; f) f- D* l# M & w) i3 ?1 J& J0 c

9 J3 k8 W5 n5 `) z8 M1 |CKFinder/FCKEditor DoS漏洞+ n. E" F& k: O' h  U# T& E" a7 m

0 b  M) A6 ~% P5 Q相比上个上传bug,下面这个漏洞个人觉得更有意思# U$ ^" @1 a# v0 K
$ K( i7 c1 Y) u7 G/ o! v8 f  S
/ h( x* g4 C+ J
4 Q) U6 Q5 C* l( e; ?9 K4 ]5 ^5 g
CKFinder是一个强大而易于使用的Web浏览器的Ajax文件管理器。 其简单的界面使得它直观,快速学习的各类用户,从高级人才到互联网初学者。 5 k( M+ s* a1 m; D

- L2 m: L. D2 lCKFinder ASP版本是这样处理上传文件的:
2 k' W: M! l! u- f: T) g  N+ I& m% X. I
当上传文件名已存在时,会进行迭代重命名,比如file(1).ext存在了,会尝试重命名为file(2).ext……直到不重复为止。: d/ e) p# U2 `& b1 r1 L
) v7 n; G: J' }, ?9 D+ p
那么现在有趣的事情来了——windows是禁止”con”作为文件名的(关于这个问题我印象中很久以前,win也有过con文件名漏洞,有兴趣可以确认下)
" O( V: J4 B7 K& ?' l9 O2 b* n4 S9 T- y3 Q( w8 k3 i, v& S
dos方法也应运而生!
; ~8 P# o2 K, ?1 f0 s
( o5 e# ?) S0 p4 R# k3 u
! D+ V- \% Y4 }5 L. V( |5 n' P7 v" o
1.上传Con.pdf.txt$ I1 @) A9 G; v4 D: M
2.CKFinder认为“Con.pdf.txt” 已被占用,于是开始尝试Con.pdf(1).txt,Con.pdf(2).txt……Con.pdf(MaxInt).txt从而对服务器形成致命dos。$ T( h" `, N' n" |" i% ^; F% t
5 S. j$ M* Q! g4 U. {
回复

使用道具 举报

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

本版积分规则

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