Discussion:
cs-host, host header and destination
(too old to reply)
Paul
2004-03-04 17:11:15 UTC
Permalink
Hi,
I have always thought that the destination for a request was determined by
the contents of the host header and thus the cs-host field in the logs. I
expected to see either my websites IP address or a domain name that resolved
to my IP address. I have been seeing both domain names that do not resolve
to my IP address as well as NULL values in this field a small percentage of
the time. If this means that this field does not determine the destination,
how is a request routed to my website? What is this called so I can do a
search and find out more about how requests get routed to my website?
I do not own the web server, I use a web presents provider. They either do
not understand the question, don't know the answer or are deliberately not
telling me for some reason.
If I am using the wrong terminology or if there is a better terminology I
should be using, I would be grateful if you would provide that as well.
Thanks,
Paul Coleman
Paul
2004-03-05 16:12:55 UTC
Permalink
Hi,
I was about to give up posting this question at this group as no one
responded, so I though there was no one knowledgeable about this here. I
see that Kristofer Gafvert responded to a recent post about Host Headers so
I still have hope I can strike up a dialog.
My main concern with posting this question is that I am seeing IIS log
records for my web site that has a domain name in the cs-host field that
does not resolve to my IP address. I also see some records that have a NULL
value in this field. I am trying to understand how this could happen. Any
description or even URLs that point to a description that would help me
understand this would be appreciated.
Paul Coleman
Post by Paul
Hi,
I have always thought that the destination for a request was determined by
the contents of the host header and thus the cs-host field in the logs. I
expected to see either my websites IP address or a domain name that resolved
to my IP address. I have been seeing both domain names that do not resolve
to my IP address as well as NULL values in this field a small percentage of
the time. If this means that this field does not determine the destination,
how is a request routed to my website? What is this called so I can do a
search and find out more about how requests get routed to my website?
I do not own the web server, I use a web presents provider. They either do
not understand the question, don't know the answer or are deliberately not
telling me for some reason.
If I am using the wrong terminology or if there is a better terminology I
should be using, I would be grateful if you would provide that as well.
Thanks,
Paul Coleman
Kristofer Gafvert
2004-03-05 19:30:24 UTC
Permalink
Okay, let me explain this a bit, and this might be why you see this.

The CS-Host field is sent by the client. It is possible for the client to
fake this (for privacy for example, not that this is dangerous to give
out...). If the server is configured with host headers only, i dont think
that this is possible (but not completely sure).

So, let's try this with telnet. server.com is any way to make a connection
to the server (domain name, or IP)

telnet server.com 80 <enter>
GET /default.html HTTP/1.1 <enter>
Host: fakeHost.com <enter>
<enter><enter>

Now, if you look in the log file (wait until this is logged), you will see
someone "accessing the site" using fakeHost.com. This is not really true,
the client just sended the Host fakeHost.com

Everything in the logfile starting with CS is something sent from the
client, to the server. This information can be faked, and the referer is the
most common faked header. If you see these strange Host together with a
strange referer, then it is almost for sure that an add-in for the client
did this.

If the client did not send a Host, nothing is logged (except for the dash
(-)) in the logfile.

Does this explain what you are seeing? It sounds that this doesn't happen
too often, so i do not think that something is wrong with IIS.

So, to sum up:

CS-Host does not necessary have to have something to do with the actual
host. It is just the Host field sent by the client, to the server (and there
were already a connection to the server when this information was sent).
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi,
I have always thought that the destination for a request was determined by
the contents of the host header and thus the cs-host field in the logs. I
expected to see either my websites IP address or a domain name that resolved
to my IP address. I have been seeing both domain names that do not resolve
to my IP address as well as NULL values in this field a small percentage of
the time. If this means that this field does not determine the destination,
how is a request routed to my website? What is this called so I can do a
search and find out more about how requests get routed to my website?
I do not own the web server, I use a web presents provider. They either do
not understand the question, don't know the answer or are deliberately not
telling me for some reason.
If I am using the wrong terminology or if there is a better terminology I
should be using, I would be grateful if you would provide that as well.
Thanks,
Paul Coleman
Paul
2004-03-06 20:32:16 UTC
Permalink
Hi Kristofer,
This reflects what I am seeing in the logs, thanks for showing me how it
could be done. I can understand why someone would want to cloak their
sending information, I just can't imagine why anyone would want to cloak the
destination. The resources they where after where questionable, so it
raised my concerns as to what was happening. Just so I can try to
understand how it actually does get routed, could you provide me with some
keywords, like what the area and/or field is called so I can do a search and
find out how it does work. You can explain it here if you would like, I
seem to be able to understand the way you explain things.
Thanks,
Paul Coleman
Post by Kristofer Gafvert
Okay, let me explain this a bit, and this might be why you see this.
The CS-Host field is sent by the client. It is possible for the client to
fake this (for privacy for example, not that this is dangerous to give
out...). If the server is configured with host headers only, i dont think
that this is possible (but not completely sure).
So, let's try this with telnet. server.com is any way to make a connection
to the server (domain name, or IP)
telnet server.com 80 <enter>
GET /default.html HTTP/1.1 <enter>
Host: fakeHost.com <enter>
<enter><enter>
Now, if you look in the log file (wait until this is logged), you will see
someone "accessing the site" using fakeHost.com. This is not really true,
the client just sended the Host fakeHost.com
Everything in the logfile starting with CS is something sent from the
client, to the server. This information can be faked, and the referer is the
most common faked header. If you see these strange Host together with a
strange referer, then it is almost for sure that an add-in for the client
did this.
If the client did not send a Host, nothing is logged (except for the dash
(-)) in the logfile.
Does this explain what you are seeing? It sounds that this doesn't happen
too often, so i do not think that something is wrong with IIS.
CS-Host does not necessary have to have something to do with the actual
host. It is just the Host field sent by the client, to the server (and there
were already a connection to the server when this information was sent).
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi,
I have always thought that the destination for a request was determined by
the contents of the host header and thus the cs-host field in the logs.
I
Post by Kristofer Gafvert
Post by Paul
expected to see either my websites IP address or a domain name that
resolved
Post by Paul
to my IP address. I have been seeing both domain names that do not
resolve
Post by Paul
to my IP address as well as NULL values in this field a small percentage
of
Post by Paul
the time. If this means that this field does not determine the
destination,
Post by Paul
how is a request routed to my website? What is this called so I can do a
search and find out more about how requests get routed to my website?
I do not own the web server, I use a web presents provider. They either
do
Post by Paul
not understand the question, don't know the answer or are deliberately not
telling me for some reason.
If I am using the wrong terminology or if there is a better terminology I
should be using, I would be grateful if you would provide that as well.
Thanks,
Paul Coleman
Kristofer Gafvert
2004-03-06 21:55:46 UTC
Permalink
Hello,

See if this can help you understand:

http://www.ilopia.com/temp/clientToServer.html

What i think that you are looking for is information about how the
communication between a webbrowser and client is done, and then how that
request is handled by the server, and the response back. So keywords would
be:

communication webserver client webbrowers

I have however not found much information about this in any IIS books (but i
haven't looked that hard for it either). I think that this is covered more
by programming books, since it is of more value to programmers to know how
this is done.
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
This reflects what I am seeing in the logs, thanks for showing me how it
could be done. I can understand why someone would want to cloak their
sending information, I just can't imagine why anyone would want to cloak the
destination. The resources they where after where questionable, so it
raised my concerns as to what was happening. Just so I can try to
understand how it actually does get routed, could you provide me with some
keywords, like what the area and/or field is called so I can do a search and
find out how it does work. You can explain it here if you would like, I
seem to be able to understand the way you explain things.
Thanks,
Paul Coleman
Post by Kristofer Gafvert
Okay, let me explain this a bit, and this might be why you see this.
The CS-Host field is sent by the client. It is possible for the client to
fake this (for privacy for example, not that this is dangerous to give
out...). If the server is configured with host headers only, i dont think
that this is possible (but not completely sure).
So, let's try this with telnet. server.com is any way to make a connection
to the server (domain name, or IP)
telnet server.com 80 <enter>
GET /default.html HTTP/1.1 <enter>
Host: fakeHost.com <enter>
<enter><enter>
Now, if you look in the log file (wait until this is logged), you will see
someone "accessing the site" using fakeHost.com. This is not really true,
the client just sended the Host fakeHost.com
Everything in the logfile starting with CS is something sent from the
client, to the server. This information can be faked, and the referer is
the
Post by Kristofer Gafvert
most common faked header. If you see these strange Host together with a
strange referer, then it is almost for sure that an add-in for the client
did this.
If the client did not send a Host, nothing is logged (except for the dash
(-)) in the logfile.
Does this explain what you are seeing? It sounds that this doesn't happen
too often, so i do not think that something is wrong with IIS.
CS-Host does not necessary have to have something to do with the actual
host. It is just the Host field sent by the client, to the server (and
there
Post by Kristofer Gafvert
were already a connection to the server when this information was sent).
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
Post by Kristofer Gafvert
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi,
I have always thought that the destination for a request was
determined
Post by Paul
by
Post by Kristofer Gafvert
Post by Paul
the contents of the host header and thus the cs-host field in the logs.
I
Post by Kristofer Gafvert
Post by Paul
expected to see either my websites IP address or a domain name that
resolved
Post by Paul
to my IP address. I have been seeing both domain names that do not
resolve
Post by Paul
to my IP address as well as NULL values in this field a small percentage
of
Post by Paul
the time. If this means that this field does not determine the
destination,
Post by Paul
how is a request routed to my website? What is this called so I can
do
Post by Paul
a
Post by Kristofer Gafvert
Post by Paul
search and find out more about how requests get routed to my website?
I do not own the web server, I use a web presents provider. They either
do
Post by Paul
not understand the question, don't know the answer or are deliberately
not
Post by Kristofer Gafvert
Post by Paul
telling me for some reason.
If I am using the wrong terminology or if there is a better
terminology
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
should be using, I would be grateful if you would provide that as well.
Thanks,
Paul Coleman
Paul
2004-03-07 01:27:53 UTC
Permalink
Hi Kristofer,
That is a great explanation and it raises a new question. First, I was more
looking for how, in the example you gave "telnet server.com 80 <enter>",
that "server.com" was passed as the destination and what the area of the
packet (if that is the correct term) was called and more specificly what the
name of the field is called. Also if this information or field is avalable
to be included in the IIS logs.
We connected to the server www.ilopia.com on port 80, which was looked up
to be 217.208.8.97. >We then sent a request for the page index.html and the
Host Header information was >www.microsoft.com. The webserver does not care
if the domain name www.microsoft.com is looked >up to be the same IP as the
webserver. What the webserver only care about is that there was a >request
for this Host, so it is either on the WebServer, or not. It does not try to
look it up in any way, >using external resources. And since I have a Host
Header for www.microsoft.com on this server, the >client got back a page!

It says "since I have a Host Header for www.microsoft.com on this server"
and I was wondering where and how that was set in IIS.

Thanks,
Paul Coleman
Hello,
http://www.ilopia.com/temp/clientToServer.html
What i think that you are looking for is information about how the
communication between a webbrowser and client is done, and then how that
request is handled by the server, and the response back. So keywords would
communication webserver client webbrowers
I have however not found much information about this in any IIS books (but i
haven't looked that hard for it either). I think that this is covered more
by programming books, since it is of more value to programmers to know how
this is done.
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
This reflects what I am seeing in the logs, thanks for showing me how it
could be done. I can understand why someone would want to cloak their
sending information, I just can't imagine why anyone would want to cloak
the
Post by Paul
destination. The resources they where after where questionable, so it
raised my concerns as to what was happening. Just so I can try to
understand how it actually does get routed, could you provide me with some
keywords, like what the area and/or field is called so I can do a search
and
Post by Paul
find out how it does work. You can explain it here if you would like, I
seem to be able to understand the way you explain things.
Thanks,
Paul Coleman
Post by Kristofer Gafvert
Okay, let me explain this a bit, and this might be why you see this.
The CS-Host field is sent by the client. It is possible for the client
to
Post by Paul
Post by Kristofer Gafvert
fake this (for privacy for example, not that this is dangerous to give
out...). If the server is configured with host headers only, i dont
think
Post by Paul
Post by Kristofer Gafvert
that this is possible (but not completely sure).
So, let's try this with telnet. server.com is any way to make a
connection
Post by Paul
Post by Kristofer Gafvert
to the server (domain name, or IP)
telnet server.com 80 <enter>
GET /default.html HTTP/1.1 <enter>
Host: fakeHost.com <enter>
<enter><enter>
Now, if you look in the log file (wait until this is logged), you will
see
Post by Paul
Post by Kristofer Gafvert
someone "accessing the site" using fakeHost.com. This is not really
true,
Post by Paul
Post by Kristofer Gafvert
the client just sended the Host fakeHost.com
Everything in the logfile starting with CS is something sent from the
client, to the server. This information can be faked, and the referer is
the
Post by Kristofer Gafvert
most common faked header. If you see these strange Host together with a
strange referer, then it is almost for sure that an add-in for the
client
Post by Paul
Post by Kristofer Gafvert
did this.
If the client did not send a Host, nothing is logged (except for the
dash
Post by Paul
Post by Kristofer Gafvert
(-)) in the logfile.
Does this explain what you are seeing? It sounds that this doesn't
happen
Post by Paul
Post by Kristofer Gafvert
too often, so i do not think that something is wrong with IIS.
CS-Host does not necessary have to have something to do with the actual
host. It is just the Host field sent by the client, to the server (and
there
Post by Kristofer Gafvert
were already a connection to the server when this information was sent).
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
Post by Kristofer Gafvert
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi,
I have always thought that the destination for a request was
determined
Post by Paul
by
Post by Kristofer Gafvert
Post by Paul
the contents of the host header and thus the cs-host field in the
logs.
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
expected to see either my websites IP address or a domain name that
resolved
Post by Paul
to my IP address. I have been seeing both domain names that do not
resolve
Post by Paul
to my IP address as well as NULL values in this field a small
percentage
Post by Paul
Post by Kristofer Gafvert
of
Post by Paul
the time. If this means that this field does not determine the
destination,
Post by Paul
how is a request routed to my website? What is this called so I can
do
Post by Paul
a
Post by Kristofer Gafvert
Post by Paul
search and find out more about how requests get routed to my website?
I do not own the web server, I use a web presents provider. They
either
Post by Paul
Post by Kristofer Gafvert
do
Post by Paul
not understand the question, don't know the answer or are deliberately
not
Post by Kristofer Gafvert
Post by Paul
telling me for some reason.
If I am using the wrong terminology or if there is a better
terminology
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
should be using, I would be grateful if you would provide that as
well.
Post by Paul
Post by Kristofer Gafvert
Post by Paul
Thanks,
Paul Coleman
Kristofer Gafvert
2004-03-07 10:55:22 UTC
Permalink
As far as i know, what the user typed to get to your server is not logged.
That is simply not important for the webserver. The request got there, and
the webserver should respond in one or another way. Remember that the
commnnication is always done using an IP. If the user typed a domain name,
that name must first be resolved to an IP.

To setup Host Headers:

"HOW TO: Use Host Header Names to Host Multiple Sites from One IP Address in
IIS 5.0"
http://support.microsoft.com/default.aspx?scid=kb;en-us;190008

"HOW TO: Use Host Header Names to Configure Multiple Web Sites in Internet
Information Services 5.0"
http://support.microsoft.com/default.aspx?scid=kb;en-us;308163
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
That is a great explanation and it raises a new question. First, I was more
looking for how, in the example you gave "telnet server.com 80 <enter>",
that "server.com" was passed as the destination and what the area of the
packet (if that is the correct term) was called and more specificly what the
name of the field is called. Also if this information or field is avalable
to be included in the IIS logs.
We connected to the server www.ilopia.com on port 80, which was looked up
to be 217.208.8.97. >We then sent a request for the page index.html and the
Host Header information was >www.microsoft.com. The webserver does not care
if the domain name www.microsoft.com is looked >up to be the same IP as the
webserver. What the webserver only care about is that there was a >request
for this Host, so it is either on the WebServer, or not. It does not try to
look it up in any way, >using external resources. And since I have a Host
Header for www.microsoft.com on this server, the >client got back a page!
It says "since I have a Host Header for www.microsoft.com on this server"
and I was wondering where and how that was set in IIS.
Thanks,
Paul Coleman
Hello,
http://www.ilopia.com/temp/clientToServer.html
What i think that you are looking for is information about how the
communication between a webbrowser and client is done, and then how that
request is handled by the server, and the response back. So keywords would
communication webserver client webbrowers
I have however not found much information about this in any IIS books
(but
Post by Paul
i
haven't looked that hard for it either). I think that this is covered more
by programming books, since it is of more value to programmers to know how
this is done.
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
This reflects what I am seeing in the logs, thanks for showing me how it
could be done. I can understand why someone would want to cloak their
sending information, I just can't imagine why anyone would want to cloak
the
Post by Paul
destination. The resources they where after where questionable, so it
raised my concerns as to what was happening. Just so I can try to
understand how it actually does get routed, could you provide me with
some
Post by Paul
keywords, like what the area and/or field is called so I can do a search
and
Post by Paul
find out how it does work. You can explain it here if you would like, I
seem to be able to understand the way you explain things.
Thanks,
Paul Coleman
Post by Kristofer Gafvert
Okay, let me explain this a bit, and this might be why you see this.
The CS-Host field is sent by the client. It is possible for the client
to
Post by Paul
Post by Kristofer Gafvert
fake this (for privacy for example, not that this is dangerous to give
out...). If the server is configured with host headers only, i dont
think
Post by Paul
Post by Kristofer Gafvert
that this is possible (but not completely sure).
So, let's try this with telnet. server.com is any way to make a
connection
Post by Paul
Post by Kristofer Gafvert
to the server (domain name, or IP)
telnet server.com 80 <enter>
GET /default.html HTTP/1.1 <enter>
Host: fakeHost.com <enter>
<enter><enter>
Now, if you look in the log file (wait until this is logged), you will
see
Post by Paul
Post by Kristofer Gafvert
someone "accessing the site" using fakeHost.com. This is not really
true,
Post by Paul
Post by Kristofer Gafvert
the client just sended the Host fakeHost.com
Everything in the logfile starting with CS is something sent from the
client, to the server. This information can be faked, and the
referer
Post by Paul
is
Post by Paul
the
Post by Kristofer Gafvert
most common faked header. If you see these strange Host together
with
Post by Paul
a
Post by Paul
Post by Kristofer Gafvert
strange referer, then it is almost for sure that an add-in for the
client
Post by Paul
Post by Kristofer Gafvert
did this.
If the client did not send a Host, nothing is logged (except for the
dash
Post by Paul
Post by Kristofer Gafvert
(-)) in the logfile.
Does this explain what you are seeing? It sounds that this doesn't
happen
Post by Paul
Post by Kristofer Gafvert
too often, so i do not think that something is wrong with IIS.
CS-Host does not necessary have to have something to do with the
actual
Post by Paul
Post by Kristofer Gafvert
host. It is just the Host field sent by the client, to the server (and
there
Post by Kristofer Gafvert
were already a connection to the server when this information was
sent).
Post by Paul
Post by Kristofer Gafvert
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
Post by Kristofer Gafvert
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi,
I have always thought that the destination for a request was
determined
Post by Paul
by
Post by Kristofer Gafvert
Post by Paul
the contents of the host header and thus the cs-host field in the
logs.
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
expected to see either my websites IP address or a domain name that
resolved
Post by Paul
to my IP address. I have been seeing both domain names that do not
resolve
Post by Paul
to my IP address as well as NULL values in this field a small
percentage
Post by Paul
Post by Kristofer Gafvert
of
Post by Paul
the time. If this means that this field does not determine the
destination,
Post by Paul
how is a request routed to my website? What is this called so I
can
do
Post by Paul
a
Post by Kristofer Gafvert
Post by Paul
search and find out more about how requests get routed to my
website?
Post by Paul
Post by Kristofer Gafvert
Post by Paul
I do not own the web server, I use a web presents provider. They
either
Post by Paul
Post by Kristofer Gafvert
do
Post by Paul
not understand the question, don't know the answer or are
deliberately
Post by Paul
not
Post by Kristofer Gafvert
Post by Paul
telling me for some reason.
If I am using the wrong terminology or if there is a better
terminology
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
should be using, I would be grateful if you would provide that as
well.
Post by Paul
Post by Kristofer Gafvert
Post by Paul
Thanks,
Paul Coleman
Paul
2004-03-07 13:54:46 UTC
Permalink
Hi Kristofer,
Is the ability to configure host headers in IIS always on, or can it be
turned off? I am trying to understand how the NULL Host and the ones that
do not resolve to my IP could get through if host headers are defined. It
looks like, if they where defined, these invalid host header requests would
not get routed.

The next question would be, what would I ask my WPP (I am on a shared
server) to determine, if and/or how, they are used on their servers. They
seem to be sticklers on terminology. If I don't ask the question using the
correct terminology, I don't get a valid answer from them. Is there a way
to find out if this option is enabled other than from the server?

I have a DNS entry that has a generic type definition that resolves all
subdomains to my IP (*.server.com). I have code in global.asa that looks at
the subdomain and transfers the request to a subweb of the same name. I
assume that if host headers are defined, I would need one for each subdomain
I wanted to use. I also assume that if this where done, I would no longer
get these records in my logs.

The two articles you provided did not show all of the options available for
configuring host headers and the one link they provided for more information
went to a localhost URL assuming I had IIS installed somewhere with the
documentation. I searched at the MS site for "iis host header configure
option" and did not come up with anything. I am curious if there is a
similar option as the DNS option to have "*.server.com" and how this would
work on a shared server.

Thanks,
Paul Coleman
Post by Kristofer Gafvert
As far as i know, what the user typed to get to your server is not logged.
That is simply not important for the webserver. The request got there, and
the webserver should respond in one or another way. Remember that the
commnnication is always done using an IP. If the user typed a domain name,
that name must first be resolved to an IP.
"HOW TO: Use Host Header Names to Host Multiple Sites from One IP Address in
IIS 5.0"
http://support.microsoft.com/default.aspx?scid=kb;en-us;190008
"HOW TO: Use Host Header Names to Configure Multiple Web Sites in Internet
Information Services 5.0"
http://support.microsoft.com/default.aspx?scid=kb;en-us;308163
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
That is a great explanation and it raises a new question. First, I was
more
Post by Paul
looking for how, in the example you gave "telnet server.com 80 <enter>",
that "server.com" was passed as the destination and what the area of the
packet (if that is the correct term) was called and more specificly what
the
Post by Paul
name of the field is called. Also if this information or field is
avalable
Post by Paul
to be included in the IIS logs.
We connected to the server www.ilopia.com on port 80, which was looked up
to be 217.208.8.97. >We then sent a request for the page index.html and
the
Post by Paul
Host Header information was >www.microsoft.com. The webserver does not
care
Post by Paul
if the domain name www.microsoft.com is looked >up to be the same IP as
the
Post by Paul
webserver. What the webserver only care about is that there was a
request
Post by Paul
for this Host, so it is either on the WebServer, or not. It does not try
to
Post by Paul
look it up in any way, >using external resources. And since I have a Host
Header for www.microsoft.com on this server, the >client got back a page!
It says "since I have a Host Header for www.microsoft.com on this server"
and I was wondering where and how that was set in IIS.
Thanks,
Paul Coleman
Hello,
http://www.ilopia.com/temp/clientToServer.html
What i think that you are looking for is information about how the
communication between a webbrowser and client is done, and then how that
request is handled by the server, and the response back. So keywords
would
Post by Paul
communication webserver client webbrowers
I have however not found much information about this in any IIS books
(but
Post by Paul
i
haven't looked that hard for it either). I think that this is covered
more
Post by Paul
by programming books, since it is of more value to programmers to know
how
Post by Paul
this is done.
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
This reflects what I am seeing in the logs, thanks for showing me
how
Post by Kristofer Gafvert
it
Post by Paul
Post by Paul
could be done. I can understand why someone would want to cloak their
sending information, I just can't imagine why anyone would want to
cloak
Post by Paul
the
Post by Paul
destination. The resources they where after where questionable, so it
raised my concerns as to what was happening. Just so I can try to
understand how it actually does get routed, could you provide me with
some
Post by Paul
keywords, like what the area and/or field is called so I can do a
search
Post by Paul
and
Post by Paul
find out how it does work. You can explain it here if you would
like,
Post by Kristofer Gafvert
I
Post by Paul
Post by Paul
seem to be able to understand the way you explain things.
Thanks,
Paul Coleman
Post by Kristofer Gafvert
Okay, let me explain this a bit, and this might be why you see this.
The CS-Host field is sent by the client. It is possible for the
client
Post by Paul
to
Post by Paul
Post by Kristofer Gafvert
fake this (for privacy for example, not that this is dangerous to
give
Post by Paul
Post by Paul
Post by Kristofer Gafvert
out...). If the server is configured with host headers only, i dont
think
Post by Paul
Post by Kristofer Gafvert
that this is possible (but not completely sure).
So, let's try this with telnet. server.com is any way to make a
connection
Post by Paul
Post by Kristofer Gafvert
to the server (domain name, or IP)
telnet server.com 80 <enter>
GET /default.html HTTP/1.1 <enter>
Host: fakeHost.com <enter>
<enter><enter>
Now, if you look in the log file (wait until this is logged), you
will
Post by Paul
see
Post by Paul
Post by Kristofer Gafvert
someone "accessing the site" using fakeHost.com. This is not really
true,
Post by Paul
Post by Kristofer Gafvert
the client just sended the Host fakeHost.com
Everything in the logfile starting with CS is something sent from
the
Post by Paul
Post by Paul
Post by Kristofer Gafvert
client, to the server. This information can be faked, and the
referer
Post by Paul
is
Post by Paul
the
Post by Kristofer Gafvert
most common faked header. If you see these strange Host together
with
Post by Paul
a
Post by Paul
Post by Kristofer Gafvert
strange referer, then it is almost for sure that an add-in for the
client
Post by Paul
Post by Kristofer Gafvert
did this.
If the client did not send a Host, nothing is logged (except for the
dash
Post by Paul
Post by Kristofer Gafvert
(-)) in the logfile.
Does this explain what you are seeing? It sounds that this doesn't
happen
Post by Paul
Post by Kristofer Gafvert
too often, so i do not think that something is wrong with IIS.
CS-Host does not necessary have to have something to do with the
actual
Post by Paul
Post by Kristofer Gafvert
host. It is just the Host field sent by the client, to the server
(and
Post by Paul
Post by Paul
there
Post by Kristofer Gafvert
were already a connection to the server when this information was
sent).
Post by Paul
Post by Kristofer Gafvert
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
Post by Kristofer Gafvert
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi,
I have always thought that the destination for a request was
determined
Post by Paul
by
Post by Kristofer Gafvert
Post by Paul
the contents of the host header and thus the cs-host field in the
logs.
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
expected to see either my websites IP address or a domain name
that
Post by Paul
Post by Paul
Post by Kristofer Gafvert
resolved
Post by Paul
to my IP address. I have been seeing both domain names that do
not
Post by Paul
Post by Paul
Post by Kristofer Gafvert
resolve
Post by Paul
to my IP address as well as NULL values in this field a small
percentage
Post by Paul
Post by Kristofer Gafvert
of
Post by Paul
the time. If this means that this field does not determine the
destination,
Post by Paul
how is a request routed to my website? What is this called so I
can
do
Post by Paul
a
Post by Kristofer Gafvert
Post by Paul
search and find out more about how requests get routed to my
website?
Post by Paul
Post by Kristofer Gafvert
Post by Paul
I do not own the web server, I use a web presents provider.
They
Post by Kristofer Gafvert
Post by Paul
either
Post by Paul
Post by Kristofer Gafvert
do
Post by Paul
not understand the question, don't know the answer or are
deliberately
Post by Paul
not
Post by Kristofer Gafvert
Post by Paul
telling me for some reason.
If I am using the wrong terminology or if there is a better
terminology
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
should be using, I would be grateful if you would provide that as
well.
Post by Paul
Post by Kristofer Gafvert
Post by Paul
Thanks,
Paul Coleman
Kristofer Gafvert
2004-03-07 16:32:15 UTC
Permalink
Host headers can always be used on an IIS webserver.

If you are on a shared server, then most likely, they are using host
headers. They could use several IPs, and host one website on one IP, but
that would probably cost too much for the company.

As far as i know, it is not possible to use wild cards in a host header. So,
if the user sends the Host field "server1.yourdomain.com", and the hosting
company are using host headers and there is no Host Header for
server1.yourdomain.com, then this would generate a 400 Error. So, either
they are not using Host Headers, or solves this in another way (reverse
proxy for example could work).

My recommendation to you would be to ask your WPP about these strange things
in the IIS Log. It is possible that they are running filters or other
components that do not work 100% correctly all the time, and therefore send
some requests to the wrong server. I'm afraid i cannot give you any other
explanation.

But, if this is one time occurance, then there is nothing to be concerned
about. Webbrowsers has bugs, and they will sometimes send wrong information.
I have both www.intel.com and www.yahoo.com as CS-Host in my logfiles. And a
bunch of IPs i have never had on that server. It doesn't happen often, but
it do happens.

Also remember that maybe one day the domain(s) you have in your log file had
the IP of the server. And if this information was cached somewhere, and
someone tried to access that domain using the cached information, he/she
will end up on your server.
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
Is the ability to configure host headers in IIS always on, or can it be
turned off? I am trying to understand how the NULL Host and the ones that
do not resolve to my IP could get through if host headers are defined. It
looks like, if they where defined, these invalid host header requests would
not get routed.
The next question would be, what would I ask my WPP (I am on a shared
server) to determine, if and/or how, they are used on their servers. They
seem to be sticklers on terminology. If I don't ask the question using the
correct terminology, I don't get a valid answer from them. Is there a way
to find out if this option is enabled other than from the server?
I have a DNS entry that has a generic type definition that resolves all
subdomains to my IP (*.server.com). I have code in global.asa that looks at
the subdomain and transfers the request to a subweb of the same name. I
assume that if host headers are defined, I would need one for each subdomain
I wanted to use. I also assume that if this where done, I would no longer
get these records in my logs.
The two articles you provided did not show all of the options available for
configuring host headers and the one link they provided for more information
went to a localhost URL assuming I had IIS installed somewhere with the
documentation. I searched at the MS site for "iis host header configure
option" and did not come up with anything. I am curious if there is a
similar option as the DNS option to have "*.server.com" and how this would
work on a shared server.
Thanks,
Paul Coleman
Post by Kristofer Gafvert
As far as i know, what the user typed to get to your server is not logged.
That is simply not important for the webserver. The request got there, and
the webserver should respond in one or another way. Remember that the
commnnication is always done using an IP. If the user typed a domain name,
that name must first be resolved to an IP.
"HOW TO: Use Host Header Names to Host Multiple Sites from One IP
Address
Post by Paul
in
Post by Kristofer Gafvert
IIS 5.0"
http://support.microsoft.com/default.aspx?scid=kb;en-us;190008
"HOW TO: Use Host Header Names to Configure Multiple Web Sites in Internet
Information Services 5.0"
http://support.microsoft.com/default.aspx?scid=kb;en-us;308163
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
Post by Kristofer Gafvert
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
That is a great explanation and it raises a new question. First, I was
more
Post by Paul
looking for how, in the example you gave "telnet server.com 80 <enter>",
that "server.com" was passed as the destination and what the area of the
packet (if that is the correct term) was called and more specificly what
the
Post by Paul
name of the field is called. Also if this information or field is
avalable
Post by Paul
to be included in the IIS logs.
We connected to the server www.ilopia.com on port 80, which was
looked
Post by Paul
up
Post by Kristofer Gafvert
Post by Paul
to be 217.208.8.97. >We then sent a request for the page index.html and
the
Post by Paul
Host Header information was >www.microsoft.com. The webserver does not
care
Post by Paul
if the domain name www.microsoft.com is looked >up to be the same IP as
the
Post by Paul
webserver. What the webserver only care about is that there was a
request
Post by Paul
for this Host, so it is either on the WebServer, or not. It does not try
to
Post by Paul
look it up in any way, >using external resources. And since I have a
Host
Post by Kristofer Gafvert
Post by Paul
Header for www.microsoft.com on this server, the >client got back a
page!
Post by Kristofer Gafvert
Post by Paul
It says "since I have a Host Header for www.microsoft.com on this
server"
Post by Kristofer Gafvert
Post by Paul
and I was wondering where and how that was set in IIS.
Thanks,
Paul Coleman
Hello,
http://www.ilopia.com/temp/clientToServer.html
What i think that you are looking for is information about how the
communication between a webbrowser and client is done, and then how
that
Post by Kristofer Gafvert
Post by Paul
request is handled by the server, and the response back. So keywords
would
Post by Paul
communication webserver client webbrowers
I have however not found much information about this in any IIS books
(but
Post by Paul
i
haven't looked that hard for it either). I think that this is covered
more
Post by Paul
by programming books, since it is of more value to programmers to know
how
Post by Paul
this is done.
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but
please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi Kristofer,
This reflects what I am seeing in the logs, thanks for showing me
how
Post by Kristofer Gafvert
it
Post by Paul
Post by Paul
could be done. I can understand why someone would want to cloak
their
Post by Kristofer Gafvert
Post by Paul
Post by Paul
sending information, I just can't imagine why anyone would want to
cloak
Post by Paul
the
Post by Paul
destination. The resources they where after where questionable,
so
Post by Paul
it
Post by Kristofer Gafvert
Post by Paul
Post by Paul
raised my concerns as to what was happening. Just so I can try to
understand how it actually does get routed, could you provide me
with
Post by Kristofer Gafvert
Post by Paul
some
Post by Paul
keywords, like what the area and/or field is called so I can do a
search
Post by Paul
and
Post by Paul
find out how it does work. You can explain it here if you would
like,
Post by Kristofer Gafvert
I
Post by Paul
Post by Paul
seem to be able to understand the way you explain things.
Thanks,
Paul Coleman
Post by Kristofer Gafvert
Okay, let me explain this a bit, and this might be why you see
this.
Post by Kristofer Gafvert
Post by Paul
Post by Paul
Post by Kristofer Gafvert
The CS-Host field is sent by the client. It is possible for the
client
Post by Paul
to
Post by Paul
Post by Kristofer Gafvert
fake this (for privacy for example, not that this is dangerous to
give
Post by Paul
Post by Paul
Post by Kristofer Gafvert
out...). If the server is configured with host headers only, i
dont
Post by Kristofer Gafvert
Post by Paul
think
Post by Paul
Post by Kristofer Gafvert
that this is possible (but not completely sure).
So, let's try this with telnet. server.com is any way to make a
connection
Post by Paul
Post by Kristofer Gafvert
to the server (domain name, or IP)
telnet server.com 80 <enter>
GET /default.html HTTP/1.1 <enter>
Host: fakeHost.com <enter>
<enter><enter>
Now, if you look in the log file (wait until this is logged), you
will
Post by Paul
see
Post by Paul
Post by Kristofer Gafvert
someone "accessing the site" using fakeHost.com. This is not
really
Post by Kristofer Gafvert
Post by Paul
true,
Post by Paul
Post by Kristofer Gafvert
the client just sended the Host fakeHost.com
Everything in the logfile starting with CS is something sent from
the
Post by Paul
Post by Paul
Post by Kristofer Gafvert
client, to the server. This information can be faked, and the
referer
Post by Paul
is
Post by Paul
the
Post by Kristofer Gafvert
most common faked header. If you see these strange Host together
with
Post by Paul
a
Post by Paul
Post by Kristofer Gafvert
strange referer, then it is almost for sure that an add-in for the
client
Post by Paul
Post by Kristofer Gafvert
did this.
If the client did not send a Host, nothing is logged (except for
the
Post by Kristofer Gafvert
Post by Paul
dash
Post by Paul
Post by Kristofer Gafvert
(-)) in the logfile.
Does this explain what you are seeing? It sounds that this doesn't
happen
Post by Paul
Post by Kristofer Gafvert
too often, so i do not think that something is wrong with IIS.
CS-Host does not necessary have to have something to do with the
actual
Post by Paul
Post by Kristofer Gafvert
host. It is just the Host field sent by the client, to the server
(and
Post by Paul
Post by Paul
there
Post by Kristofer Gafvert
were already a connection to the server when this information was
sent).
Post by Paul
Post by Kristofer Gafvert
--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email,
but
Post by Kristofer Gafvert
Post by Paul
Post by Paul
please
Post by Kristofer Gafvert
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
Post by Paul
Hi,
I have always thought that the destination for a request was
determined
Post by Paul
by
Post by Kristofer Gafvert
Post by Paul
the contents of the host header and thus the cs-host field in
the
Post by Kristofer Gafvert
Post by Paul
logs.
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
expected to see either my websites IP address or a domain name
that
Post by Paul
Post by Paul
Post by Kristofer Gafvert
resolved
Post by Paul
to my IP address. I have been seeing both domain names that do
not
Post by Paul
Post by Paul
Post by Kristofer Gafvert
resolve
Post by Paul
to my IP address as well as NULL values in this field a small
percentage
Post by Paul
Post by Kristofer Gafvert
of
Post by Paul
the time. If this means that this field does not determine the
destination,
Post by Paul
how is a request routed to my website? What is this called
so
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
can
do
Post by Paul
a
Post by Kristofer Gafvert
Post by Paul
search and find out more about how requests get routed to my
website?
Post by Paul
Post by Kristofer Gafvert
Post by Paul
I do not own the web server, I use a web presents provider.
They
Post by Kristofer Gafvert
Post by Paul
either
Post by Paul
Post by Kristofer Gafvert
do
Post by Paul
not understand the question, don't know the answer or are
deliberately
Post by Paul
not
Post by Kristofer Gafvert
Post by Paul
telling me for some reason.
If I am using the wrong terminology or if there is a better
terminology
Post by Paul
I
Post by Kristofer Gafvert
Post by Paul
should be using, I would be grateful if you would provide that
as
Post by Kristofer Gafvert
Post by Paul
well.
Post by Paul
Post by Kristofer Gafvert
Post by Paul
Thanks,
Paul Coleman
Continue reading on narkive:
Loading...