IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 1 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Quick question
I'm telling my students about well known ports in TCP and UDP this week. I'd like to demo how to telnet to port 80 on a Web server and get it to spit out the server software and OS but I don't remember what I have to type in to get the header info. If I just use GET, it returns the HTML for a 400 error page and I can also request a specific document but how do I get the server header info?

This probably sounds really trivial and stupid but I've looked through Google and Slashdot already with no luck.

New Try this.
According to [link|http://www.google.com/search?q=cache:ikjN3K6Euy4:everythinglinux.org/webserver/webserver_content.html+web+server+software+http+telnet+port+80&hl=en|This] article from everythinglinux.org (via Google's cache) you want to:

To test whether or not your server is up, you can use a browser, or even simpler, telnet to port 80 (or other, as above) of your machine:

$ telnet localhost 80
Trying 127.0.0.1...
Escape character is '^]'.
GET / HTTP 1.0

HTTP/1.0 200 OK
Date: Sun, 16 Jul 2000 19:09:37 GMT
Server: Apache/1.1.3
Content-type: text/html

Note that YOU actually have to type the line "GET / HTTP 1.0" followed by two carriage returns.

What you'll get in return is the response header "HTTP/1.0 200 OK" which includes the response code "200" - meaning that your server responded as it should. You'll also notice the line "Server: Apache/1.1.3" or similar, depending on your version of Apache. This serves to identify the software you're using to serve your material.

All servers do this, and is how Netcraft performs their Web server software survey.


Haven't tried it myself. (And it was surprisingly difficult to find!)

HTH.

Cheers,
Scott.
New Thank you very much!
Not only for digging this up, but for verifying the difficulty of my search. I knew that I had seen it somewhere but it was a long time ago.

New *scratches head*
My first instinct would have been to get the HTTP RFC and just try things with the commands browsers are supposed to be able to send.

Which reminds me: if you do a GET / HTTP/1.1 then the server will expect a Host: line as well. Otherwise it will probably give an error. Host: is fortunately optional in HTTP/1.0

Wade.

"All around me are nothing but fakes
Come with me on the biggest fake of all!"

New Aw, you always want to RTFM.....<grin>
New Well, it worked, didn't it? :-)

"All around me are nothing but fakes
Come with me on the biggest fake of all!"

New Strangely enough...
My natural response would be, "I know that Perl's LWP module can send HTTP requests, what do they print?" It took me just a couple of minutes to track down the request method in LWP/Protocol/http.pm and it would have been very easy to have made a custom copy, change the 3 syswrites to also echo debugging output, then send a request somewhere...

Cheers,
Ben
New even stranger
I would have reached for [link|http://208.223.9.21/jfd/java/tcp/tcp.html|TCPReflector].
Have fun,
Carl Forde
     Quick question - (tjsinclair) - (7)
         Try this. - (Another Scott) - (6)
             Thank you very much! - (tjsinclair)
             *scratches head* - (static) - (4)
                 Aw, you always want to RTFM.....<grin> -NT - (tjsinclair) - (1)
                     Well, it worked, didn't it? :-) -NT - (static)
                 Strangely enough... - (ben_tilly) - (1)
                     even stranger - (cforde)

It's hard to be religious when certain people are never incinerated by bolts of lightning.
79 ms