找回密码
 立即注册
查看: 3520|回复: 0
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
楼主
发表于 2012-12-10 10:20:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
感谢生生不息在freebuf社区”分享团”里给出线索,才有了本文
- v- F/ [( }* @" H: d/ h
4 @# a% ^; P/ y/ [! n原帖:http://club.freebuf.com/?/question/129#reply127 H; ?3 P$ k$ k

% U& N! ~+ [& X- E3 u$ E+ ]" c! lFCKEditor 2.6.8文件上传漏洞5 u1 W$ @* @! k5 M6 t
8 V$ P+ U# ~# g- w  L
Exploit-db上原文如下:
' n: I7 ?. A( c' m
- s4 N3 d9 o0 W8 v3 A' b; f0 E- Title: FCKEditor 2.6.8 ASP Version File Upload Protection bypass& X+ N/ o/ |: y& z. M% g, o, Q3 B  r
- Credit goes to: Mostafa Azizi, Soroush Dalili9 B; n( u9 p8 c
- Link:http://sourceforge.net/projects/fckeditor/files/FCKeditor/+ b# F! B* q5 l0 ^2 i
- Description:
- g9 f2 T" ~* T' c, }There is no validation on the extensions when FCKEditor 2.6.8 ASP version is
9 a7 b! U+ \+ K* }dealing with the duplicate files. As a result, it is possible to bypass
  T, _/ j" }5 _8 dthe protection and upload a file with any extension.
* L/ f, Q6 }# J' N& W' h2 ]% \; J; |- Reference: http://soroush.secproject.com/blog/2012/11/file-in-the-hole/
) Z7 ~$ M2 E/ h! ^1 b! m4 g- Solution: Please check the provided reference or the vendor website." L$ z  a9 i; `5 Q' j5 M
% W+ M2 }% p1 V' h
- PoC:http://www.youtube.com/v/1VpxlJ5 ... ;rel=0&vq=hd720- k7 Q' A% S8 ~5 |. K
"
0 W: T/ p: x# f- H* \+ CNote: Quick patch for FCKEditor 2.6.8 File Upload Bypass:
, J8 z& m) r6 W. ^' A- Z/ k( H7 v- x8 f6 n7 m, B& U: s
In “config.asp”, wherever you have:" a, n+ e2 d- e+ J% K. B
      ConfigAllowedExtensions.Add    “File”,”Extensions Here”5 n) |( C/ P- N! U2 N
Change it to:
' {! D# a3 b9 g      ConfigAllowedExtensions.Add    “File”,”^(Extensions Here)$”在视频(需翻墙)里,我们可以看的很清楚:# T3 p0 s) t. p$ J1 D
4 l: l: s9 b( k# J  x) R7 C4 i2 K
1.首先,aspx是禁止上传的
; }1 S4 ~* d2 f: @2.使用%00截断(url decode),第一次上传文件名会被转成_符号
( z, ]2 M$ y, O5 ~* x
* F  B4 p8 ]8 [* f! Y) M# \, M# L$ Z0 R

1 I: k& _; G1 W; B, M8 |1 f接下来,我们进行第二次上传时,奇迹就发生了, q# c4 i+ ~* l4 _8 i' b! b

8 A* ]6 O1 H5 t' p7 I5 C& H" P0 r
) q: D# i- N9 j1 u' F7 \1 m  J! C
代码层面分析可以看下http://lanu.sinaapp.com/ASPVBvbscript/121.html
6 t/ [6 L8 t, n" e$ b8 j* G1 y
1 a' s$ t6 R# l: d* e + N( w3 A4 p  x+ u8 T. T# d/ }" ]$ x
+ X& z6 O) a; x( E( b# U
CKFinder/FCKEditor DoS漏洞1 [; `  |2 Y2 J; [
, s, h5 C+ W, H: _8 J
相比上个上传bug,下面这个漏洞个人觉得更有意思7 \+ b4 \% E  o$ m' @

$ b5 {0 ?5 F+ ?% o! H% F ( u0 j' s. Q7 I; L

: |- d) e0 A% i7 X  O( {3 q- pCKFinder是一个强大而易于使用的Web浏览器的Ajax文件管理器。 其简单的界面使得它直观,快速学习的各类用户,从高级人才到互联网初学者。
- u& S+ d4 q* q! w! t$ o9 L, s5 v; B: c# m3 Z0 @0 ^. p& j& a
CKFinder ASP版本是这样处理上传文件的:
( H8 e# T+ D0 Z, d2 ~( r8 f; g5 d
当上传文件名已存在时,会进行迭代重命名,比如file(1).ext存在了,会尝试重命名为file(2).ext……直到不重复为止。
/ d9 G  O* d- Y- H5 f1 d, u- m+ j
那么现在有趣的事情来了——windows是禁止”con”作为文件名的(关于这个问题我印象中很久以前,win也有过con文件名漏洞,有兴趣可以确认下)" c! k$ H$ B- a+ }  z+ L* X

1 A; p  s! g( V5 E! U4 l* O  idos方法也应运而生!- s0 c  q" z/ ]3 P! i) k
8 |! W- m$ h/ \  r# |. i8 M7 n

% x. [3 n6 Z( V7 K  h& y  f- F
% A% R! j. K2 [& z) e  h1.上传Con.pdf.txt# ~3 V/ D. {# H2 C  t+ f  j
2.CKFinder认为“Con.pdf.txt” 已被占用,于是开始尝试Con.pdf(1).txt,Con.pdf(2).txt……Con.pdf(MaxInt).txt从而对服务器形成致命dos。  Q- j3 {. ^5 v6 i/ `9 C

7 Q  r3 K: z/ ?, t* x: ^! K; R, ~
回复

使用道具 举报

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

本版积分规则

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