SecLab
2024年7月2日
在网络安全领域,软件中的漏洞可能导致重大的安全事件。最近在 Bonjour 服务的 mDNSResponder.exe
中发现的一个漏洞,涉及未引用服务路径(Unquoted Service Path),这是一个值得关注的安全问题。本文将详细介绍这一漏洞的发现过程、潜在风险以及如何进行有效的防范。
通过以下命令可以发现未引用服务路径:
C:\>wmic service get name,displayname,pathname,startmode |findstr /i "auto" |findstr /i /v "c:\windows\\" |findstr /i /v """
Bonjour Service
Bonjour Service
C:\Program Files\Blizzard\Bonjour Service\mDNSResponder.exe
Auto
C:\>systeminfo
主机名: DESKTOP-HFBJOBG
操作系统名称: Microsoft Windows 10 Home
操作系统版本: 10.0.19045 N/A Build 19045
验证版本:
PS C:\Program Files\Blizzard\Bonjour Service> powershell -command "(Get-Command .\mDNSResponder.exe).FileVersionInfo.FileVersion"
>>
3,0,0,10
Bonjour 服务中的 mDNSResponder.exe
存在未引用服务路径漏洞。这可能允许授权的本地用户在未引用的服务路径中插入任意代码,从而提升权限。
未引用服务路径漏洞是指当 Windows 服务启动时,如果服务路径包含空格且未用引号括起来,Windows 会尝试按顺序加载路径中的每个组件。攻击者可以利用这一点,在服务路径中插入恶意可执行文件,从而在系统上下文中执行代码。
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Bonjour Service
。ImagePath
值为 "C:\Program Files\Blizzard\Bonjour Service\mDNSResponder.exe"
。打开命令提示符(cmd)。
输入以下命令:
sc config "Bonjour Service" binPath= "\"C:\Program Files\Blizzard\Bonjour Service\mDNSResponder.exe\""
未引用服务路径漏洞是一个常见的安全问题,通过正确的配置和管理,可以有效避免这一漏洞带来的风险。