简体   繁体   中英

Execute command line in C# but hide it from taskmanager

I'm executing command lines containing passwords in C#, if I display the optional "Command Line" column in the windows task manager ("Processes" tab) it contains all the arguments including the passwords, could you think of a way to hide this, like only showing the ".exe" file or something ?

Thanks

If you have control over the program you are calling, you could modify it to read the data from standard input instead of passing the passwords on the command line. This would prevent it from being part of the command line itself, which would "hide" it.

If you cannot change the program, there will be no way to hide the command line used to start the process, as there are Windows API calls that can query this for open processes (which is what is being used by Task Manager).

Well, fist off: In my opinion you should really not do something like passing credentials in a human readable format! Passing a path to a file containing encrypted credentials is not hard to do and much safer.

I don't think that hiding the commandline is even possible. Correct me if I'm wrong.

See: What is the easiest way to encrypt a password when I save it to the registry?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM