Help with custom Telnet Application

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Craig White
Date:  
Subject: Help with custom Telnet Application
On Sat, 2004-02-07 at 09:41, Jeff Seese wrote:
> Group,
> I have been trying for several days to figure out the telnet protocol
> with for use in a custome application, but without any luck. Here is a
> brief description of what I am trying to do, and what I have tried.
>
> I am trying to write an application that will run on a sharp Zaurus,
> telnet to a local machine, execute some commands and then close the
> connection. I am developing this on a Redhat 9 box, in c++ and
> xcompiling for the Zaurus.
>
> I have found a few examples and source of telnet applications that I
> can compile and get working for the Redhat platform, but they won't
> compile with the arm-linux-g++ compiler.
>
> I have read lots of RFC's and tried to go back into the code of these
> working applications that I have found to figure out what the telnet
> protocol is, but I am afraid it's above my head.
>
> I am able to write an application that does the following.
> - open a socket to port 23 on the remote machine from the Zaurus.
> - The remote machine reports that a telnet session has started in the
> messages log file.
> - then I try to send my userID and password, but nothing appears in the
> log of the host machine, however I do get some odd looking characters
> returned to the Zaurus. (yyp#!ypy##.....) This is where I need help.
>
> If I could get a simple example of a telnet handshake so I could figure
> out what I am supposed to be sending it, and what I should expect that
> would be great.
>
> Unfortunately I can't use Perl and the net::telnet.
>
> Thanks in advance for any help,
> Also, I know this is not exactly the correct list to offer to pay for
> help..... But I am
> willing to pay for help.

---
I haven't done this with telnet but have with other programs such as
wget, ftp and such.

On your handheld, you can generally create a ~/.telnetrc with the user
and password and host and those will automatically be read from the file
and passed to your telnet application and provide authentication to the
system you are trying to connect to.

Recognize that most distro's don't enable telnet server if they even
install it and you can see what is being logged - at least on Red Hat
systems by looking at /var/log/secure and /var/log/messages. Also, the
telnetd server daemon will launch and use settings from xinetd so your
it would have to be configured to run, and settings in /etc/hosts.allow
and /etc/hosts.deny would apply.

On a redhat system, I would probably up2date (yum or apt-get) [install]
telnetd
then edit /etc/sysconfig/telnetd to state disable=no
then restart xinetd (service xinetd restart)
and I would be working - insecure but working.

obligatory comment - use ssh instead, it's encrypted.

Craig