开发者

Disable Windows Task Manager so he cant kill my process

开发者 https://www.devze.com 2023-03-31 18:40 出处:网络
I have built an app that can count the time. After two hours its says \"please stop playing开发者_StackOverflow or I will shut down the computer\".

I have built an app that can count the time.

After two hours its says "please stop playing开发者_StackOverflow or I will shut down the computer". So, my brother can stop the process from the "Windows Task Manager". Is it possible to stop it? So he can't kill it form there?

I have tried to reopen the app when the windows forms close - any other ways?


Haha, good on your brother. He is a hacker in the making.

You need to run the process with administrator privileges and make sure his login dosent have administrator privileges.


Maybe using a Service is a better approach, because it is harder to find in the task manager and it should automatically restart if "killed", but as long as the user has administrator rights he is always able to disable such things.

See THIS WALKTHROUGH on how to create a service with C#.


Perhaps slight over-kill (and not easily possible in C#), but you could instead write a DLL that implements the timer, and inject it into another process (e.g. Explorer.exe), which means that it won't appear as a separate process in Task Manager, and so won't be possible to kill in that way.


I probably shouldn't mention this as it can be easy to abuse, but knowledge needs to be free, right?

If you run your process as the SYSTEM user, then it cannot be shut down, even by anyone logged in as Administrator. Quite simply, you use psexec from Sysinternals to run your process, check this blog post for details: How to: Run a cmd under system account / gain access to system account


I'm afraid this is not possible in general. As long as the user has administrative rights he can kill any process.

I would suggest to implement and run your application as a windows service. An administrator can stop the service as well. But users without administrative rights are not allowed to do so.

0

精彩评论

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

关注公众号