
Python 2.7
Burp Suite
Security Tool
本项目是一个专为 Burp Suite 设计的 Python 扩展插件,旨在主动检测 CVE-2025-31324 漏洞。该漏洞是 SAP NetWeaver Visual Composer 组件中一个被评分为 10.0(严重)的未授权文件上传漏洞,攻击者可以利用 /developmentserver/metadatauploader 端点上传恶意文件,从而实现远程代码执行。
此插件通过模拟一个无害的文件上传请求,并分析服务器响应,帮助安全工程师在授权测试中快速、准确地定位该高危漏洞。
/developmentserver/metadatauploader 端点,主动发送构造的测试文件上传请求。Extender -> Options 选项卡。Python Environment 部分,点击 Select file...,选择你刚刚下载的 Jython JAR 文件。.py 文件,例如 cve_2025_31324_scanner.py。Extender -> Extensions 选项卡,点击 Add。Extension Type 选择 Python,然后在 Extension File 中选择你刚刚保存的 cve_2025_31324_scanner.py 文件。Next,观察 Output 选项卡,如果看到 CVE-2025-31324 Scanner loaded successfully 的输出,则表示加载成功。Target 选项卡中,将目标 SAP NetWeaver 应用添加到扫描范围。Do an active scan,或者通过 Burp Scanner 配置专门的扫描任务。以下是插件中用于构造攻击请求和验证漏洞的核心代码片段:
# 核心功能:构造并发送测试文件上传请求
def doActiveScan(self, baseRequestResponse, insertionPoint):
# 1. 目标检测:仅针对特定的漏洞端点
request_info = self._helpers.analyzeRequest(baseRequestResponse)
url = str(request_info.getUrl())
if not url.lower().endswith("/developmentserver/metadatauploader"):
return None
# 2. 漏洞验证:构造一个无害的文本文件上传请求
test_filename = "test_cve_2025_31324.txt"
test_content = "CVE-2025-31324 test file"
boundary = "----WebKitFormBoundaryTest1234"
# 构建 multipart/form-data 的请求体
body = (
"--{}\r\n"
'Content-Disposition: form-data; name="file"; filename="{}"\r\n'
"Content-Type: text/plain\r\n"
"\r\n"
"{}\r\n"
"--{}--\r\n"
).format(boundary, test_filename, test_content, boundary)
# 3. 构造完整的 HTTP 请求
headers = [
"POST {} HTTP/1.1".format(request_info.getUrl().getPath()),
"Host: {}".format(request_info.getUrl().getHost()),
"Content-Type: multipart/form-data; boundary={}".format(boundary),
"Content-Length: {}".format(len(body)),
"Connection: close"
]
request = "\r\n".join(headers) + "\r\n\r\n" + body
# 4. 发送请求并接收响应
check_request = self._helpers.stringToBytes(request)
response = self._callbacks.makeHttpRequest(
baseRequestResponse.getHttpService(), check_request
)
# 5. 结果判定:通过状态码判断是否存在漏洞
response_info = self._helpers.analyzeResponse(response.getResponse())
status_code = response_info.getStatusCode()
# 如果返回200,则认为可能存在漏洞
if status_code == 200:
# 创建并返回一个自定义的漏洞报告
return None# 核心功能:自定义漏洞报告,包含详细的上下文信息
def __init__(self, httpService, url, httpMessages, name, detail, severity, confidence, evidence):
self._httpService = httpService
self._url = url
self._httpMessages = httpMessages
self._name = name
# 将证据格式化后附加到详情中
self._detail = detail + "<br><br><b>Evidence:</b><ul><li>" + "</li><li>".join(evidence) + "</li></ul>"
self._severity = severity
self._confidence = confidence
# 提供漏洞的权威背景信息
return "CVE-2025-31324 is a critical vulnerability in SAP NetWeaver Visual Composer, allowing unauthenticated attackers to upload malicious files, potentially leading to remote code execution. CVSS Score: 10.0."
def getRemediationBackground(self):
# 提供清晰的修复指引
return "Apply SAP Security Note 3594142 immediately to patch the vulnerability. Restrict access to the /developmentserver/metadatauploader endpoint."原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。