#! /usr/bin/perl # 'blocked' script for squidGard installation on SmoothWall GPL or related # firewalls. # # By : Chris Lowth # Date : 10th May 2003 # Web site : http://www.lowth.com/sg4sw # # Released under the terms of the GNU General Public License, Version 2 (June # 1991) - see: http://www.lowth.com/sg4sw/COPYING.txt print "Content-type: text/html\n\n"; print "

Access to this web site is blocked by the firewall

\n"; print "Please dont continue to try to access it or others like it.

\n"; $qs = $ENV{QUERY_STRING}; if ( $qs =~ m{^clientaddr=(.*?)\+clientname=(.*?)\+clientident=(.*?)\+srcclass=(.*?)\+targetclass=(.*?)\+url=(.*)$} ) { $clientaddr = $1; $clientname = $2; $clientident = $3; $srcclass = $4; $targetclass = $5; $url = $6; } print "\n"; print "
Client address$clientaddr\n"; print "
Client Name$clientname \n"; print "
Client ident$clientident \n"; print "
Source class$srcclass\n"; print "
Target class$targetclass\n"; print "
URL$url\n"; print "
\n"; open(LOG, ">> /var/log/squid/blocked.log") or print "Cant open log file"; print LOG localtime() . " : $clientaddr : $targetclass : $url\n"; close(LOG);