Windows application: telnet


Description:
telnet is a command line program used to connect your PC to a server.

Usage:
telnet [-a][-e escape-sign][-f logfile][-l user][-t term] [host [port]]

Examples:
  • telnet 127.0.0.1 4555
  • telnet


Command Description
-a Attempt automatic logon. Same as -l option except uses the currently logged on user's name.
-e Escape character to enter telnet client prompt.
-f File name for client side logging.
-l Specifies the user name to log in with on the remote system. Requires that the remote system support the TELNET ENVIRON option.
-t Specifies terminal type. Supported term types are vt100, vt52, ansi and vtnt only.
host Specifies the hostname or IP address of the remote computer to connect to.
port Specifies a port number or service name.


Description:
After a connection with the server is established, the following commands can be entered:


Command Description
? Show help
close Close current connections
display Display operating parameters
open hostname [port] Connect to a site (defaultport 23)
quit Quit Telnet
set Set options
set ? Display a list of set options
status Print status information
unset Unset options
unset ? Display a list of unset options


Example: Checking a webserver
  1. Open a DOS window.

  2. Type: telnet [host] [ports]

    E.g.: telnet www.mobilefish.com 80 [Press Enter]

  3. To you see what you are doing, turn on localecho.

    • Type: Ctrl+] (hold down the Ctrl key and press the right bracket)

      You will see:

      Microsoft Telnet-client

      Escape-teken is 'CTRL+]'

      Microsoft Telnet>


    • Type: set localecho [Press Enter]

      You will see:

      Local echo is enabled
      Microsoft Telnet>


    • [Press Enter]

  4. A connection to the web server is established.
    HTTP commands can now be entered to let the web server send information back.


    To show both header and content:

    • Type: GET /index.html HTTP/1.1 [Press Enter]

    • Type: Host: www.mobilefish.com [Press Enter]

    • [Press Enter]

    • The HTTP header and content will be displayed:

      HTTP/1.1 200 OK
      Date: Mon, 06 Feb 2006 18:10:35 GMT
      Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
      mod_perl/1.999.24-dev Perl/v5.8.4
      Accept-Ranges: bytes
      Vary: Accept-Encoding,User-Agent
      Transfer-Encoding: chunked
      Content-Type: text/html; charset=ISO-8859-1

      fb
      <?xml version="1.0" encoding="iso-8859-1"?>
      :


      Note:
      If you use HTTP/1.1 the content is broken up into smaller chunks.
      If you use HTTP/1.0 the content is not broken up..



    To show only the header:

    • Type: HEAD /index.html HTTP/1.1 [Press Enter]

    • Type: Host: www.mobilefish.com [Press Enter]

    • [Press Enter]

    • Only the HTTP header will be displayed:

      HTTP/1.1 200 OK
      Date: Mon, 06 Feb 2006 18:10:35 GMT
      Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
      mod_perl/1.999.24-dev Perl/v5.8.4
      Accept-Ranges: bytes
      Vary: Accept-Encoding,User-Agent
      Content-Type: text/html; charset=ISO-8859-1



    To show the header and the request itself

    • Type: TRACE /index.html HTTP/1.1 [Press Enter]

    • Type: Host: www.mobilefish.com [Press Enter]

    • [Press Enter]

    • The HTTP header and the request will be displayed:

      HTTP/1.1 200 OK
      Date: Mon, 06 Feb 2006 18:10:35 GMT
      Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
      mod_perl/1.999.24-dev Perl/v5.8.4
      Transfer-Encoding: chunked
      Content-Type: message/http

      TRACE /index.html HTTP/1.1
      Host: www.mobilefish.com



    To check if HTTP compression is applied on the webserver:

    • Type: GET /index.html HTTP/1.1 [Press Enter]

    • Type: Host: www.mobilefish.com [Press Enter]

    • Type: Accept-encoding: gzip,deflate [Press Enter]

    • [Press Enter]

    • Only the HTTP header will be displayed:

      HTTP/1.1 200 OK
      Date: Mon, 06 Feb 2006 18:48:28 GMT
      Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
      mod_perl/1.999.24-dev Perl/v5.8.4
      Accept-Ranges: bytes
      Vary: Accept-Encoding,User-Agent
      Content-Encoding: gzip
      Content-Length: 6215
      Content-Type: text/html; charset=ISO-8859-1

      Y=ksAfiOT0E$s-Q/-+??O-=NU{+a?,