Skip to content

Identify web server

rollynoel edited this page Jun 13, 2013 · 2 revisions

Added by Rodrigo B. de Oliveira

Find out which webserver is behind a url

import System.Net

using response=WebRequest.Create("http://www.orkut.com").GetResponse():
   print(response.Headers["Server"])

If you are behind a non-transparent firewall/proxy you may need to set the proxy credentials so the example would change a bit:

import System.Net

request = WebRequest.Create("http://www.orkut.com")
proxy = WebProxy.GetDefaultProxy()
proxy.Credentials = NetworkCredential("username", "password")
request.Proxy = proxy

using response=request.GetResponse():
   print(response.Headers["Server"])
Clone this wiki locally