perl and telnet 
Author Message
 perl and telnet

: does anybody have a perl script that allows you to telnet to another site
: and  logon with name and password. i'm trying to create a telnet seesion
: that will logon with the username and the password that i create, but not
: let other users know the name or password. all they'll be able to do is
: run the telnet session and the script logs them on without them knowing
: anything until it gets by the login session. thanks for any help

You could make the script suid root and put the username/password
in a file somewhere readable only by root.

This is the script.pl:

#!/bin/perl
open(PWD,"/etc/telnpwd");
($user,$pwd)=split(":",<PWD>);
close PWD;
&your_telnet_proc($user,$pwd);  #you might use the expect package for doing the telnet in this sub

In unix:

%chown root script.pl
%chmod 4755 script.pl

%cat >/etc/telnpwd
username:passwd
^D

--
Kjetil Skotheim, USIT - University of Oslo



Mon, 24 Nov 1997 03:00:00 GMT  
 perl and telnet
does anybody have a perl script that allows you to telnet to another site
and  logon with name and password. i'm trying to create a telnet seesion
that will logon with the username and the password that i create, but not
let other users know the name or password. all they'll be able to do is
run the telnet session and the script logs them on without them knowing
anything until it gets by the login session. thanks for any help


Mon, 24 Nov 1997 03:00:00 GMT  
 perl and telnet
: does anybody have a perl script that allows you to telnet to another site
: and  logon with name and password. i'm trying to create a telnet seesion
: that will logon with the username and the password that i create, but not
: let other users know the name or password. all they'll be able to do is
: run the telnet session and the script logs them on without them knowing
: anything until it gets by the login session. thanks for any help

If this is all you want it to do, I'd suggest expect is a better tool to
do it.

It's based on tcl (and optionally Tk), and it's essentially designed to
allow you to easily control interactive programs with a script. Control
can be returned to the user at any time.

From the expect README:

Expect may be ftp'd as pub/expect/expect.tar.Z from ftp.cme.nist.gov.

contents of the message should be (no subject line) "send
pub/expect/expect.tar.Z".  (Development versions of Expect may
occasionally be made available as alpha.tar.Z in the same directory.)

You'll need tcl and probably Tk too, but they're probably worth having
anyway.

--
Simon Greaves

DDI: +44 (0)131 451 3265                Fax: +44 (0)131 451 3261



Mon, 08 Dec 1997 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Perl FTP / Telnet client?

2. perl html telnet gateway?

3. PERL Script: telnet to WIN2K fails

4. perl cgi/telnet

5. Perl Net::Telnet()

6. PERL AND TELNET

7. Remotely excute Perl via Telnet

8. Perl based telnet client

9. Perl stub telnet server?

10. Where can I find a Perl SSH Telnet Client?

11. HELP!! How to delete files created by perl from telnet!!

12. Telnet module and perl script to telnet to remote, perform commands and log output

 

 
Powered by phpBB® Forum Software