views:

32

answers:

1

I'm looking at a website using Internet Explorer and Firefox. In each browser I select view source and see the website's URL in the links. These links were concatenated together using HttpContext.Current.Request.Url.Host in the code behind. However, when I use netcat or Burp Suite v1.3.03, looking at the same links I see the servername instead of the website's URL.

My question is - Why does view source in the browser display different links in the page source than what netcat or Burp Suite outputs? Is the browser rewriting stuff?

My thought to correct is to have a web.config setting which is used to create the links.

Next question - Does anyone know of a configuration change to make to IIS to return the URL instead of the server name or a .NET function that I should be calling instead to get the URL that the website is running as.

A: 

Make sure that you are sending a "Host" header in your request - this is required as of HTTP/1.1 for all requests (it's what makes multi-homed/virtual websites possible).

Marc Novakowski
Netcat and Burp Suite were both sending a HTTP/1.0 header without the host name while the browsers by default are sending a HTTP/1.1 header with the host name set.
lmingle