Code Library
Home Submit Free Hosting Link To Us Contacts

CGI Bandwidth Bandit

CGI Bandwidth Bandit CGI CGI Bandwidth Bandit Download (.zip)



#!/usr/bin/perl

$domain = "mikesworld.net";
$busted = "http://www.example.com/testimage.gif";
$directory = "images";

unless ($ENV{'HTTP_REFERER'} =~ $domain) {
        print "Location: $busted\n\n";
        exit;
}

($name,$ext)=split('&',$ENV{'QUERY_STRING'});

print "Content-type: image/" . (($ext eq 'jpg') ? 'jpeg' : $ext) . "\n\n";
open (image,"$directory/"."$name".".$ext") or die; 
while (read image, $buf, 1024) { 
print $buf;                                         
}
close image;




  • CGIBandwidth Bandit


Tatet