Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

In order to know which server a site is running I can use netcat.

Through the following command I can gather information about the type of server installed.

netcat -vv www.example.com 80

But if immediately after that I typed GET / HTTP/1.1 what actually would I do?

share|improve this question
    
A second return hit?... You could prefer HEAD / HTTP/1.0 instead, for inquiring about webserver. –  F. Hauri Dec 30 '12 at 12:31

3 Answers 3

up vote 3 down vote accepted

try this:

$ netcat example.com 80 <<END
HEAD / HTTP/1.1
Host: example.com


END

The $ is a command prompt; not actually typed.

It's about as simple an HTTP request as you can get without breaking 1.1 compatibility. You'll get a Server: header which will identify the destination server software.

Alternately (and perhaps more interestingly) just use a real http client, either something like wget or curl or perl's libwww commands. Just display response headers and there you go.

share|improve this answer
    
Alternatively, if you'd prefer a GUI, press Ctrl+Shift+K in Firefox to load up the web developer console, click the Net button to enable network logging, right click the open space and tick "Log Request and Response bodies". Each HTTP request will then be logged, and you can go to properties on each entry to see the full set of headers and content sent and received. –  Polynomial Dec 30 '12 at 0:20
1  
Similar functionality exists for Chrome. See the "Network" tab of the developer tools. And if you're using IE, then you're on the wrong site. –  tylerl Dec 30 '12 at 0:23

Once you are connected with netcat, you just have to type GET and hit Enter. The response will contain the web server type and maybe the version.

share|improve this answer
1  
That would not be a well-formed HTTP request. –  Polynomial Dec 30 '12 at 0:17
$ echo -en "GET / HTTP/1.0\n\n\n"|nc google.com 80|grep Server
Server: gws
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.