Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch process and hide command line parameters from Task Manager

I'm not sure if this question is more appropriate for Stackoverflow or SuperUser or what StackExchange site...

Basically I'm launching a third-party app from C# with Process.Start with several command line parameters. One of those command line parameters is a password.

I think I'm doing a really good job of securing that password everywhere in my app, except if you open the Processes tab in Task Manager, you can add the "Command Line" column and see all of those command line parameters.

Can anyone think of a way to launch a process that somehow has the command line params hidden? Is this possible at all?

Thank you!

EDIT:

This is a Windows Service wrapper for plink.exe (SSH/Putty stuff). It will prompt for a password if I don't specify the password in the command line, but I get this weird warning:

Plink.exe - 3/30/2013 2:40:47 PM - Attempting keyboard-interactive authentication
Plink.exe - 3/30/2013 2:40:47 PM - Server refused keyboard-interactive authentication
Plink.exe - 3/30/2013 2:40:49 PM - [email protected]'s password: 

I have specified to redirect the standard input, but perhaps I will continue looking in to that and see if I can work-around it. Also, as David Heffernan recommended, I'm going to look further into Pageant. Thank you everyone - I will post an update once I figure out a better solution!

like image 825
Adam Plocher Avatar asked Mar 30 '13 08:03

Adam Plocher


2 Answers

There's no way to pass a command line argument to a process, so that the process can see it, but everything else in the system cannot.

This is an obvious flaw and when programs allow passwords to be passed as arguments, it's usually done for convenience for the user that is not concerned about eavesdroppers. Well designed programs will usually provide, in addition, other secure means of authentication.

like image 146
David Heffernan Avatar answered Oct 19 '22 00:10

David Heffernan


If you set an ACL for the new process, it should restrict who can read the command line information. An empty ACL, granting no permissions, might block access to administrators using Task Manager, though my first guess is that it will not. (Note that an empty security descriptor is not the same thing as an empty ACL. One implicitly grants permission to everyone, the other implicitly denies it.)

Of course, an administrator could always replace plink.exe with something that stores the password somewhere. So I'm not sure that worrying about what the administrator can see with Task Manager makes sense!

like image 2
Harry Johnston Avatar answered Oct 18 '22 23:10

Harry Johnston