Sunday, November 23, 2014

Using TELNET To Access An Alternative Service

TCP/IP uses protocol port numbers to identify application services on a given machine. Software that implements a given service waits for requests at a predetermined (well-known) protocol port. For example, the remote login service accessed with the TELNET application protocol has been assigned port number 23. Thus, when a user invokes the telnet program, the program connects to port 23 on the specified machine.


Interestingly, the TELNET protocol can be used to access services other than the standard remote login service. To do so, a user must specify the protocol port number of the desired service. The Berkeley UNIX telnet command uses an optional second argument to allow the user to specify an alternative protocol port. If the user does not supply a second argument, telnet uses port 23. However, if the user supplies a port number, telnet connects to that port number. For example, if a user types:


telnet cnri.reston.va.us 185

the telnet program will form a connection to protocol port number 185 at machine cnri.reston.va. us. The machine is owned by the Corporation For National Research Initiatives (CNRI).
Port 185 on the machine at CNRI does not supply remote login service. Instead, it prints information about a recent change in the service offered, and then closes the connection.

telnet cnri.reston.va.us 185
Trying...
Connected to cnri.reston.va.us.
Escape character is '^]'.
******NOTICE******
The KIS client program has been moved from this machine
to info.cnri.reston.va.us (132.151.1.15) on port 185.
******************

Contacting port 185 on machine info. cnri. reston. va. us allows one to access the Knowbot Information Service. After a connection succeeds, the user receives information about the service followed by a prompt for Knowbot commands:
Trying...

Connected to info.cnri.reston.va.us.
Escape character is '^]'.
Knowbot Information Service
KIS Client (V2.0). Copyright CNRI 1990. All Rights Reserved.
KIS searches various Internet directory services to find
someone's street address, email address and phone number.
Type 'man' at the prompt for a complete reference with
examples. Type 'help' for a quick reference to commands.
Type 'news' for information about recent changes.
Backspace characters are '^H' or DEL
Please enter your email address in our guest book...
(Your email address?) >

The first three lines are the same as in the example above because they come from the telnet program and not the remote service. The remaining lines differ, and clearly show that the service available on port 185 is not a remote login service. The greater-than symbol on the last line serves as the prompt for Knowbot commands.

The Knowbot service searches well-known white pages directories to help a user find information about another user. For example, suppose one wanted to know the email address for David Clark, a researcher at MIT. Typing clark in response to the Knowbot prompt retrieves over 675 entries that each contain the name Clark. Most of the entries correspond to individuals with a first or last name of Clark, but some correspond to individuals with Clark in their affiliation (e.g., Clark College). Searching through the retrieved information reveals only one entry for a David Clark at MIT:
Clark, David D. (DDCI) ddc@LCS.MIT.EDU (617)253-6003

No comments:

Post a Comment