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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2012-12-10 10:20:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
感谢生生不息在freebuf社区”分享团”里给出线索,才有了本文
5 P" i9 g0 S0 r& E5 n2 E
3 b" D0 b" _; M" Z4 e& E原帖:http://club.freebuf.com/?/question/129#reply12
' Y$ P$ L: N* D& L3 L0 T: s& P7 M2 e& z- ^/ u' k9 Z
FCKEditor 2.6.8文件上传漏洞
7 {( n) D' s2 |9 T4 ?8 H( C/ Y$ i* X
Exploit-db上原文如下:
- h3 l; Q0 _7 c1 k. n# ]& _" k+ a6 l) x5 d/ _9 M% ]
- Title: FCKEditor 2.6.8 ASP Version File Upload Protection bypass
2 Q# p( ?) g" H" X- Credit goes to: Mostafa Azizi, Soroush Dalili$ g  v0 K- \$ J  h8 t8 D
- Link:http://sourceforge.net/projects/fckeditor/files/FCKeditor/5 p, o' B, q  T3 K
- Description:  ^' Y: I" Q* Z5 H
There is no validation on the extensions when FCKEditor 2.6.8 ASP version is
1 r- S- R7 B" u* Qdealing with the duplicate files. As a result, it is possible to bypass: c' N$ A6 C" [
the protection and upload a file with any extension.- a" C9 d: X- t# c5 y6 ~
- Reference: http://soroush.secproject.com/blog/2012/11/file-in-the-hole/+ j1 I$ f( ]9 j- [: H
- Solution: Please check the provided reference or the vendor website.. ?  y. p9 C2 r( k9 E
. T- L, L% y/ D1 P/ _
- PoC:http://www.youtube.com/v/1VpxlJ5 ... ;rel=0&vq=hd7204 B" p' e( ]8 t  R3 l( G6 q  D
"/ }1 }0 t% A8 c  N% P+ _7 c
Note: Quick patch for FCKEditor 2.6.8 File Upload Bypass:. |, h: B, v3 ]+ ~

0 X8 K) P8 ^- Z: s$ A/ u- z! ~In “config.asp”, wherever you have:
9 ^. N8 P+ R( S5 S1 b3 d3 E      ConfigAllowedExtensions.Add    “File”,”Extensions Here”
" p. O! t- @9 F# p# gChange it to:# O% m3 ]* M9 o
      ConfigAllowedExtensions.Add    “File”,”^(Extensions Here)$”在视频(需翻墙)里,我们可以看的很清楚:
# p4 l+ z0 Z& v8 a$ V
5 `. @& z* G& U% X) y1.首先,aspx是禁止上传的4 o9 G. [; c% t2 h
2.使用%00截断(url decode),第一次上传文件名会被转成_符号
, a, Y1 u1 {9 F! ]; K- w
. ~5 }9 x2 Z& n8 U, S8 e% u+ K/ r6 @: J# t  L; s  X3 V2 Z

2 y' R& B9 i& H+ F6 {/ _7 f接下来,我们进行第二次上传时,奇迹就发生了
- e, w  U! \5 ]" T1 Q$ y' l
7 y" Q0 K; q9 G4 S8 H  r5 t, Y: \; ~  o

! N% }# U$ u& u代码层面分析可以看下http://lanu.sinaapp.com/ASPVBvbscript/121.html
7 c2 @- o; H" n6 J- ~& R
  U) X" }' w" W' T" `0 p5 {
7 H6 m$ r- y" f! j( i& r1 u- H* H3 s' e
CKFinder/FCKEditor DoS漏洞; L5 |' v( {0 |# y0 E: a! C
$ e5 E" i. y+ h7 V; h
相比上个上传bug,下面这个漏洞个人觉得更有意思' Z/ M& n5 B4 @
0 M% G! K) N6 b6 M
6 F7 e; P" [9 K3 r2 Q2 c5 w$ t
" H$ i& W6 I" t3 e
CKFinder是一个强大而易于使用的Web浏览器的Ajax文件管理器。 其简单的界面使得它直观,快速学习的各类用户,从高级人才到互联网初学者。
8 V5 j, r+ Q$ k3 {# w: g% i& h# T. W2 b% R
CKFinder ASP版本是这样处理上传文件的:
0 U% x0 Q7 D" ^4 B5 ~! Z2 F
# C7 c! ]! U+ t: ^当上传文件名已存在时,会进行迭代重命名,比如file(1).ext存在了,会尝试重命名为file(2).ext……直到不重复为止。' [$ W1 Y3 M/ o1 m8 d

& s' L4 s6 S/ r4 Y那么现在有趣的事情来了——windows是禁止”con”作为文件名的(关于这个问题我印象中很久以前,win也有过con文件名漏洞,有兴趣可以确认下)3 F$ P- q) j, |2 Y

" b) e6 l( n' B$ V: {  W- R1 ldos方法也应运而生!6 `: {( {0 v# t0 _
; O* i7 ]3 \- o/ E5 t3 B

3 N7 t5 G$ n0 g( E3 D  u; e( o
4 K/ c$ N9 z& M( Z( r1.上传Con.pdf.txt
8 o0 d6 X* L6 B$ Q9 k2.CKFinder认为“Con.pdf.txt” 已被占用,于是开始尝试Con.pdf(1).txt,Con.pdf(2).txt……Con.pdf(MaxInt).txt从而对服务器形成致命dos。
& a" \6 j$ t' g
9 b6 D  o! ^9 S& x7 k' z
回复

使用道具 举报

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

本版积分规则

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