3 # Copyright 2000-2004 Apache Software Foundation
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
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
23 # The format logged to is
24 # "[date] remote_addr remote_host [date] referrer user_agent".
26 $LOG = "/var/log/phf_log";
31 $ENV{HTTP_USER_AGENT} .= " via $ENV{HTTP_VIA}" if($ENV{HTTP_VIA});
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";
37 print "Content-type: text/html\r\n\r\n<BLINK>Smile, you're on Candid Camera.</BLINK>\n";