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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2012-12-10 10:20:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
感谢生生不息在freebuf社区”分享团”里给出线索,才有了本文0 X1 @2 k5 i. O: t! E# V! i" t1 n
; U+ P0 ?8 r- }' k# Q$ V
原帖:http://club.freebuf.com/?/question/129#reply12! y, F8 D8 E- p1 o/ y. e

, g6 T( N% }: @- O( WFCKEditor 2.6.8文件上传漏洞
- L+ e1 ?  w# J* S( L* F  {; ^0 R1 W2 B$ g0 q! \( ]
Exploit-db上原文如下:
* T9 ~3 I+ {4 i7 w9 K) U2 x
# }; h* L; b7 h& |1 {- Title: FCKEditor 2.6.8 ASP Version File Upload Protection bypass# B/ O! v- [8 W2 P7 a' [2 A6 _
- Credit goes to: Mostafa Azizi, Soroush Dalili5 i- Q. |+ o0 c( O4 A; w; i5 m
- Link:http://sourceforge.net/projects/fckeditor/files/FCKeditor/6 J; x  O' Z* s  N& @4 Y
- Description:) e4 g- j6 N- S2 g
There is no validation on the extensions when FCKEditor 2.6.8 ASP version is1 ?- J, n. y: Z+ J& z' v, q
dealing with the duplicate files. As a result, it is possible to bypass
# t$ U+ R6 s1 b* z2 athe protection and upload a file with any extension.1 K6 O3 j8 r5 o9 M7 Z! t: |
- Reference: http://soroush.secproject.com/blog/2012/11/file-in-the-hole/
2 Q( d. _# N+ {- I3 [- Solution: Please check the provided reference or the vendor website.
: q6 I- V! k, C) W. u& F* O  i5 ~. d& B! ~5 X- {4 ?
- PoC:http://www.youtube.com/v/1VpxlJ5 ... ;rel=0&vq=hd720+ c. p3 b6 z( A( b- J, D
"
# q3 j& U$ _2 Z( |1 LNote: Quick patch for FCKEditor 2.6.8 File Upload Bypass:- h- k/ t$ ~! k) U! U& N
$ I4 O$ Q' }# j* h6 S! a  t$ `
In “config.asp”, wherever you have:
7 D' H4 J/ b- R0 l; P9 C) `% u8 g5 J# f      ConfigAllowedExtensions.Add    “File”,”Extensions Here”
' L% p' l4 n: t' |4 e/ @- NChange it to:
- E& J. O2 g2 k; |$ g/ G2 z' K      ConfigAllowedExtensions.Add    “File”,”^(Extensions Here)$”在视频(需翻墙)里,我们可以看的很清楚:
/ E5 p: q' [6 F, T/ a5 C
: F. ?0 l, Z, t. e# K1.首先,aspx是禁止上传的
8 [7 X* s' J" n! |7 {: t% M: a  c2.使用%00截断(url decode),第一次上传文件名会被转成_符号
1 Y1 M  S" G4 ~" _2 T% f( P7 ^. U' j* @8 Z+ U

/ h1 o( R5 t: ^. p! K0 \( U0 H! g9 |! t! {' W4 g
接下来,我们进行第二次上传时,奇迹就发生了4 S  {  }$ [  \* e

$ O0 _( U3 c: K* D1 X# b* ]4 ^+ \7 [

% b/ {. b$ @& e9 s: e/ |  R代码层面分析可以看下http://lanu.sinaapp.com/ASPVBvbscript/121.html6 X; S8 C) a1 N+ Q

3 ~2 W8 S* V3 L1 q * |0 ?) d! L; U- m8 S8 C

- N( k5 _5 X& V2 ICKFinder/FCKEditor DoS漏洞
$ c* s. j4 O! Z9 }
. ^$ ^! P2 \& }; `1 @, g3 l: c, k5 n相比上个上传bug,下面这个漏洞个人觉得更有意思. G+ y1 K- Q+ k; S3 J+ c0 i: ?

' R4 E1 a  A7 q$ j! t) P. \$ v % R$ ?8 ~. F* a
- A  M. b* ^, U
CKFinder是一个强大而易于使用的Web浏览器的Ajax文件管理器。 其简单的界面使得它直观,快速学习的各类用户,从高级人才到互联网初学者。 / a: f% |1 ?; O6 U' B) _6 y- k

4 P5 x0 H9 `- Y. s: ~5 l# X$ HCKFinder ASP版本是这样处理上传文件的:6 i4 J( B$ p8 P% B5 N1 D. @

; ~. S0 e7 g" i" _当上传文件名已存在时,会进行迭代重命名,比如file(1).ext存在了,会尝试重命名为file(2).ext……直到不重复为止。
9 d* P- F2 ~5 N$ |
4 C2 v( ]. o; ?' _- t  p那么现在有趣的事情来了——windows是禁止”con”作为文件名的(关于这个问题我印象中很久以前,win也有过con文件名漏洞,有兴趣可以确认下)! M) U" F. v# u9 R

/ [/ E3 K7 C' [8 O" D+ u2 fdos方法也应运而生!
# ^$ q+ e0 O" N' A( P* B& p/ N5 J" K

6 Z, D1 f9 i: e9 F6 [1 ]
" Z- p9 t; Z" {* I; J2 [1.上传Con.pdf.txt
3 E2 W- G$ z4 h% Z6 A2.CKFinder认为“Con.pdf.txt” 已被占用,于是开始尝试Con.pdf(1).txt,Con.pdf(2).txt……Con.pdf(MaxInt).txt从而对服务器形成致命dos。
% G/ G7 S4 r# u7 f3 V1 G2 `1 K. ]) Z, f' J4 F0 j" x% x6 T  e
回复

使用道具 举报

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

本版积分规则

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