Link to home
Create AccountLog in
Avatar of Indarnav
Indarnav

asked on

Run Defined Processes

VC++ code that keep running, allow only those processes to run which are defined in code, terminate all other processes as soon as they start. I know XP need certain processes for smooth operation, so assume all those will be added along with processes of my choice.
Avatar of rowansmith
rowansmith

What are you trying to achieve?

If you are trying to stop users from running rogue/unauthorised software this is not going to work.

e.g., you will need to allow the System to run, using various system calls I can get the system to run my program as a thread which is not visible in the process table and which is not even started as a .exe

There is a good document here: http://www.interhack.net/pubs/email-trojan/

You need to educate your users, if they have access they can run whatever they want.  unless you introduce a code-signing system and lock the OS right down using the built in security.

-Rowan
Avatar of Indarnav

ASKER

i understand ur concern, but still i insist please provide me let me try that too
You can use the system() function provided in the stdlib header file to call a system function.

Check
http://www.cplusplus.com/reference/clibrary/cstdlib/system.html

The system functions you will need to call are as follows:

1) processes can be listed using tasklist.exe. I think this exists only on Win XP. Check the output of this command.

2) If you know the users on your system then

you can kill processes of a particular user as follows:

taskkill /F /FI "USERNAME eq Quinn"

Also check the below discussion for more info

http://www.tech-recipes.com/rx/446/xp_kill_windows_process_command_line_taskkill/
your all methods are inverse of what i m looking for. it is not possible to implement those for me. so please provide what i want.
jkr, you are right, but that was in vbs and this i asked in vc++, anyway as u wish.
ok
dear admin,

please ask some one to provide me code in vc++ for the query raised, so many days passed no suitabler reply received. it is getting delayed.
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer