Friday, October 23, 2009

Checking Network Services Using Telnet

Suppose we want to check whether the web server(port 80) or any other network service is running or not, but we do not have any browsers (lynx, Firefox, IE, Netscape, ...), then there is a simple way of doing that. Just telnet to that machine on the http port (port no. 80 in general).

$ telnet <ip_addr> <port_no>

And then, give command "get /" (without quotes). If the webserver is running, it displays the HTML script of the homepage or basic info and closes the connection to the remote host.

$ telnet 80
Connected to
Escape character is '^]'.

get /
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
Connection closed by foreign host.

No comments: