Debian Codegraph @

data/e2guardian.pl

raw
1 #!/usr/bin/perl
2
3 $allow_html_code = 0;
4 &ReadEnvs;
5
6 $deniedurl = $in{'DENIEDURL'};
7 $reason = $in{'REASON'};
8 $user = $in{'USER'};
9 $ip = $in{'IP'};
10 $cats = $in{'CATEGORIES'};
11
12 # originating hostname - can be undefined
13 $host = $in{'HOST'};
14
15 # virus/filter bypass hashes
16 # if bypass modes have been set to > 0,
17 # then the GBYPASS or GIBYPASS variable will contain the filter/infection bypass hash.
18 # if bypass modes have been set to -1,
19 # then the HASH variable will be set to 1 if the CGI should generate a GBYPASS hash (filter bypass),
20 # or 2 if the CGI should generate a GIBYPASS hash (infection bypass).
21
22 $fbypasshash = $in{'GBYPASS'}; # filter bypass hash - can be undefined
23 $ibypasshash = $in{'GIBYPASS'}; # infection bypass hash - can be undefined
24 $hashflag = $in{'HASH'}; # hash flag - can be undefined; 1 = generate GBYPASS; 2 = generate GIBYPASS
25
26
27 print "Content-type: text/html\n\n";
28 print '<HTML><HEAD><TITLE>e2guardian - Access Denied</TITLE></HEAD>';
29 print '<BODY><CENTER><H2>ACCESS HAS BEEN DENIED</H2>';
30 if (length($user) > 0) {
31 print "<br><em>$user</em>, access to the page:<P>";
32 }
33 else {
34 print '<br>Access to the page:<P>';
35 }
36 print "<strong><a href=\"$deniedurl\">$deniedurl</a></strong>";
37 print '<P>... has been denied for the following reason:<P>';
38 print "<strong><font color=\"#ff0000\">$reason</font></strong>";
39 if (length($cats) > 0) {
40 print '<P>Categories:<P>';
41 print "<strong><font color=\"#ff0000\">$cats</font></strong>";
42 }
43 print '<P>Your username, IP address, date, time and URL have been logged.';
44 print '<P><table border=1 bgcolor="#FFEE00"><tr><td>You are seeing this error because the page you attempted<br>';
45 print 'to access contains, or is labelled as containing, material that';
46 print '<br>has been deemed inappropriate.</td></tr></table>';
47 print '<P><table border=1 bgcolor="#44dd44"><tr><td>If you have any queries contact your ICT Co-ordinator or Network Manager.</td></tr></table>';
48 print '<P><font size=-3>Powered by <a href="http://e2guardian.org" target="_blank">e2guardian</a></font>';
49 print '</center></BODY></HTML>';
50
51 exit;
52
53
54
55
56
57 sub ReadEnvs {
58 local($cl, @clp, $pair, $name, $value);
59 if ( $ENV{'REQUEST_METHOD'} eq 'POST' ) {
60 read(STDIN, $cl, $ENV{'CONTENT_LENGTH'} );
61 }
62 else {
63 $cl = $ENV{'QUERY_STRING'};
64 }
65 @clp = split(/::/, $cl);
66 foreach $pair (@clp) {
67 ($name, $value) = split(/==/, $pair);
68 $value =~ tr/+/ /;
69 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
70 $value =~ s/<!--(.|\n)*-->//g;
71 if ($allow_html_code != 1) {
72 $value =~ s/<([^>]|\n)*>//g;
73 }
74 $in{$name} = $value;
75 }
76 }
77
78
79
80