Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Detect logon ID from Browser

by mattr (Curate)
on May 16, 2002 at 06:03 UTC ( [id://166933] : note . print w/replies, xml ) Need Help??


in reply to Detect logon ID from Browser

Generally the answer is no, but.. technically I think the answer might be yes if you can get your user to run a program (written in Perl though they don't need to know) to do so.

With the getpwuid command in Perl (or unix command line) you can get your login. I suppose the script could send this information in an encrypted signed hash as a cgi parameter to your server-side cgi program.

The information could be sent by having the client-side script open this composed URL in netscape. I sometimes use the following to open a picture in netscape.. probably this wouldn't be secure if you can read the source or replace it with your own script, so no guarantees. Also the URL would go out as cleartext if you are not running ssl.

cat /sbin/nsopen #!/usr/bin/perl $in = shift; $cmd = "netscape -remote \'openURL(" . $in . ")\'"; system $cmd;

The above code just opens a page in Mozilla. Possibly this kind of thing could be done in Windows too.

Update: I was thinking that this was a closed environment where you are running the server and everyone is logged in to it already. Otherwise, as Zaxo mentioned this is probably not a snooper script you will be able to get people to install. Was thinking of X based gui clients for astronomy or the mysql gui. Maybe not applicable to what you want to do.

Replies are listed 'Best First'.
Re: Re: Detect logon ID from Browser
by TexasTess (Beadle) on May 16, 2002 at 08:07 UTC
    This would be in a closed environment where spoofing a username would not be a concern, it's going to be on an intranet where there is no "world" access. I'm going to try messing around with the code you've provided but will start developing login/passwords in the meantime..thanks for your advice..if you think of anything else...I'd love to hear it! TexasTess "Great spirits often encounter violent opposition from mediocre minds" --Einstein
      Got Logons/passwords working with a Cookie tracker today..I have a co-worker who is a whiz with encription keys that developed a nifty bit of code for protecting the passwords. Thanks again for your help, I Am SOO glad I found this site..it's great!

      TexasTess
      "Great Spirits Often Encounter Violent Opposition From Mediocre Minds" --Albert Einstein