Reply
Authenticating a visiting website
Old 01-27-2007, 01:43 PM Authenticating a visiting website
Average Talker

Posts: 18
I'm stumped! I'm hoping that someone can help on this one.

I am trying to find a way to know what website has called an image from our server. For instance if website A placed an image from my server on a page, what is the url of that page?

I know that you can use ASP ServerVariables("HTTP_REFERER") as one method but I also know that this is unreliable as header information can be spoofed and if the image is called from a secure page (HTTPS) then there is no HTTP_REFERER information sent in the headers.

I know that there must be a way to do this because when I look at my website stats using AWStats I see visitors that come from secure sites such as https://www.paypal.com

If AWStats can track the referring websites that are visiting from HTTPS then there must be a way to do it.

Can someone help???
__________________
Teleport yourself...
www.teleportjobs.com
TeleportJobs webmaster tools
danskapia is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 01-27-2007, 05:24 PM Re: Authenticating a visiting website
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,025
Name: Forrest Croce
Location: Seattle, WA
Well first of all, your ASP code only runs when somebody requests an ASP page. Your code has no idea when an image is requested by a page outside of your site. So the answer isn't code. ( Unless you want to write an HTTP handler or ISAPI filter. )

If you have awstats you've probably got a recent version of c-panel, with hotlink protection ... when somebody else puts an img tag on their site.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 01-27-2007, 05:45 PM Re: Authenticating a visiting website
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
First off, the referer is slightly misleading in AWStats.

For example, you'll probably see an http://ootp.haymakerhockey.net referral in your stats now. If not, refresh your stats, since I just did it.

All I did was cut and pasted the first link from your signature into the address bar and boom, referral.

That site isn't leeching a thing off of you either. It's just a fantasy baseball league site I'm a part of. Nothing more, nothing less.

Second, if you're still having an issue with hotlinking, you might want to try this (I haven't, so I can't recommend it one way or the other...I just know it exists):

http://evolvedcode.net/content/code_antihotlink/
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 01-27-2007, 07:29 PM Re: Authenticating a visiting website
Average Talker

Posts: 18
Thanks Forest and Adam,

You are both assuming that I want to prevent hotlinking. This is not the case. I simply want to know where someone has visited my website from. I can't use the HTTP_REFERER method because I need to know the referring website even if it came from a secure page.

I know this can be done somehow. I'm just not seeing the solution.

One thought that I had was to first read the HTTP_REFERER and if this is null then read the HTTPS_SERVER_SUBJECT. This variable contains the website to which a certificate was issued. The only thing I don't know is if this variable contains the server cert info for my site or the visiting site. My suspicion is that it is for my server which doesn't help.

Having said all of this; I'm still looking for a way to do this and any help is greatly appreciated.
__________________
Teleport yourself...
www.teleportjobs.com
TeleportJobs webmaster tools
danskapia is offline
Reply With Quote
View Public Profile
 
Old 01-28-2007, 01:34 AM Re: Authenticating a visiting website
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,025
Name: Forrest Croce
Location: Seattle, WA
I don't understand; how are you collecting info from server variables when an image is being requested?
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 01-28-2007, 11:42 AM Re: Authenticating a visiting website
Average Talker

Posts: 18
Hi Forrest,

Let's say that I have a 1 pixel image named image.jpg and WebsiteA owner/webmaster allows me to place this tracking image on one of his pages (Page 1.) When someone visits page 1 image.jpg is called from our server. If page 1 is a non secure page (HTTP) then I have no problem using HTTP_REFERER to know that Website A called the image. However, if the image is placed on a secure page (HTTPS) then this method does not work.

I'm still stumped. Maybe I'm just not asking the right question. Again any help would be appreciated.
__________________
Teleport yourself...
www.teleportjobs.com
TeleportJobs webmaster tools
danskapia is offline
Reply With Quote
View Public Profile
 
Old 01-28-2007, 02:51 PM Re: Authenticating a visiting website
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,025
Name: Forrest Croce
Location: Seattle, WA
I'm still not sure I understand, but have you tried enumerating all the server variables for this type of request?

for(int i = 0; i < Request.ServerVariables.Count; i++)
Response.Write(Request.ServerVariables[i]);

If you set that up and then visit one of these pages with your image, and look at the results, if the answer is in there, this should tell you.

How many sites are you doing this with? Another option would be to use a different file for each site.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 01-28-2007, 03:28 PM Re: Authenticating a visiting website
Average Talker

Posts: 18
Hi Forrest,

I've already tried looking at all of the server variables. I'm not so sure that the answer is in here.

I'm still searching for the answer.
__________________
Teleport yourself...
www.teleportjobs.com
TeleportJobs webmaster tools

Last edited by danskapia : 02-02-2007 at 10:11 AM. Reason: spelling
danskapia is offline
Reply With Quote
View Public Profile
 
Old 02-02-2007, 07:24 PM Re: Authenticating a visiting website
Average Talker

Posts: 18
I think that I have solved this problem. From what I can tell the HTTP_REFERER will NOT be sent through the HTTP headers in IE or FireFox if a client has clicked on a link on a secure page.

However; if an image is displayed on a secure page then the referring URL IS passed in the headers. I just tested this in IE and FireFox. I can't speak for other browsers.

Stupid me. I was testing this with clickable links rather than trying with an image. This explains why PayPal shows up in my AWstats logs. They are pulling an image from my server.

Sorry for the trouble
__________________
Teleport yourself...
www.teleportjobs.com
TeleportJobs webmaster tools
danskapia is offline
Reply With Quote
View Public Profile
 
Old 02-05-2007, 01:22 AM Re: Authenticating a visiting website
saadatshah's Avatar
Extreme Talker

Posts: 216
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Good you solved it.
__________________
Traffic School - Driver Ed - Defensive Driving - Texas Defensive Driving - Online Traffic School - Defensive Driving Course
If you have knowledge, let others light their candles in it.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Reply     « Reply to Authenticating a visiting website
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15901 seconds with 13 queries