<<

TELNET :

TELNET ( NETwork) is a network protocol used on the or (LAN) connections. It was developed in 1969 beginning with RFC 15 and standardized as IETF STD 8, one of the first Internet standards.

It is a network protocol used on the Internet or local area networks to provide a bidirectional interactive communications facility. Typically, telnet provides access to a command-line interface on a remote via a virtual terminal connection which consists of an 8-bit oriented data connection over the Transmission Control Protocol (TCP). User data is interspersed in-band with TELNET control information. The user's , which initiates the connection, is referred to as the local computer. The computer being connected to, which accepts the connection, is rderred to as the remote computer. The remote compmer can be physically located in the next room, the next town or in another country. The network terminal protocol (TELNET) allows a user to log in on any other computer on the network. We can start a remote session by specifying a computer to connect to. From that time until we finish the session, anything we type is sent to the other computer. The Telnet program runs on the computer and connects your PC to a on the network. We can then enter commands through the Telnet program and they will be executed as if we were entering them directly on the server console. This enables we to control the server and communicate with other servers on the network. To start a Telnet session, we must log in to a server by entering a valid username and password. Telnet is a common way to remotely control Web servers.

The term telnet also refers to software which implements the part of the protocol. TELNET clients have been available on most systems for many years and are available virtually for all platforms. Most network equipment and OSs with a TCP/IP stack support some kind of TELNET service server for their remote configuration including ones based on Windows NT. TELNET is a client server protocol, based on a reliable connection oriented transport. Typically this protocol used to establish a connection to TCP port 23, where a getty-equivalent program (telnetd) is listening, although TELNET predates.

Telnet was developed in 1969 to aid in remote connectivity between over a network. Telnet can connect to a remote machine that on a network and is port listening. Most common ports to which one can connect to through telnet are:

Port 21 ~ Protocol Port 22 - SSH Remote Login Protocol Port 23 - Telnet Server Port 25 - Simple Mail Transfer Protocol (SMTP) Port 53 - Domain Name Server (DNS) Port 69 - Trivial (TFTP) Port 70 - Port 80 - Hyper Text Transfer Protocol (HTTP) Port 110 - 3 (POP3)

Telnet can be used to connect to virtually any machine that listens on ports. In other words, you can connect to any machine that has certain ports open. Once connected to a machine, you need to issue UNIX based commands to interact with the remote service. For example, a user don't need to login, check and send mails only through his e-mail service provider's interface but this can be achieved using simple telnet commands.

It is because of this reason that many hackers can send spoofed or access information such as which services are running on the remote machine. This is also called banner grabbing or daemon tracking. Black hat hackers can also use telnet to sniff network packets which might contain sensitive information such as usernames and passwords. This is achieved by using telnet and network utilities such as TCP dump and wire shark.

Telnet client and server functionality comes built-in in most operating systems. However, there are several third-party applications like client that enable remote connectivity. A user can connect to a remote machine through several access modes such as raw access, SSH access, etc. SSH mode offers and security and hence can prevent eavesdropping by hackers. This is by far the most secure way of connecting to a machine.

However, it is necessary that the remote machine supports SSH login to make use of the encryption and security features. On windows machines, telnet client can simply be started by issuing the telnet command in windows command . The following example would help you connect to a remote machine on the HTTP Port 80 and issue a GET command which would fetch a file as your does it behind scenes:

Command Prompt> Telnet Command Prompt> open (somedomain.com or ip address) 80

At this stage, you would be connected to somedomain.com or ip address on port 80 and the daemon that is running on port 80 (most probably HTTP Server) would be waiting for HTTP requests.

GET/HTTP/1.1host: Issuing the command above would make the HTTP Server return the file requested, in this case it would be the default file at the root location, most applications and embedded devices make use of the telnet technology to connect to remote server machines and provide end user functionality. The most common use of telnet stands to enable remote authentication and access,

Establishing Telnet Connection

To use Telnet, you need to know the address of the host whose resources you want to use.

Your Telnet client contacts the host using its internet address. When you contact the host, the distant computer and your computer negotiate how they will communicate with each other. They decide which terminal emulation will be used. Telnet emulation determines how your keyboard will transmit information to the distant computer and how information will be displayed on your screen. For example, it determines how a back space key <- will work.

Type text in a Telnet session accumulates in a buffer on your computer. When a complete line of data is ready for transmission, or when you give a command to transmit data (such as pressing the Enter key), the data is sent across the Internet from your Network Virtual Terminal (NVT) keyboard. Along with the data is the host's IP address, which makes sure that the packet is sent to the proper location.

Your IP address is also sent so that information can be routed back to you. Additionally, specific Telnet commands that the other NVT will use, are sent to decide what to do with the data, or how to respond to the data. E.g. when data is sent from one NVT to another and certain information must be sent back to the originating NVT for a process to proceed, the Telnet Go Ahead (GA) command is sent.

After Telnet host receives data you have sent it, processes the data and returns to your screen and give the results of using the data or running the command on a distant computer.

Connecting to a Remote Host

Follow these steps to connect to a remote host using Telnet

1. Open Telnet by clicking on Start menu and choose run. Now type Telnet, and press Enter key from the keyboard or by clicking on the OK button. 2. From the Menu, choose Connect. Remote 3. Enter the name or IP address of the system that you want to connect to in the Host Name Field. 4. If required, a port in the Port field. 5. In the term Type, select the type of terminal that you want Telnet to emulate. 6. After you are finished with the remote host, you can disconnect from a remote host by choosing Connect, Disconnect.

Telnet Protocol Characteristics

There are the various characteristics of Telnet which are described below:

Telnet is a terminal emulation protocol. When you start installing and configuring native TCP/IP devices, you are going to need some way to connect to the device to issue its commands.

Telnet is versatile. You can establish Telnet sessions over the phone. If there is no phone connection and your device is accessible to the Internet, you can establish a Telnet session over the Internet. In any of these conditions you can establish a Telnet session with a remote host.

Terminal Emulation

A personal computer can connect via Modem to a large computer and run a terminal emulation program. The most common terminal emulation is the VT100. The computer works like a dumb terminal, except it is connected via a phone line instead of a direct connection. Often, you will not be able to use graphics on the Internet, such as the WWW (), this kind of access, although you will be able to browse the text-only portion of the Web.

This kind of Internet account is sometimes called "Shell" account. This shell account is available with VSNL for students in India. Many terminal emulation programs can emulate DEC terminals, including the VT52 and VT200 series terminals. For example, tty pathname of your terminal's device file.

The syntax for this command is tty [option] The options are: 1. -1 Prints the synchronous line number. 2. -s Causes tty not to print any output but sets the exit status to 0 if the standard input file is a terminal, and to 1 if it is not. TELNET is generally used with the following applications : (1) Enterprise networks to access host applications, e.g. on IBM Mainframes. (2) Administration of network elements, e.g., in commissioning, integration and maintenance of core network elements in mobile communication networks. (3) MUD games played over the Internet, as well as talkers, MUSHes, MUCKs, MOOes, and the resurgent BBS community. (4) embedded systems.

Hypertext Transfer Protocol (HTTP) The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. This protocol transfers data in the form of plain text, hypertext, audio, video, and so on. However, it is called the hypertext transfer protocol because its efficiency allows its use in a hypertext environment, where there are rapid jumps from one document to another.

HTTP functions like a combination of FTP and SMTP. It is similar to FTP because it transfers files and uses the services of TCP. However, it is much simpler than FTP because it uses only one TCP connection. There is no separate control connection; only data is transferred between the client and the server.

HTTP is like SMTP because the data transferred between the client and the server look like SMTP messages. In addition, MIME-like headers control the format of the messages. However, HTTP differs from SMTP in the way the messages are sent from the client to the server and from the server to the client. Unlike SMTP, the HTTP messages are not destined to be read by humans; they are read and interpreted by the HTTP server and HTTP client (browser). SMTP messages are stored and forwarded, but HTTP messages are delivered immediately.

The idea of HTTP is very simple. A client sends a request, which looks like mail, to the server. The server sends the response, which looks like a mail reply, to the client. The request and response messages carry data in the form of a letter with MIME-like format.

The commands from the client to the server are embedded in a letter-like request message. The contents of the requested file or other information are embedded in a letter-like response message.

HTTP Transaction The client initializes the transaction by sending a request message. The server replies by sending a response.

Messages There are two general types of HTTP messages: request and response. Both message types follow almost the same format.

Request Messages A request message consists of a request line, headers and sometimes a body.

Response Messages A response message consists of a status line, headers and sometimes, a body.

Uniform Resource Locator (URL) A client that wants to access a document needs an address. To facilitate the access of documents distributed throughout the world, HTTP uses the concept of locations. The Uniform Resource Locator (URL) is a standard for specifying any kind of information on the Internet. The URL defines four things- Method, Host Computer, Port, and Path.

The World Wide Web uses a locator called a Uniform Resource Locator to identify and intertribal data.

A URL has three parts: Method: //Host/Path

The method defines the protocol used to retrieve the document; it can vary from plain/text through FTP or gopher, all the way to HTTP.

The host is the computer that contains the data requested. It is most often a UNIX machine, and has many pages stored on it in special directories.

The third part of the URL is the path to the file requested. It may be a complex path separated by slashes" /" , or it can be very short. On most web servers, the files to be accessed are stored in specific directories.

Browsers There are several popular browsers. Navigator is one very popular graphical browser, is a much used text only browser, and Hot Java is a Java language based browser. There are other graphical browsers like and .

Browsers are usually built of three parts,

1. A controller 2. Client programs 3. Interpreters

The way a browser works, the controller takes input from a keyboard or mouse, and uses the correct client program (HTTP, PIP, Gopher, etc.) to request a document (page) from the server. When the server delivers the page, the controller then uses the interpreter that matches the type of document (HTML, CGI, Java, etc.) to display it for the user.

Most documents or pages presented on the WWW are written in HTML. HTML stands for Hyper Text Markup Language. HTML is a subset of SGML (Standard Generalized Markup Language), created by IBM to allow the same document to be displayed on different sized monitors. The basic idea behind HTML is that the browser can interpret a set of codes, and present the material as the writer / author intended, on the client machine. HTML tags are composed of a pair of angle brackets <>, with some special code and possibly some attributes within them.

That is an example of what is called a container, it has a beginning and ending tag, and changes the text stored inside it. The word container in the previous sentence is enclosed inside the italics container. Another type of tag is called an empty tag. It has no closing tag.

HTML tags can also have attributes, which can change how they work. For example, the


tag has an attribute called width that determines how wide the line is. If the following sequence of code are run,




The HTML pages can be divided into three general categories:

Static - A static document or page has a fixed content that will not change unless the author changes it on the server. This course is an excellent example of a set of static pages. The majority of the content of the Web is in static pages. The globe is just a static set of images all running together, it is not actually active. Watch it for 2 hours, and you will see that it just does the same thing, over and over again.

Dynamic- A dynamic page is created at the server, in response to some circumstance created at the client. One good example of a dynamic page is the results of a search.-The client asks for some set of data from the server, a program runs at the server and creates a page of results for the client, and ships it back. Another type of dynamic document is the electronic commerce type of page, where you order software or CDs, and your order is processed by software at the server site. When pages are created at the server, based on a request by the client, it is called a dynamic page or claim.

One of the common ways to build a dynamic document is to use CGI (Common Gateway Interface) programs. These are Web weaver created programs that respond to input generated by a form, running on the client machine. CGI is a powerful and rapidly growing part of electronic commerce, and the World Wide Web as well. The Perl language is one of the most common languages used to build CGI scripts.

Active - Active documents are those that actually run at the client site. These are often written in Java. Examples abound on the Net, if you have a Java-enabled browser, and are using a platform that supports Java. These programs actually run at the client site, and so are called active. Java applets can perform a wide range of functions from telling time to calculating the actual price and payments on a new car.

What is FTP? Written by Dinesh Thakur What is FTP? One of the most popular uses of the Internet is to download files - that is, transfer files from a computer on the Internet to your computer. Many thousands of files are downloaded every day from the Internet. Most of these files are downloaded using the Internet's File Transfer Protocol, commonly referred to as FTP. This protocol can also be used to files from your computer to another computer on the Internet. FTP (File Transfer Protocol) File Transfer Protocol is a standard network protocol used to exchange and manipulate files over a TCP/IP-based network, such as the Internet. FTP is built on client-server architecture and utilizes separate control and data connections between the client and server applications. FTP is used with user-based password authentication or with anonymous user access. Applications were originally interactive command-line tools with standardized command syntax, but graphical user interfaces have been developed for all desktop operating systems in use today. The Trivial File Transfer Protocol (TFTP) is a similar, but simplified, not interoperable, and unauthenticated version of FTP.

Numerous FTP servers all over the world allow users anywhere on the Internet to log in and down-load files placed on them. The main competitor for FTP is HTTP (Hyper Text Transfer Protocol) and the day is not very far when sites would run HTTP servers instead of the FTP servers. It is so because HTTP servers can do whatever FTP server can do and do it more efficiently.

As the Web gains popularity, downloading software is becoming even easier. You can use your Web browser and click on links to files; behind the scenes, FTP is often still downloading the files.

One problem with downloading files over the Internet is that some files are so large that it can take a tremendous amount of time to download them. As a way to speed up file transfers and save space on the FTP server, files are commonly compressed. Many different methods are used to compress files. After the files have been downloaded, you will need to run the decompression software such as PK UNZIP to decompress the files to use them.

Once you have the compressed file such as data. zip, you will need to unzip or decompress it to get to the setup file and install the program. You can use the WinZip file to uncompress this file.

Shareware: Shareware is the software that is distributed for free (sometimes in a limited or list format) on a trial basis. If you like the software and want to continue to use it beyond its trial period, it is your responsibility to register and pay for it.

Software distributed absolutely free is called freeware. Programmers who make freeware either derive personal satisfaction from the adoption and use of their handiwork or benefit financially from the reputation that accrues to the developer of a popular program.

The web site address for good shareware is given below http://www.tucows.com http://hyperarchive.lcs.mit.edu Features of FTP

The basic features of FTP are:

1. Data representation

• FTP handles three types of data representations-ASCII (7 bit), EBCDIC (8-bit) and 8- binary data.

• The ASCII file is the default format for transferring text files

• Each character is encoded using 7-bit ASCII. The sender transforms the file from its own representation into ASCII characters and the receiver transforms the ASCII character to its own representation.

• The image file is the default format for transferring binary files. The file is sent as continuous streams of bits without any interpretation or encoding.

2. File organization and Data structures

• FTP supports both unstructured and structured file.

• An unstructured file contains string of and is enl-marked by EOF (End of file). The data structure that corresponds to such a file is called file structure.

• A structured file contains a list of records and each record is delimited by EDR (End of Record). The data structure of such file is called record structure i.e. file is divided into records.

• Another structured file contains pages, with each page having a page number and a page header. The pages can be stored and accessed randomly or sequentially. The corresponding data structure is called page structure i.e. file is divided into pages.

3. Transmission modes

• FTP can transfer a file by using one of the following three modes:

Stream mode

• It is the default mode.

• File is transmitted as continuous stream of bytes to TCP.

• TCP is responsible for chopping data into segments of appropriate size.

• If data is simply a stream of bytes (file structure), no end-of-file is needed. EOF in this case is the closing of the data connection by the sender.

• If data is divided into records (record structure), each record has a I-byte EOR (End- of-Record) character and the end of the file has a I-byte EOF (End-of-file) character.

Block mode

• Data is delivered from FTP to TCP in blocks.

• Each block is preceded by 3 bytes header.

• The first byte is called the block descriptor.

• The second and third byte defines the size of the block in bytes.

Compressed mode

• Data is usually compressed if the file to be transmitted is very big.

• The compression method normally used in Run-length encoding.

• In a text file, usually spaces (blanks) are removed.

• In a , null characters are compressed.

4. Error control

• Since TCP is used for data transfer no additional error recovery mechanism is required.

5. Access control

• File access protection is done using login procedure with login name and password.

FTP operation

• FTP uses client/server model for communication.

• Two TCP connections are used for file transfer.

• On one connection control signals (commands and responses) are exchanged and the other connection is used for actual data transfer. These two connections are called control connection and data connection respectively.

Control Connection

The Control connection has following features:

1. It is used to transfer control signals (commands and responses) between the client and server.

2. This connection is used by the control process of client and server. The control process is called Protocol Interpreter (PI).

3. The TCP connection for control signal uses well-known FTP server port 21.

4. This control connection remains connected during the entire interactive FTP session.

5. The control connection uses very simple rules of communication. We need to transfer only a line of command or a line of response at a time.

6. The two control processes (client & server) or PI communicates using NVT syntax.

7. The PIs are responsible for translating the local code or syntax. (e.g. DOS or UNIX) into NVT syntax and vice-versa.

Data Connection

The Data connection has following features:

1. Data connection is used for actual data transfer.

2. This connection is established between the Data Transfer Process (DTP) of client and server

3. The server port used for data connection is Port 20.

4. The data connection is opened and then closed for each file transferred. It opens each time commands that involve transferring files are used, and it closes when the file is transferred.

5. File transfer occurs over the data connection under the control of the commands sent over the control connection.

6. During the file transfer, the client must define the type of file to be transferred, the structure of data and the transmission mode.

Thus file transfer in FTP means one of three things:

1. A file is to be copied from the server to the client. This is called retrieving a file. It is done with help of RETR command.

2. A file is to be copied from the client to the server. This is called storing a file. It is done with STOR command.

3. A list of directory or file names is to be sent from the server to the client. This is done with LLST command.

Anonymous FTP

• To Use FTP, a user needs an account (user name) and a password on the Remote server.

• Some sites have a set of files available for public access; to enable anonymous FTP.

• To access these files, a user does not need to have an account or password. Instead, the user can use Anonymous as the user name and guest as the password.

FTP Servers

Similar to the Web servers, the Internet also has the installations of FTP servers. Many organizations use FTP servers to handle the distribution of files. When a user links to download something, the link actually redirects to FTP, instead of HTTP. Some files in the FTP servers may be accessible to the general public, while others are accessible only by the user. To separate the general public from the more private users, FTP servers are divided into two parts:

Anonymous server

Non-anonymous server

1. Anonymous Server: Anonymous server is the most common use of FTP, the Internet file transfer protocol. FTP sites that allow anonymous FTP do not require a password for access. You only have to log in as anonymous and enter your e-mail address as password (for their records).

2. Non-anonymous Server: If you use a non-anonymous server, then you will log in as yourself and give your password.

FTP AUTHENTICATION: FTP authentication is very easy. To authenticate the users against an existing FTP server, edit ezproxy.usr and then write a line like this: : :ftp =ftpserv.mylib.org

After writing this line, replace "ftpserv.mylib.org" with the appropriate host name for the FTP server. Changing this line with host name takes effect immediately, without the need to restart EZproxy. When EZproxy receives authentication requests, it will connect the user to the FTP server, and if the FTP server shows login success, then the remote user will be authenticated and allowed to proceed.

FTP CLIENTS

FTP runs on a client /server model. For using FTP you will need client software to run on your PC. To begin an FTP session, you run the FTP client software and contact the FTP server from where you want to download files from. You can use FTP client software available in Windows 2000. The FTP client talks to an FTP server. FTP uses TCP to handle communications and creates a session between the two hosts.

The FTP daemon runs on the FTP server. This daemon handles all FTP transactions. When an FTP client contacts a server, the daemon will ask for an account number (or user name) and password. Many FTP sites allow anonymous FTP.

When you log on to the FTP server, a connection called a command link is opened between your computer and the server. This link is used for sending commands to the server from your computer, and sending messages and information back from the server to your computer.

When you want to change directories on the FTP server, your client software sends an instruction to the FTP daemon, using the command link. The daemon changes directories and then sends back a listing of files on that directory via the command link. On your client software, you will see a listing of files in the new server directory. When you want to download a file, the request is issued over the command Jink.

When you issue a command to download a file, a second connection is opened up, called the data connection or data link. This connection can be opened up in one of the following two modes:

ASCII Mode Binary Mode Line Mode

1. ASCII Mode: The ASCII mode is used for sending text files and alters things such as line feed and carriage returns.

2. Binary Mode: The binary mode is used for sending binary files and lets files through untouched.

3. Line Mode: Line mode FTP is used to send text files line by line or it is similar to ASCII mode but with additional features. The file is downloaded from the server to your computer via the data connection. After the file is [downloaded, the data link closes automatically. After this, the command link stays open. You can then change directories or download more files.] After you have finished the whole job, you log off command link closes. Then, you are no longer selected to the FTP server.

Connecting with FTP

Typical FTP session starts as client, when you the FTP program and connect to an FTP site, spending on the program you have, you will ? enter your login information before connect or you will be prompted to do it after you connect. If you are using a Web browser to connect to anonymous site, the browser will prompt you to connect to an FTP site; you need to know the IP of an account on the FTP server. In other Is, you need to login with a user name and password so that the server knows who you are. y accessible FTP sites you to use a account called anonymous. Unless you spec-, Internet Explorer assumes that you warn to con-to FTP sites as an anonymous user, and it supplies the server with the user name anonymous and a password consisting of your own e-mail address.

To connect to an FTP site do this:

1. Enter the URL of the FTP site in the Address box and click go. For example, to connect to FTP site rtfm.mit.edu/publ enters the URL as follows ftp://rtfm.mit.edu/pub/ 2. The browser opens the specified sites. 3. Display the directory that contains the file you want to download. 4. Right click the file and choose copy to folder. 5. Once you have saved the file in computer's drive, you can open it using the appropriate software, depending upon the type of file. If it is a Doc file, you can use Microsoft Word to open this file.

FTP Common commands

The basic command is: FTP hostname: This command written at the DOS prompt and it opens an interactive FTP session. When you want to run FTP in a script, the available switches are as follows: ftp [-v] [-ell [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [computer] summarizes the parameters that you can enter the command.

Most of the time, you use the FTP client in interactive mode. You should be aware of several commands when you are in this mode. Table lists some of the most common valid commands for the Microsoft FTP clients.

Many of the FTP commands are similar to DOS commands. For example, rmdir is the same as rd in DOS. mkdir, mdir are both used to make directory on the remote host. The other command is help which has the same function as in DOS. The type command types the ASCII characters of the file.