###################################################################
# Image Sentinel - Hot Link Protection Version 1.2
#
# Copyright (©)2000 Marek A Molozzi, All Rights Reserved.
#
# Duplicating or redistributing this program without prior
# written consent is expressly forbidden. You must Obtain
# permission before redistributing this software by any means.
# In all cases this copyright/license notice must remain intact.
#
# http://Marek'sScripts.w2w.cc/
#
# Last Modified 6/18/2000
###################################################################
Copyright
====================
Duplicating or redistributing this program without prior written consent is
expressly forbidden. You must Obtain permission before redistributing this
software by any means. In all cases the copyright/license notice must remain
intact.
Description
====================
Image Sentinel was designed to put and end to the hot linking of images.
Image sentinel not only prevents other sites from linking directly to your
images but also hides the location of your images, making it impossible for
anyone to access your hard won content without going through YOUR web site.
A visitor following someone else's link to one of your images can optionally
be sent back where they came from or redirected to a page of your choosing
(e.g. your sign up page or links page or Yahoo for that matter.)
Features
====================
- Prevents "Hot Linking".
- Hides the location of your images.
- Redirect unauthorized visitors to the page of your choice.
Requirements
====================
- Perl 5
- Unix Based Web Server
- cgi capability
- LWP::MediaTypes module must be avilable. If not then the image mime
types will not be reported correctly. Standard Perl installations should
includes this.
Installation Steps
====================
A. Edit the first line of the main script from #!/usr/bin/perl to the required
Perl path specified on your server. (If you don't know contact somebody
who does, such as a web host's technical support. Commonly it can be
/usr/bin/perl, /usr/sbin/perl, /usr/local/perl, etc...)
B. Modify the variables in the image.cgi (open it using notepad and scroll down
until you see the line "Define Variables").
1. $redir = "";
====================================================================
The URL to direct unauthorized visitors to (e.g. $redir = "http://yahoo.com/";
or $redir = "http://yourdomain.com/signup.html"; full path to the directory
where you wish to store the uploaded files. Do not include the trailing slash.
2. @referers = ('yourdomain.com', www.yourdomain.com', '209.456.66.132');
====================================================================
The referrers list is the list of domains and IP addresses that are
allowed access the script. Use it to prevent others from accessing the
program from another server. Replace yourdomain.com and the IP numbers
to match your site (case insensitive). You can add as many as you like.
@referers = ('yourdomain.com','another.com','another2.com');
@referers = ('yourdomain.com');
As you can see each item should be in single quotes and seperated
by a comma (unless there is only 1 item, then no comma is required)
3. $image_dir = '/home/w2w/www/images';
====================================================================
The full path to the directory where your image files are stored. Do
not include the trailing slash.
4. $error_log = "/home/w2w/www/cgi-bin/image/error.log";
====================================================================
The full path to the location of your log file (error.log) including the
file name. The default file name is "error.log".
D. Upload image.cgi and error.log into your cgi-bin directory using ASCII mode
(any other mode would make things not work).
E. Chmod the image.cgi to 755. Chmod the error.log to 777.
Script Usage
====================
To use the script you would call it in a normal A tag. Say the script
is all configured and I want to get the file "abc.gif", I would
use...
OR
The script will then load that image if it is in the images directory.
You may also create sub-directories in the image directory and place
images there for organization. Say I have a directory "123" and in
there I have the file "abc.gif". I would use...
The script will not allow you to use...
To Do List
====================
- Add an option which would place each image on its own HTML page.
- Limit the size/duration of the log file.
- Make logging optional.