]> granicus.if.org Git - apache/blob - support/phf_abuse_log.cgi.in
fix copyright dates according the first cehck in
[apache] / support / phf_abuse_log.cgi.in
1 #!@perlbin@
2 #
3 # Copyright 2001-2004 Apache Software Foundation
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 #
18 # This script is used to detect people trying to abuse the security hole which
19 # existed in A CGI script direstributed with Apache 1.0.3 and earlier versions.
20 # You can redirect them to here using the "<Location /cgi-bin/phf*>" suggestion
21 # in httpd.conf.  
22 #
23 # The format logged to is
24 #    "[date] remote_addr remote_host [date] referrer user_agent".
25
26 $LOG = "/var/log/phf_log";
27
28 require "ctime.pl";
29 $when = &ctime(time);
30 $when =~ s/\n//go;
31 $ENV{HTTP_USER_AGENT} .= " via $ENV{HTTP_VIA}" if($ENV{HTTP_VIA});
32
33 open(LOG, ">>$LOG") || die "boo hoo, phf_log $!";
34 print LOG "[$when] $ENV{REMOTE_ADDR} $ENV{REMOTE_HOST} $ENV{$HTTP_REFERER} $ENV{HTTP_USER_AGENT}\n";
35 close(LOG);
36
37 print "Content-type: text/html\r\n\r\n<BLINK>Smile, you're on Candid Camera.</BLINK>\n";