Solved

Telnet login

Posted on 1998-10-16
7
253 Views
Last Modified: 2010-08-05
Hi,
I'm wondering what UNIX servers send you when you log on.  I wrote an WinSock program that connects to a UNIX (AIX) server.  When I connect, it sends me three bytes:
FF FD 18
I didn't know what to do so I just echoed them back and it sent me three more bytes:
FF FC 18
So I echoed those back as well.
This was good in that it got me the login string but that string was preceded with about ten bytes of non-ASCII characters.
It was a wild guess that got me to the login prompt but I'd like to know what all of this non-ASCII data represents, I was expecting to just get a bunch of strings, carriage returns, and line-feeds...
This is my first socket program.
I have no experience in sockets or programming for networks, just a lot of reading.
Thanks
0
Comment
Question by:bod_1
7 Comments
 
LVL 1

Expert Comment

by:shirlng
ID: 2007489
Have you checked the Port and the Terminal Type from the Remote System?
0
 
LVL 2

Expert Comment

by:seedy
ID: 2007490
FF indicates the IAC(interpret as command character).  The next few bytes will be the command and any associated options.  Bascially the telnet process on the AIX server is trying to negotiate some options.  Also normally the AIX tries to clear the screen before presenting the login prompt.  This is done by sending a series of 0x0A characters before the prompt.

For more info. on the telnet protocol, please refer to RFC-854.
0
 

Author Comment

by:bod_1
ID: 2007491
Thanks guys,
I the port that I am using is telnet (it is resolved from it's name and corresponding port from some file, I forget it's name right now).  Terminal type ?  Is that what it's doing?  Seeing what kind of terminal I am (dumb, VT...) ?
I got a buch of 0A's (line feed) after that too.  I noticed that while using WS_FTP program, every command echoed to the debug window has a number infront of it.  I suppose these numbers are command codes?
I am looking at RFC now;

Thanks again
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:seedy
ID: 2007492
WS-FTP will display the commands of the protocol FTP.  
You would not want to confuse that with the telnet protocol you are interested in.
0
 

Author Comment

by:bod_1
ID: 2007493
I just installed Linux and got it configured.  man, what I'm looking for will be right on my machine now too.
I have much reading to do.
0
 
LVL 4

Accepted Solution

by:
davidmwilliams earned 50 total points
ID: 2007494
 I just typed a lengthy reply and Experts Exchange erased it because it was too long ! :(  So here's another go ...
  Whenever a client or server wants to send a command sequence instead of normal data, it inserts a special reserved character into the stream ... IAC ... which means 'Interpret as command'.
  Now, when telnet connects to a server, some negotiation goes on.  The two ends can request features of the other, or offer features.  For example, they will negotiate over which side performs echoing.  Also, some systems may offer to transmit characters as 8-bit uncoded bytes.
  The sequence is    IAC  verb  option    where verb is DO or DONT, encoded, and the reply is   IAC  verb  option  where verb here is WILL or WONT.
  What you describe seems to me like your server offered to do echoing, and you then sent the request right back :)  So the second message you received, with the differing byte, is because it then sent you a confirmation to your message, honouring the request you made of it :)
0
 

Author Comment

by:bod_1
ID: 2007495
Cool,
That makes sense.

Thanks for the help guys
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Host issue and need to move VM's 2 244
reinstall 1 70
Execute multiple curl cmds with sleep and send output to file 10 89
Control Number of Log Files -Perl 7 55
Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now