Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
you see I work at a school as IT support and I have come up with an idea on how to report attempts to tamper with the computers. What I want is a way to handle a process. For example.

A student opens cmd and my application handles that process and runs “sysadmin.exe message” which will display a message reporting to cmd access to myself and I will tell the head.

What I have tried:

I have tried Selecting the process then trying to redirect input but with no success. I can detect if it’s open but I want to write a message to them in that process. I don’t want to have to close and start up again.
Posted
Updated 28-Jan-19 5:24am
Comments
Dave Kreskowiak 27-Jan-19 20:27pm    
Why would you want to be notified every time CMD.EXE is run? That happens more than you know and not just when a user launches it. It's also not a sign of tampering on the machine.
WOLF 2018 28-Jan-19 2:46am    
I know but I want to scare them a bit lol. As I thought them seeing that cmd is telling them not to use it is more fun.
Dave Kreskowiak 28-Jan-19 9:33am    
You don't have a remote method of doing that. You would have to write an app that is installed on the machines ahead of time and runs when the users log in. The app would then run as the user that logged in.

It would have to monitor process creation, looking for instance of CMD.EXE, then it could display a dialog box with your warning.

Keep in mind, this now makes YOU the one tampering with the machines.
WOLF 2018 28-Jan-19 16:46pm    
I use task Scheduler and run as admin and not just that the process protects itself because if you close it you will get a BSOD.
Dave Kreskowiak 28-Jan-19 17:02pm    
Your approach to protecting the app results in an unstable machine, loss of users data, and possible corruption of the drives.

And you're worried about OTHER people "tampering" with the machine?

To disable access to CMD.EXE (and in general control what a user can and cannot do), you should instead use the Group Policy Editor[^].

/ravi
 
Share this answer
 
Comments
WOLF 2018 28-Jan-19 2:50am    
As I said I need a method of inputting information into cmd when run by user that way I can give them a scare and let them know I am watching.
If you control the PC, then the simplest option would probably be to use the Image File Execution Options registry key:
An Introduction to Image File Execution Options - Malwarebytes Labs | Malwarebytes Labs[^]
registry - Set "Image File Execution Options" will always open the named exe file as default - Stack Overflow[^]

NB: Since this technique is often abused by malware, your antivirus might flag this as an unknown virus.

You also need to be very careful, since it's possible to break your OS with this technique.
Beware the Image File Execution Options key – The Old New Thing[^]
 
Share this answer
 
Comments
WOLF 2018 28-Jan-19 18:46pm    
Thanks you for this. I will try it out later and see if it works and hopefully that will let me write them a message to tell them to stop. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900