开发者

Is it possible to get a list of running processes using an applet?

开发者 https://www.devze.com 2023-01-03 05:50 出处:网络
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.开发者_运维技

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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号