#!/usr/bin/perl $allow_html_code = 0; &ReadEnvs; $deniedurl = $in{'DENIEDURL'}; $reason = $in{'REASON'}; $user = $in{'USER'}; $ip = $in{'IP'}; $cats = $in{'CATEGORIES'}; # originating hostname - can be undefined $host = $in{'HOST'}; # virus/filter bypass hashes # if bypass modes have been set to > 0, # then the GBYPASS or GIBYPASS variable will contain the filter/infection bypass hash. # if bypass modes have been set to -1, # then the HASH variable will be set to 1 if the CGI should generate a GBYPASS hash (filter bypass), # or 2 if the CGI should generate a GIBYPASS hash (infection bypass). $fbypasshash = $in{'GBYPASS'}; # filter bypass hash - can be undefined $ibypasshash = $in{'GIBYPASS'}; # infection bypass hash - can be undefined $hashflag = $in{'HASH'}; # hash flag - can be undefined; 1 = generate GBYPASS; 2 = generate GIBYPASS print "Content-type: text/html\n\n"; print 'e2guardian - Access Denied'; print '

ACCESS HAS BEEN DENIED

'; if (length($user) > 0) { print "
$user, access to the page:

"; } else { print '
Access to the page:

'; } print "$deniedurl"; print '

... has been denied for the following reason:

'; print "$reason"; if (length($cats) > 0) { print '

Categories:

'; print "$cats"; } print '

Your username, IP address, date, time and URL have been logged.'; print '

You are seeing this error because the page you attempted
'; print 'to access contains, or is labelled as containing, material that'; print '
has been deemed inappropriate.
'; print '

If you have any queries contact your ICT Co-ordinator or Network Manager.
'; print '

Powered by e2guardian'; print '

'; exit; sub ReadEnvs { local($cl, @clp, $pair, $name, $value); if ( $ENV{'REQUEST_METHOD'} eq 'POST' ) { read(STDIN, $cl, $ENV{'CONTENT_LENGTH'} ); } else { $cl = $ENV{'QUERY_STRING'}; } @clp = split(/::/, $cl); foreach $pair (@clp) { ($name, $value) = split(/==/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; if ($allow_html_code != 1) { $value =~ s/<([^>]|\n)*>//g; } $in{$name} = $value; } }