是否可以使用小程序获取正在运行的进程列表?

发布于 2024-09-05 08:32:46 字数 121 浏览 3 评论 0原文

我想使用在浏览器中运行的 java 小程序获取正在运行的进程列表。我的理解是,只要小程序签名了,就能够得到这些信息。这准确吗?对于未签名的小程序来说这可能吗?最后,有没有可用的 FOS 小程序可供我查看?

谢谢。

I'd like to get the list of running processes using a java applet running in a browser. My understanding is that, as long as the applet is signed, it will be able to get this information. Is this accurate? Is this possible with an unsigned applet? Finally, are there any FOS applets available that I could take a look at?

Thanks.

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

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

发布评论

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

评论(2

一身骄傲 2024-09-12 08:32:47

当小程序想要访问/执行本地系统资源时,需要进行签名。这包括执行 Runtime#exec()ProcessBuilder 需要它才能获取正在运行的进程列表。

您可以在此处找到如何在 Windows 中获取该列表的基本示例。我建议在继续之前检查 if (System.getProperty("os.name").startsWith("win"))

将给定的示例移植到小程序中并不难,只需让类扩展 JApplet 并从 AccessController#doPrivileged()

至于对小程序进行签名,您可以手动签名 ,最终用户只会面临安全警告,并确认是否执行它,或者您可以让它由第三方公司签署一些 $$$,例如 VeriSign,这样最终用户就不会面临安全警告。不签名会导致小程序根本无法运行。

An applet needs to be signed whenever it want to access/execute local system resources. This includes executing Runtime#exec() or ProcessBuilder which is required to be able to get a list of running processes.

You can find here a basic example how to get that list in Windows. I'd suggest to check if (System.getProperty("os.name").startsWith("win")) before continuing with that.

Porting the given example into an applet isn't that hard, just let the class extend JApplet and execute the whole code from inside AccessController#doPrivileged().

As to signing the applet, you can either sign it manually, the enduser would only face a security warning with a confirmation whether to execute it or not, or you can let it sign by a 3rd party company for some $$$, e.g. VeriSign, this way the enduser won't face the security warning. Not signing it will cause the applet not be able to run at all.

看透却不说透 2024-09-12 08:32:47

您必须执行特定于操作系统的命令(通过 Runtime.getRuntime().exec),例如用于 Windows 的 tasklist.exeps对于类 Unix 系统。

至于安全措施,我很确定这在标准“沙箱”中是不可能的,但“特权”小程序可以做到。

You'll have to execute OS-specific commands (through Runtime.getRuntime().exec), like tasklist.exe for windows and ps for unix-like systems.

As for security measures, I'm pretty sure it's impossible in standard 'sandbox', but 'privileged' applet can do it.

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