M2Team / Privexec

Run the program with the specified permission level (C++20 required)
MIT License
319 stars 52 forks source link

Can't be used normally. #40

Closed fxzxmicah closed 1 year ago

fxzxmicah commented 1 year ago

Report Error: Elavator::impersonation_system_token<OpenProcessToken> 句柄无效。

fxzxmicah commented 1 year ago

Version 3.0.1 works normally.

fcharlie commented 1 year ago

Please tell me your OS version, and if lsass.exe exists.

Windows 11 (x64 22621.1483) does not reproduce the error

fcharlie commented 1 year ago

You can try running the latest version: https://github.com/M2Team/Privexec/releases/tag/5.0.4-beta1

fxzxmicah commented 1 year ago

image Still not working. My OS version is 22623.1250. I'll use the old version for now and that's enough for me.

fcharlie commented 1 year ago

目前我这边无法重现,你的版本是 beta 预览版,不清楚是不是和这个有关,这边有时间再调查下。

我这边 lsass 进程的权限如下:

image

创建 TI 进程的逻辑: 管理员权限启动 --> 提权到 system --> 启动 TI 服务 --> 拷贝 TI Token --> 启动进程。

fcharlie commented 1 year ago

UPDATE: 请尝试 https://github.com/M2Team/Privexec/releases/tag/5.0.4-beta2,如果不行的话,要修复只能下周末了。

fxzxmicah commented 1 year ago

目前我这边无法重现,你的版本是 beta 预览版,不清楚是不是和这个有关,这边有时间再调查下。

我这边 lsass 进程的权限如下: image

创建 TI 进程的逻辑: 管理员权限启动 --> 提权到 system --> 启动 TI 服务 --> 拷贝 TI Token --> 启动进程。

提权到system就已经失败了。 新版本之后我再试试。 在过去能用和现在不能用之间好像与此相关的只有更新系统以及修改了Windows Defender防护选项。

fcharlie commented 1 year ago

那可能 Windows Defender 防护选项是的 lsass 的权限有一些差别,winlogon 的 system 权限应该没有修改。

MouriNaruto commented 1 year ago

@fcharlie 实际上如果用户开启了 LSA 防护的话,是无法打开 lsass 进程的,于是 NSudo 后来的做法是先获取 lsass 令牌,获取不到获取当前会话 winlogon 令牌

参考:https://github.com/M2TeamArchived/NSudo/issues/79

毛利

fcharlie commented 1 year ago

@fcharlie 实际上如果用户开启了 LSA 防护的话,是无法打开 lsass 进程的,于是 NSudo 后来的做法是先获取 lsass 令牌,获取不到获取当前会话 winlogon 令牌

参考:M2TeamArchived/NSudo#79

毛利

https://github.com/M2Team/Privexec/commit/306f50fb626df7840886068f1fa2f697290e0b28 中,我已经改为了支持从多个 system 进程获取令牌,其中包括了 winlogon,如果都获取不到才会失败。

fxzxmicah commented 1 year ago

还是不行。 很好奇为什么3.0.1版本没有问题。

fcharlie commented 1 year ago

还是不行。 很好奇为什么3.0.1版本没有问题。

这是一个疏忽,WinLogon 的 sessionId 是 1,代码中写死了 0,所以会失败,我已经回退到使用 WinLogon 了。

https://github.com/M2Team/Privexec/releases/tag/5.0.4

fxzxmicah commented 1 year ago

还是不行。 很好奇为什么3.0.1版本没有问题。

这是一个疏忽,WinLogon 的 sessionId 是 1,代码中写死了 0,所以会失败,我已经回退到使用 WinLogon 了。

https://github.com/M2Team/Privexec/releases/tag/5.0.4

确实可以了。

那我就要反馈第二个3.0.1正常,但是当前版本存在的问题: 未加载Privexec.json文件或加载失败,而且此问题从4.0.0版本开始就一直存在。

因为用的次数不多,所以没有反馈,但是其实早就想反馈了。

fcharlie commented 1 year ago

还是不行。 很好奇为什么3.0.1版本没有问题。

这是一个疏忽,WinLogon 的 sessionId 是 1,代码中写死了 0,所以会失败,我已经回退到使用 WinLogon 了。 https://github.com/M2Team/Privexec/releases/tag/5.0.4

确实可以了。

那我就要反馈第二个3.0.1正常,但是当前版本存在的问题: 未加载Privexec.json文件或加载失败,而且此问题从4.0.0版本开始就一直存在。

因为用的次数不多,所以没有反馈,但是其实早就想反馈了。

已修复,原因是 privexec 没有检查 privexe.json 目录是否存在

fxzxmicah commented 1 year ago

已修复,原因是 privexec 没有检查 privexe.json 目录是否存在

它在软件目录又生成了一个appdata文件夹,所以软件根目录的Privexec.json文件没用了?

fcharlie commented 1 year ago

你把之前的拷贝过去替换就可以了,这个是为了保持和 baulk 安装的一致,baulk install wsudo。

获取 Outlook for iOShttps://aka.ms/o0ukef


发件人: Fxzx micah @.> 发送时间: Thursday, April 6, 2023 11:33:59 PM 收件人: M2Team/Privexec @.> 抄送: Force Charlie @.>; State change @.> 主题: Re: [M2Team/Privexec] Can't be used normally. (Issue #40)

已修复,原因是 privexec 没有检查 privexe.json 目录是否存在

它在软件目录又生成了一个appdata文件夹,所以软件根目录的Privexec.json文件没用了?

― Reply to this email directly, view it on GitHubhttps://github.com/M2Team/Privexec/issues/40#issuecomment-1499260066, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABUVS4DCTKQD2CGWAZQCLOTW73O6PANCNFSM6AAAAAAWQGFD5M. You are receiving this because you modified the open/close state.Message ID: @.***>