一小程序,无意间看到的顺便就看了下
./admin/editor/upload.php
require_once ("../admin_conn.php"); $action=be("get","action"); $ftypes=array('jpg','gif','bmp','png',".jpeg"); $upfileDir= "../". $_SESSION["upfolder"] . "/" . getSavePicPath() . "/"; $maxSize=1000; if(!file_exists($upfileDir)){ mkdir($upfileDir); } foreach($_FILES as $FILEa){ if(!in_array(substr($FILEa['name'],-3,3),$ftypes)) $errm = "文件格式不正确1 [ 重新上传 ]"; //只是将消息存入一个变量 并没有showmsg and exit... if($FILEa['size']> $maxSize*1024) $errm = "文件大小超过了限制 [ 重新上传 ]"; if($FILEa['error'] !=0) $errm = "未知错误"; $targetDir= "../". $_SESSION["upfolder"] . "/" . getSavePicPath() . "/"; //没有登录 so session=null... $targetFile=date('Ymd').time().substr($FILEa['name'],-4,4); $realFile=$targetDir.$targetFile; if(function_exists('move_uploaded_file')){ move_uploaded_file($FILEa['tmp_name'],$realFile); //移动上传文件 if(app_watermark==1){ imageWaterMark($targetDir.$targetFile,app_waterlocation,app_waterfont); } if($action=="xht"){ echo "{'err':'".$errm."','msg':'".app_installdir. replaceStr($upfileDir,"../../","").$targetFile."'}"; } else{ //现在才die是不是迟了点? die(""); } } else{ @copy($FILEa['tmp_name'],$realFile); //同上 if(app_watermark==1){ imageWaterMark($targetDir.$targetFile,app_waterlocation,app_waterfont); } if($action=="xht"){ echo "{'err':'".$errm."','msg':'".app_installdir. replaceStr($upfileDir,"../../","").$targetFile."'}"; } else{ die(""); } } }
为什么说他鸡肋呢,应为./admin/index.php
if(cururl.indexOf("/admin/") >0){alert('请将文件夹admin改名,避免被黑客入侵攻击');}
so,我搜了下 大多数 (90%++)都修改了后台地址所以是鸡肋之处
exp
上传之后直接查看源文件。。
转自:http://www.90sec.org/thread-1727-1-1.html
留言评论(旧系统):
文章来源于lcx.cc:maccms 鸡肋上传漏洞
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论