Groups | Blog | Home
all groups > asp.net security > january 2007 >

asp.net security : Preventing Image Bandwidth Theft



Med
1/21/2007 2:30:08 PM
Hi,

Is there a way to detect in asp.net if images are hot-linked from another
websites? I intend to create a default image and serve that image instead of
the image requested from another website?


Kind Regards

Med

Scott M.
1/21/2007 4:26:53 PM
It depends on what you mean by "hot-linked".


[quoted text, click to view]

Scott M.
1/21/2007 6:38:59 PM
Ok, haven't heard that one. I usually just hear folks talk about "external
links".


[quoted text, click to view]

Tim Van Wassenhove
1/21/2007 10:46:44 PM
Med schreef:
[quoted text, click to view]

I can think of following techniques (but they're not 100% reliable)

- Check if a HTTP_REFERER header exists, and if it's value is an URL in
your website.

- Check if a cookie is present (the cookie should be generated on all
the pages in your website).


--
Med
1/21/2007 11:25:12 PM
[quoted text, click to view]

"Hot-Link" usually refers to the a URL embeded in the html to read a
file/image from another source/website instead of local file/image on the
web server's Folder. (i.e. <img
src="http://www.otherpeopleswebsite.com/images/cat.jpg"> instead of <img
src="images/cat.jpg">)

Thank you all for the suggestions. I think the http_referrer is the easier
option, however writing a custom IHttpHandler seems interesting too.


Regards

Med

[quoted text, click to view]

Henning Krause [MVP - Exchange]
1/21/2007 11:44:23 PM
Hello,

the problem here is that the image mime types are handled directly by IIS in
the default configuration. So you'll have to map the image mime types to the
ASP.NET engine, write a custom IHttpHandler class for those file types and
register it in the web.config.

Best regards,
Henning Krause


[quoted text, click to view]
AddThis Social Bookmark Button