1

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

r4dius
  • 51
  • 1
  • 7

2 Answers2

5

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).

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • Thanks for your answer, I use this method to run remote connexion tools (putty / winscp...) in an automated way, some have source code available I'll have a look :) – r4dius Aug 01 '12 at 11:53
0

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?

Community
  • 1
  • 1
mw_21
  • 150
  • 5