phf_abuse_log.cgi revision 09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1
797N/A#!/usr/local/bin/perl
797N/A
797N/A# This script can be used to detect people trying to abuse the security hole which
797N/A# existed in A CGI script direstributed with Apache 1.0.3 and earlier versions.
797N/A# You can redirect them to here using the "<Location /cgi-bin/phf*>" suggestion in
797N/A# httpd.conf.
797N/A#
797N/A# The format logged to is "[date] remote_addr remote_host [date] referrer user_agent".
797N/A
797N/A$LOG = "/var/log/phf_log";
797N/A
797N/Arequire "ctime.pl";
797N/A$when = &ctime(time);
797N/A$when =~ s/\n//go;
797N/A$ENV{HTTP_USER_AGENT} .= " via $ENV{HTTP_VIA}" if($ENV{HTTP_VIA});
797N/A
797N/Aopen(LOG, ">>$LOG") || die "boo hoo, phf_log $!";
797N/Aprint LOG "[$when] $ENV{REMOTE_ADDR} $ENV{REMOTE_HOST} $ENV{$HTTP_REFERER} $ENV{HTTP_USER_AGENT}\n";
797N/Aclose(LOG);
797N/A
7161N/Aprint "Content-type: text/html\r\n\r\n<BLINK>Smile, you're on Candid Camera.</BLINK>\n";
797N/A