Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sending password to command line tools

Tags:

python

bash

shell

i'm writing a python application that uses a command line utility (propietary so it can't be modified) to do part of its work. The problem is that I have to pass the password as a command line argument to the tool which would easily be seen by any user doing 'ps ax'. How can I send the password to the command line tool safely from within python (or a shell script)?

like image 903
theprole Avatar asked Dec 10 '10 10:12

theprole


1 Answers

If the application has some interactive mode, you can use something like pyexpect.

If it only accepts passwords on command line the application was DESIGNED to be vulnerable to 'ps ax', how are you expected to overcome original bad design? It is propietary, complaints should go to the guilty^H^H^H^H^H^Hauthor.

like image 139
Paulo Scardine Avatar answered Sep 20 '22 15:09

Paulo Scardine