Thursday, October 30, 2008

How to Telnet to a Web Server - HTTP Requests through Telnet

A web server, responding to a HTTP GET request sends the required content to the client. Normally we don't see what is sent between the web client and the server. However we can easily see what is sent by the server by telneting to that web server.

To connect to the web server - open a command line and type the command
telnet host port
eg. telnet 80

Then you'll get connected to the particular web server and then you can enter any HTTP command you want such as GET, HEAD.

If you need to request for a web page from the web server you can type the HTTP request as follows.

GET pageName HTTP/1.0
eg. GET /products HTTP/1.0

Hit enter twice. Then you will get a response (if page exists)as follows.

HTTP/1.0 200 OK
Date: Thu, 30 Oct 2008 18:17:16 GMT
Server: Apache/2.2.9
X-Powered-By: PHP/5.2.6
Set-Cookie: PHPSESSID=5322082bf473207961031e3df1f45a22; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: close
Content-Type: text/html; charset=UTF-8

content goes here


You'll get a 404 status if page not found, 301 if the page is moved permanently and 401 if you are not authorized to access the page. More HTTP status codes can be found here.

You can follow a similar way to issue other HTTP commands with the relevant content.


ශාකුන්තල | Shaakunthala said...

telnet 80
GET / HTTP/1.0

doesn't work.... what to do?

Coz that's HTTP 1.1... virtual hosting.. ;-)

GET / HTTP/1.1

And,... bingo!

Anyway,... this telnet thing is a great thing that can sometimes find 'secrets'. :-)

Gediminas said...

You can look to for working example

kalani Ruwanpathirana said...

Oh..thanks Shakunthala..

IHG said...

can you tell me if website use post command then how can get server detail using telnet???

Unknown said...

Great Post about Server support. I can see that you will be a professional Man By this site.
We have also arranged a service.
Our Emergency Exchange SupportTeam provides emergency support and assistance.
Our Exchange Server experts can log on remotely to diagnose and fix just about any problem you may be experiencing,
24×7. Today’s advanced remote desktop tools, which are included with Microsoft Windows Server OS,
allow us to rapidly support Microsoft Exchange just as if we were at your place of business.

Unknown said...

Thanks for post your valuable opinion. I think it will be valuable for all kinds of Users.
Please contiune .
Emergency Exchange Support

I can see that its a Emergency support Relevant Blog. But I wil suggested you If you have any problem any kinds of Server Releted. You can Contact with us.
Emergency Exchange Support

Unknown said...
This comment has been removed by the author.
Unknown said...

Internet service is too much involved in our best essay writing service that is quite different and against of our expectations. Now we can enjoy 4G internet service that help us in internet surfing in very nice speed.

Robert said...

What should you look for in a good W3 partner? What should you expect from the web hosting company you choose? A lot and plenty of it.
Weebly Email Hosting

Unknown said...

I haven't tried Telnet yet. And I will have time to try this soon because I find this very interesting. Please also visit superior essay for writing services as this will be of great help for your paper works.

Kale Co Jakim said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.

siva said...

This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.
Thank you for this blog. This for very interesting and useful.
Java training in Chennai
Java training in Bangalore
Java online training
Java training in Pune
Java training in Bangalore|best Java training in Bangalore

Salman said...

Effective blog with a lot of information. I just Shared you the link below for Courses .They really provide good level of training and Placement,I just Had Java Classes in this institute,Just Check This Link You can get it more information about the Java course.

Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

nizam said...

This is an awesome post.Really very informative and creative contents about Java. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

Ritu Sharma said...

Thanks for the well-written post and I will follow your updates regularly.
JAVA Training in Chennai
JAVA Course in Chennai
Java training institute in chennai
Best JAVA Training institute in Chennai
JAVA Course
Java Training
Java classes in chennai
advanced java training in chennai
Best JAVA Training in Chennai
java training center in chennai
J2EE Training in Chennai

Related Posts with Thumbnails