远程系统上可执行文件的 .NET Process.Start() - 安全警告?

发布于 2024-08-31 14:47:21 字数 371 浏览 3 评论 0原文

我创建了一个 Windows 服务,它通过 WCF 接受来自远程计算机的命令。这些命令之一是运行指定的可执行文件(让我们忽略此类功能的安全影响)。

在我的服务中,我使用 Process.Start() 来运行可执行文件。如果可执行文件位于计算机本地,则一切正常,但如果它位于远程文件共享上,则会失败且没有错误(或更准确地说只是挂起)。我怀疑问题在于它触发了标准的 Windows“未经验证的发布者”警告,如果双击远程系统上的 exe,就会看到该警告。

有什么方法可以从我的服务中绕过这个问题,以便我可以真正运行任何可执行文件?正如我所说,我了解允许它运行任何可执行文件的安全隐患,但这确实是我所需要的。我本以为这个警告只是一个用户模式概念,但它确实似乎妨碍了我的服务。

有想法吗?

I've created a Windows Service that accepts commands from remote machines via WCF. One of those commands is to run a specified executable (let's ignore the security implications of such functionality).

In my Service I am using Process.Start() to run the executable. All works well if the executable is local to the machine, but if it is on a remote file share it is failing with no error (or more accurately just hanging). I suspect the problem is that it is triggering the standard Windows 'Unverified Publisher' warning that one would see if they double click an exe on a remote system.

Is there any way I can bypass this from my service so that I can truly run any executable? As I said I understand the security implications of allowing it to run any executable, but this is really what I need. I would have thought this warning was only a user mode concept, but it really does seem to be getting in the way of my Service.

Ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情绪操控生活 2024-09-07 14:47:21

我有同样的问题。您对“未经验证的发布者”警告的看法是正确的。

我的解决方案是将 EXE 本地复制到 %TEMP% 文件夹中,然后从那里启动它。就我而言,这是最佳选择,因为 EXE 没有依赖项。

I had the same issue. And you are right about the 'Unverified Publisher' warning.

My solution was to copy the EXE locally into the %TEMP% folder and kick it off from there. In my case, this was optimal because the EXE had no dependencies.

心意如水 2024-09-07 14:47:21

您可能需要检查运行该服务的帐户的权限。您可能需要使用具有更多权限的帐户来运行不在盒子上的文件。测试它的一种简单方法是让服务在管理员帐户下运行。如果有效,那么您就知道问题出在哪里。

You might want to check the permissions of the account that is running the service. You might need to use an account with more privileges to run files not located on the box. One easy way to test it is to have service run under an admin account. If it works, then you know where the issue is.

墨落成白 2024-09-07 14:47:21

也许您应该检查 .net Framework 运行时安全策略并调整区域安全设置。

Perhaps you should check .net framework Runtime Security Policy and adjust zone security settings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文