LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-28-2006, 04:55 PM   #1
jon_k
Member
 
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Rep: Reputation: 30
Hide program arguements from ps?


Hi,

I've got a command that runs with sensitive arguements. Basically it is lynx with the -auth=username:password as an arguement (as well as the URL it's authing with)

I use to run this in a cronjob since it needs to be run periodically, however, I found it shows up in ps output when running. This is a security risk as users logged on the machine shouldn't see this if they run a ps command. Sensitive arguements and all.

I've got an option here, add another machine on the network that can run this command, or, somehow hide this command.

I've tried putting the command in a bash script, but the items just run as a sub-process to the bash script.

I also wrote a pretty simple application in C that uses system() and it still just spawns a sub-shell like this:
root 2400 0.0 0.1 2664 548 pts/1 S+ 16:46 0:00 | \_ ./sync.bin
root 2401 0.0 0.0 1660 464 pts/1 S+ 16:46 0:00 | | \_ sh -c sleep 5; killall sync.bin
root 2403 0.0 0.0 1660 476 pts/1 S+ 16:46 0:00 | \_ sh -c PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin lynx -source -auth=user:pass 'http://website'>>/var/log/syncout.log

Is there any way I can -prevent- this from showing in PS output in any way? Seems there must be a way.

If anyone can help me out, I'd appreciate it!

Last edited by jon_k; 10-28-2006 at 04:57 PM.
 
Old 10-28-2006, 06:03 PM   #2
JanusPaul
Member
 
Registered: Nov 2004
Location: Houston, Texas
Distribution: Ubuntu, Debian, Solaris, Free BSD
Posts: 82

Rep: Reputation: 15
Lightbulb

lynx -source -auth=`< user.txt`:`< pass.txt` 'URL'

Try plugging into something like that. And obviously give user.txt & pass.txt (400) permissions some attention.
 
Old 10-28-2006, 08:01 PM   #3
slantoflight
Member
 
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Blog Entries: 3

Rep: Reputation: 35
i believe md5 has this scheme where you have your passphrase argument in brackets and it doesn't show up in ps.

md5 <passphrase> -some other arguments, etc. etc.

maybe its int main() might have a few hints.
 
Old 10-29-2006, 12:52 AM   #4
jon_k
Member
 
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Original Poster
Rep: Reputation: 30
Hi,

Thanks for the advice everyone.

Here's what seems to work wonders.


lynx `< /opt/credentials` 'http://dynamic.zoneedit.com/auth/dynamic.html?host=uberleet.org' >> /dev/null 2>&1

Where the file /opt/credentials has the following contents:

-auth=username:password


Then, chmod the file 400, run the command as root, presto, obscured credentials. Seems to be the easiest way.

Last edited by jon_k; 10-29-2006 at 12:54 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide X tux06 Debian 7 10-14-2006 12:25 PM
In KDE 3.4, Can one hide a program from taskbar. Brian1 Linux - Software 2 09-23-2005 07:05 PM
alias command line arguements Henster Linux - Newbie 2 07-01-2005 03:40 AM
alternative printf ... multible arguements jnusa Programming 4 12-14-2004 06:22 AM
Why hide the logout? tomplate General 8 03-14-2002 01:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration